![]() |
|
|
|
#1
|
|||
|
|||
|
Quote:
Now there are plenty of examples and missions posted in this section. Of cause it is not easy to find them if you did not follow the discussion from April. It takes time, weeks and months, to learn something new. If you tell what modules you would like to use in your mission I will try to tell you in which threads/examples they are available. It is better to start a new thread for each new module you need. Kodiak and other people knowing C# are very helpful and helped me a lot even back in April not having any manual (they just looked up lists of methods, etc. from .dll files in Visual Studio): Quote:
Last edited by Ataros; 09-24-2011 at 10:44 AM. |
|
#2
|
|||
|
|||
|
Please find my script library attached. It includes script collections from this forum section sorted by topic as well as some mission examples.
Please feel free to ask questions on particular scripts but it is better to start new threads for each topic. Not all scripts are working and 100% correct. I am not a C# expert and will not be able to answer all questions but others who helped me with writing scripts will help I am sure. |
|
#3
|
||||
|
||||
|
Quote:
many thanks for the piece on Visual Studio. I have it now and been looking at the methods etc. It is starting to make some sense but I am still grappling with it. I have succeeded in one test module to determine the sector I am in and report it to myself, just a test to help me get to grips with how it all goes together. Now working on SayToGroup which Kodiak put me on to as I'd like to avoid those banner messages if I can. Anyway, still early days but thanks and special thanks for that library zip.
__________________
klem 56 Squadron RAF "Firebirds" http://firebirds.2ndtaf.org.uk/ ASUS Sabertooth X58 /i7 950 @ 4GHz / 6Gb DDR3 1600 CAS8 / EVGA GTX570 GPU 1.28Gb superclocked / Crucial 128Gb SSD SATA III 6Gb/s, 355Mb-215Mb Read-Write / 850W PSU Windows 7 64 bit Home Premium / Samsung 22" 226BW @ 1680 x 1050 / TrackIR4 with TrackIR5 software / Saitek X52 Pro & Rudders |
|
#4
|
|||
|
|||
|
many thanks for the piece on Visual Studio
Yes thanks Ataros, that's very useful I have succeeded in one test module to determine the sector I am in and report it to myself Nice one, and any code you're working on would be valuable for inspection klem, this sounds the way to go, to get feedback from small test sections, what plane we're in, small steps I wonder if the 'get' command/method can be used to get at variables and display info http://msdn.microsoft.com/en-us/libr...(v=vs.80).aspx C# is a bit flash. For example get is an 'accessor' apparently. Who writes this stuff Quote:
Ming |
|
#5
|
|||
|
|||
|
simply said get; and set; are short versions for class design.
example: public class test() { public string Name {get; set;} } so you can use: test newobject = new test(); newobject.Name = "test1"; // this is the set string test2 = newobject.Name; // this is the get the long version public class test() { private string name; public void SetName (string newname) { name = newname; } public string GetName () { return name; } } so you must use: test newobject = new test(); newobject.SetName("test1"); string test2 = newobject.GetName(); only a simple example. |
|
#6
|
|||
|
|||
|
Thanks Kodiak!
Kodiak can you tell us how to get at variables in the maddox dlls please? I use pseudo-code to give an example- I imagine something like Airfield.FlakCannon.Temperature Airfield.FlakCannon.Temperature is a variable and it is 200 (Centigrade) If Airfield.FlakCannon.Temperature > 199 Then- HoseDownCannon() This means- if an airfield flak cannon is getting hot, pour cold water on to the barrel Can we use get to return the temperature of the flak cannon barrel? Can we use get to return values of variables deep inside the Maddox dlls in running missions? Coincidentally Kodiak - I am coming here now to say that I have my Hello World thanks to you And now I can see a trigger working, and I understand that everything will work. I think I am in love with Maddox team For FMB-nuts For the script code- using System; using maddox.game; using maddox.game.world; public class Mission : maddox.game.AMission { public override void OnTrigger(int missionNumber, string shortName, bool active) { base.OnTrigger(missionNumber, shortName, active); if ("CrossLake".Equals(shortName) && active) { GamePlay.gpHUDLogCenter("Now crossing the lake"); GamePlay.gpGetTrigger(shortName).Enable = false; } } } This above is Kodiak's code with an identifiable (to me) object to get near, the lake north of Sandwich on the 1940 map. Nothing is happening but if you make small stubs like this you can see things like- For at least singleplayer missions, missionNumber and shortName do not need to be known... I look at variables and wonder where they are, but for testing purposes some things can remain unknown ____________________________ For the mission text after including Kodiak's script and setting the trigger- [PARTS] core.100 bob.100 [MAIN] MAP Land$English_Channel_1940 BattleArea 150000 100000 100000 150000 1000 TIME 12 WeatherIndex 0 CloudsHeight 1000 BreezeActivity 10 ThermalActivity 10 player BoB_RAF_F_19Sqn_Early.000 [GlobalWind_0] Power 3.000 0.000 0.000 BottomBound 0.00 TopBound 1500.00 GustPower 5 GustAngle 45 [splines] [AirGroups] BoB_RAF_F_19Sqn_Early.01 [BoB_RAF_F_19Sqn_Early.01] Flight0 1 Class Aircraft.SpitfireMkI Formation VIC3 CallSign 31 Fuel 100 Weapons 1 Scramble 1 Skill 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 [BoB_RAF_F_19Sqn_Early.01_Way] NORMFLY 248451.23 259151.63 500.00 300.00 NORMFLY 246594.30 247927.34 1000.00 300.00 [CustomChiefs] [Stationary] [Buildings] [BuildingsLinks] [Trigger] CrossLake TPassThrough 0 247385 252352 1900 ________________________________ Observe dear learner-comrade that making an entry in the Edit/script/Triggers code-box creates the [Trigger] entry at the end there ^. The trigger is your Player plane crossing the radius around the lake For the universal AirfieldEmergency script version, all airfields in the mission must be known, and all must have a detection-radius Sometimes we RTB, but sometimes we need to land at an Alternate airfield. Sometimes we do not know what airfield we must land at - we only care that we can land our plane and maybe stay alive too To be more efficient we do not need to cover all airfields, we can emergency-cover airfields in the immediate area - not the area west of London when we are defending ships in the Channel area for example In Il-2 online campaigns (SEOW) we often land damaged at the nearest airfield and we pray it's a friendly airfield. Imagine if fire engines had come out to meet us. But wait- imagine if it's an enemy airfield and flak-defence spawns... Ming |
|
#7
|
|||
|
|||
|
Quote:
ps. Updated my collection. Hope it is more readable now. http://forum.1cpublishing.eu/showthread.php?t=26523 |
|
#8
|
||||
|
||||
|
Quote:
I wanted to find out what sector a Tanker group is in (when I say 'group' I can't find a way to identify a few tankers as a Group, they are just a group to me because thay travel together waiting to be sunk or arrive at their destination). Now, bear in mind I'm new to all this and I'm feeling my way forward with my fingers so there may be better ways of doing it but if any of my Tanker group arrives in a certain "destination" sector it has "arived safely". I want to announce that but I also wanted to call up the grid it is in and Remove all objects in that sector as they are no longer relevant. Of course I know what that sector is but coding actual data like sector numbers into a module is anathema to me so I want the code to find out so that I can re-use the module whenever I like. I haven't got this far yet, I have only just worked out how to use GamePlay.gpSectorName(actor.Pos().x, actor.Pos().y).ToString() :surprise: For testing I set it in the context of the player entering the cockpit and being told where he is: public override void OnPlaceEnter(Player player, AiActor actor, int placeIndex) { base.OnPlaceEnter(player, actor, placeIndex); AiAircraft aircraft = actor as AiAircraft; string sectors = ""; sectors += ' ' + GamePlay.gpSectorName(actor.Pos().x, actor.Pos().y).ToString() + ";"; GamePlay.gpHUDLogCenter(new Player[] { player }, "You are in Sector " + sectors); } So now I have to find out how to 'group' the Tankers or maybe work through all Tankers for those in the sector and then how to remove them. The big plan is to create a mission that runs for a long time, measuring objectives (Tankers home safe or not etc) then start a new phase of the battle without loading a sub-mission (sub-missions cause the phantom dots problem), just send the pilots to rtb within a certain timeframe (or be destroyed), clear all old objects, create new ones and carry on from there. Its a big project and probably causing the mission experts to wince but its all good learning stuff and if it nevers comes to fruition at least I'll have had an interesting time.
__________________
klem 56 Squadron RAF "Firebirds" http://firebirds.2ndtaf.org.uk/ ASUS Sabertooth X58 /i7 950 @ 4GHz / 6Gb DDR3 1600 CAS8 / EVGA GTX570 GPU 1.28Gb superclocked / Crucial 128Gb SSD SATA III 6Gb/s, 355Mb-215Mb Read-Write / 850W PSU Windows 7 64 bit Home Premium / Samsung 22" 226BW @ 1680 x 1050 / TrackIR4 with TrackIR5 software / Saitek X52 Pro & Rudders |
|
#9
|
|||
|
|||
|
For testing I set it in the context of the player entering the cockpit and being told where he is
Good work klem that works first time It's amazing that one can simply add your routine to my original lake-trigger and both my trigger and your location-indicator work without problems. I'd have bet that something would go wrong You've got 'sectors' so I imagine that you can create a 1940 War Room map table one day, with the Toblerone bars and the pretty WAAFs A group of oilers, are you thinking of Malta <dreaming, more 'one day, one day' stuff> - I'm not sure that they'd figured out efficient convoys in 1940. Oh U-Boats yes and rendezvous for re-fuelling. We're sending in the Sunderlands Ming |
|
#10
|
|||
|
|||
|
Nice script lines, Klem. Very usefull, while mission testing. Could also be used for OnPilotBailedOut to direct SAR operations to the pilot.
How do you know that? I also have experienced phatoms, while simply testing missions. In observation, this is a lag problem, because only objects are rendered in your viewing distance (you can see this while switching through external view, that only the objects are rendered, which are somewhat close to you). At some point the game stopped rendering an object, because a player left or got out of sight. Another player gets in range of the drawing distance of the object and the game starts calculating the new position of the object, but lost it somewhere, because of high work load in the net transmission. I think that is hard to explain for me, but easily observed with AI travelling tankers. Put enough of them in a group and start out of sight, get close to them and they will appear as ghostships, fist the dot, then grwoing but then suddenly gone and only the smoke of the funnel is still there. PS: I think Blis removed all submissions from ATAG Server and only loads AI via CMD - and he still has the Ghost-Syndrom on the server.
__________________
http://cornedebrouwer.nl/cf48e Last edited by SNAFU; 09-28-2011 at 02:20 PM. |
![]() |
|
|