![]() |
Quote:
Code:
protected AMission () Another way is to use onTrigger method with really big trigger radius around an airfield and check what aircraft parts are damaged. There was a sample script posted in the main section that prints out damaged parts to a chat window. Therefore I guess it is possible to do this. The 3rd alternative could be to combine both of the above ways and flag a damaged group OnAircraftDamaged and then onTrigger check if the incoming group is flagged as damaged. Again I do not know C# and can be wrong. It is better to start a new thread with these particular questions where real experts will offer their solutions. hc_wolf combined several naryv examples and others' scripts into one mission. You can have a look at how he did this and do the same if you know C#. If no one can answer questions on this forums you can ask naryv directly as adonys did in this thread http://www.sukhoi.ru/forum/showthrea...=1#post1647624 Sometimes naryv does not answer if the functionality requested is not ready yet or does not work properly or is changing at the moment. All script methods are WIP I think ATM. We will not see the manual till engine functionality and script methods are 90% finalized imho because there is no point to spend time on a manual that will not be valid in 2 months. I expect it to come with Battle for Moscow at the earliest. But again if you know C# you can find all necessary information on this forums in naryv, adonys, Kodiak, Wolf, TheEnlightenedFlorist, vetochka, stillborn, etc. examples. Scripting discussion was started 5 months ago in this thread (Yes, I know it is hard for the first 6-8 weeks till you learn some basics :) ) http://forum.1cpublishing.eu/showthread.php?t=21518 Many of my noob's questions were answered there by С# programmers. Again this forum section has more then enough information to start programming for CloD if you know C# basics at least. Guys and a lady mentioned above have proved it many times already. This forum section is only 9 pages long not too much to look though to get all the information needed to be able do the same imho. ps. Of cause I would be more than happy if Kodiak or other C# programmers agree to publish some tutorials but for me it is not clear if the tutorials should be about C# basics or about CloD methods and functions. |
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. |
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:
|
1 Attachment(s)
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. |
Lovely to see things looking up :)
How to construct an AirfieldEmergency script from first principles while explaining the steps, that's what I'd like to see. A concrete example with commentary that's fairly simple (if the detecting of the damaged plane crossing the AlarmRadius can be done) There's almost 800 references to Maddox functions, classes, methods and wotnot so I'm imagining that it's on There's the introductory part to a script, where databases of functions, subroutines (BASIC/Visual Basic) we will need access to in the running script, these might be- using System; using System.Collections.Generic; using maddox.game; using maddox.game.world; using maddox.GP; The script then begins and it's at this point that we pupils need statements commented please. We can figure out what each line of code means but it's like examining atoms without knowing about the Table of Elements. We can see that they're all different and they all must mean something, there must be some rhyme to it, we are not idiots :) 'We need this line to see if any planes are already in the mission' (the mission designer created an unknown number of planes) 'We need this line to step through each plane to see if it is damaged' (all planes in all running missions can be checked) 'This line instantiates/spawns a plane/vehicle at this XYZ position' (if the position is clear) This scripter's commentary gives us a chance to ask the scriptwriter a sensible question... it's very difficult to ask sensible questions without a handle to hang the question on. For example how can you tell if a possible spawning position is clear of obstructions. But that's another story probably :) Ming |
Wow thanks very much for your collection Ataros!
It is better to start a new thread for each new module you need Wiil do, thanks they just looked [FMB stuff] up Kodiak works/worked for Maddox perhaps - this is a compliment btw. He/she definitely knows his stuff. Let's face it somebody has to :) onTrigger method with really big trigger radius around an airfield A trigger radius hmm - thanks :) (I'll see if I can trigger a message 'We see your plane incoming, it looks damaged...' to 'Crossed the airfield EmergencyAlertRadius') Thinking out loud then- two airfields say Croydon and Biggin Hill and my single plane taking off at one airfield. Testing the other airfield's EmergencyAlert (procedure) - with a simple onscreen message if my plane trips the second airfield's trigger. Baby steps. Adding the trigger in a script rather than via the FMB, to make it universal. Does the FMB write trigger code into the dot cs I wonder. I know that airfields have one radius and then another radius Ming |
Quote:
According to the devs to make FMB triggers work together with any script you can add this code to script. Action and trigger must have the same name in this case. Code:
ps. BTW are you one of simhq admins by chance? I have trouble registering at simhq forums somehow. Same nickname. |
Very nice thanks Ataros!
Trigger has its own radius. It is set in FMB and is stored in a mission file, not in script file I am trying to think universally, where scripts are independent of missions, so setting the radius in the FMB (while working perfectly yes) is not what I'm after An airfield built by construction engineers (looking forward to D-Day) would not have a radius but it would be an Airfield object and a script could (hopefully) read and return the AirfieldEmergency distance. That could be a constant couple of miles perhaps and would apply to all airfields, permanent or temporary. We often create small airfields fairly close together for multiplayer dogfights - created in Il-2 I mean Thanks for that info mate, no I'm not an admin over there but I will advise admin Dart that you're having problems and get back to you Ming |
In this example naryv creates a mission file by script. http://forum.1cpublishing.eu/showthread.php?t=23493
The file is called triggersFile. Actually it is a "section" file, i.e. a segment of a mission file. Code:
public ISectionFile triggersFile Code:
keyTr = "changeArmy" + i.ToString()+"_1"; // попутно на маркере делаем два триггера - для каждой стороны |
Thanks Ataros, hugely interesting
The clue that 500 is the radius no wait it's a radius- is that an airfield radius I wonder? There are two radii for each airfield This is a command to assemble a string, can you decode the string please? Something like- TPassThrough Ahah :) pass through, passes through, crosses a radius... Decoding, building a string- TPassThrough 3 1 strs[0] (red or blue maybe, 'red' from Babelfish) strs[1] appears to be a 'coordinate' from Babelfish -it gets quite complicated eg- double y; double.TryParse( strs[1], out y); 500 Maybe the whole assembled string is a coordinate somewhere on the map, with a radius around the coordinate of 500m Yes that sounds reasonable, if we can now work out a test value for the cryptic strs[1] valueTr = " TPassThrough 3 1 " + strs[0] + " " + strs[1] + " 500"; Maybe the TPassThrough trigger is documented somewhere, I'll see what I can find, the mysterious (without C# string-operation knowledge) coordinate bit is interesting 'TPassThrough: gets active' - does this mean that some Boolean variable is set to True or False? How to link to the emergency ambulance method I wonder, If NoBellsAreRinging CarryOn = True :) Working left for inspection :) Ming Quote:
|
All times are GMT. The time now is 01:23 AM. |
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.