![]() |
|
#1
|
||||
|
||||
![]() Quote:
I am familiar with the basic principles of coding even though it is from years of Visual Basic and VBS not C#. We can see from the .cs files that they are fundamentally modular leading to the possibility of module examples in response to requests and other examples simply posted by people who have already developed them. Yes, that calls for the patience and good will of the knowledgeable guys who would essentially be filling a void left in the game application. What I had hoped for was a bank of these modules with a basic very brief explanation of their purpose so that we could interpret, learn to understand and use. Studying existing modules is one way but is long and laborious as you first have find one that may contain what you want, understand what the script module is trying to do and you still may not find what you are looking for. There are many methods and objects etc created in the Maddox game that are unknown to many of us. Some are confusing such as 'Actor' meaning Aircraft (as far as I can make out) not 'Player'. Some of our 1C friends know these and are in a position to help and advise. I spent a lot of time in my career teaching people various subjects at various levels from electronic maintenance to business management. One of the dangers of those doing the teaching, or presenting examples/guides, is that they see things from 'the inside looking out' instead of where their pupils are, 'on the outside looking in' and often into a dark black box of a world they just don't know about yet. We tend to assume that if we are familiar with a concept or a detail which is so basic to us, we take it for granted that our 'pupils' will already have that knowledge. So jargon, assumed knowledge etc lead to a gulf between what is being presented and what is being received. Some my my maintenance pupils didn't need to be electronics experts to understand and fault find modular equipment on an oil rig in the middle of the Gulf, they just needed to know how to piece information and blocks together to fix and get something working. We don't all need to be top-level C# programmers for CoD, we do need to understand basic principles (which can be read up or learned) and then have the support of those around us on the Maddox game-specific aspects and how they are used. My hope was to open up the Maddox coding world to semi-laymen like myself. It may not reach all players but I think it would open up mission coding for quite a few. Of course I could study C# in great depth, then find and study all the aspects of the Maddox game but frankly I'm not willing to spend that much time on it. If the FMB didn't give us a graphical means of creating very basic missions I wouldn't be bothering with making them as I'd no doubt have to study even more. Its not that I want an easy path, just an easier path than we have at the moment. No, wait, I do want an easy path, I didn't buy this game to have to study programming in order to use it! I wonder what level the SDK will be pitched at, whether there will be graphical interfaces and whether it will be for maps, for aircraft or even mission building. Lets face it, these things will fall on a very few shoulders if its all bare coding and will deny the rest of us those opportunities which I see as a fundamental part of what I have bought. Anyway, a 1C-forum coding library isn't going to happen. Getting people to agree on a single solution is harder than learning C#. I guess I am just over-optimistic, after all if I wasn't I'd have dumped CoD and followed the majority of my Squadmates who have given up on CoD and bogged off into RoF.
__________________
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 |
#2
|
|||
|
|||
![]() 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 09:44 AM. |
#3
|
|||
|
|||
![]()
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. |
#4
|
||||
|
||||
![]() 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 |
#5
|
|||
|
|||
![]()
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 |
#6
|
|||
|
|||
![]()
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. |
#7
|
|||
|
|||
![]()
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 |
#8
|
|||
|
|||
![]() Quote:
![]() ps. Updated my collection. Hope it is more readable now. http://forum.1cpublishing.eu/showthread.php?t=26523 |
#9
|
||||
|
||||
![]() 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 |
#10
|
|||
|
|||
![]()
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 |
![]() |
|
|