PatrickAWlson Posted June 28, 2023 Posted June 28, 2023 The latest update supports Recon and Artillery Spotting missions. Any good examples of how they are made? Have RoF elements been brought back?
AEthelraedUnraed Posted June 28, 2023 Posted June 28, 2023 Flash scripts, you can find them in the swf folder Any particular questions you have?
PatrickAWlson Posted June 29, 2023 Author Posted June 29, 2023 Pretty much a "how to". Especially artillery spotting. That was an absolute nightmare to code in RoF, I don't even know how long this capability has been available. Just haven't looked into it until now so I am basically clueless as to what we have.
AEthelraedUnraed Posted June 29, 2023 Posted June 29, 2023 (edited) Well, I don't know about the artillery spotting script specifically, but in general it works like this: - You start the flash script using a Media Translator. - If configured that way, the script will capture mouse input and respond to GUI input (if it has any). - The script will trigger some of the OnFlashDialogActionXX events (XX ranging from 00 to 15) depending on the programmed behaviour. - You can link these events in your mission to trigger certain actions (they work just like any other message). - The script will send the OnMediaStopped event when it's finished, which again you can use to trigger other stuff in your mission (note that the script has to be programmed to send this message too). If you're good at programming, you can even write your own flash scripts if you've got a flash decompiler/compiler Edited June 29, 2023 by AEthelraedUnraed 1 1
Jaegermeister Posted July 2, 2023 Posted July 2, 2023 On 6/29/2023 at 9:45 AM, PatrickAWlson said: Pretty much a "how to". Especially artillery spotting. That was an absolute nightmare to code in RoF, I don't even know how long this capability has been available. Just haven't looked into it until now so I am basically clueless as to what we have. It's been available for quite a while, but it was never really announced even though the .swf files were in place with the GUI graphics for a year or so. The bugs have been corrected, so now it works correctly regarding altitude and having active objects on the map. All of that was just finished about 2 updates ago and coincided with the release of the Arado 234 and the Spitfire Recon planes. I never worked with ROF, but it appears to be coded the same way, so unfortunately your nightmare may continue in this respect. I figured out how to do certain things with it by referencing old ROF forums and simply experimenting with what popped up on screen when a flash file was activated and inferring what to do with it. As of now I have never seen any form of guide or instructions for using them. @Juri_JS and @AEthelraedUnraed seem to have the best grip on it at the moment. The commands are limited to 16 actions plus an "On stopped" command, so the graphics tend to correspond with that number of options. the artillery spotting grid is the only one that might be complicated if you wanted to use the commands as X and Y coordinates to increase your map grid size from 4x4.
AEthelraedUnraed Posted July 2, 2023 Posted July 2, 2023 (edited) 12 hours ago, Jaegermeister said: As of now I have never seen any form of guide or instructions for using them. @Juri_JS and @AEthelraedUnraed seem to have the best grip on it at the moment. Actually, I have little experience with the builtin scripts. I do have some experience writing my own scripts though. I recently wrote a script that lets your Bordfunker "radar"-guide you to the nearest enemy, for nightfighting purposes. It uses a somewhat complicated linking with the Mission Editor to give sequences like the following, both audible and in the chat on the left: "Funkmeßkontakt. Entfernung zwo-null. Lisa. Einhunderd höher. Entfernung fünf. Rolf Rolf. Kontakt verloren." Right now, I'm struggling with a ground-based version which should calculate an interception course based on speed and heading of the enemy bomber. Whenever that's finished, I should be able to incorporate both in the Nachtjagd campaign that I'm writing. Just in case anyone wants to develop his own scripts, I'll dump some of my findings below: Spoiler You can edit flash scrips using a decompiler/compiler. I use JPEXS Free Flash Decompiler. They are normal flash scrips and seem to support most, if not all, of ActionScript. I had never used ActionScript before, but it looks a lot like Java/Javascript or even C so if you know any of those languages you should be fine. There is a huge library (see data\swf\interface.gfx for the complete one; look especially for the sim.api.game stuff inside it) that allows you to connect to the game to send messages, read object info, etc. Note that there is *no* documentation whatsoever, although the function names are usually descriptive enough that you can kinda guess what it returns. If you want to use any of these functions, you need to include the file in which it's declared in your own script. E.g. if you want to read the variable yAngle from the SimWorldObject class, you need to copy the sim.api.game.worldobjects\SimWorldObject file from interface.gfx to your own project. There is no debugging possible, besides outputting the value of a variable your interested in into the GUI. If the script returns an error, it usually simply stops running although its GUI remains visible. If you're really unlucky, it may not only crash the game but make your whole computer incredibly slow until you've killed il2.exe. Since you store a compiled version of the script, you cannot leave comments. A workaround I use is to store comments into the this.comment string variable. Graphics files are always cached in memory (so changes always require a restart of IL2 to show up). The script itself sometimes is, sometimes isn't. If you've changed the script and it's easy enough to see whether or not IL2 loads the updated script, go ahead and restart the mission, otherwise you need to restart IL2. When the GUI is visible, speeding up, slowing down or pausing the game time is disabled. It is however possible to hide the GUI, after which all functions you've registered with e.g. a timeout will still trigger and allow you to keep your script running in the background. This allows you to change the in-game time scale again. I haven't tested whether timeouts use in-game time or real time, although I suspect the latter. Object info is only updated every once in a while. E.g. if an aircraft is flying at 300kph and you've just retrieved its position as (123.45, 98.76, 678.90), if you read it a second later, it's entirely possible it's still at (123.45, 98.76, 678.90). They're updated often enough to give you a good idea of where an object is, but don't expect to get real-time data. The OnFlashDialogActionXX and OnMediaStopped events are the only way to communicate with your mission scripting. You can call them at will from within your script. Note that this also goes for the OnMediaStopped event - if you really need a 17th message you could use it for something else entirely. @Regingrave @Han anything the Devs can add to this? Edited July 2, 2023 by AEthelraedUnraed 2
kraut1 Posted July 2, 2023 Posted July 2, 2023 (edited) 2 hours ago, AEthelraedUnraed said: Actually, I have little experience with the builtin scripts. I do have some experience writing my own scripts though. I recently wrote a script that lets your Bordfunker "radar"-guide you to the nearest enemy, for nightfighting purposes. It uses a somewhat complicated linking with the Mission Editor to give sequences like the following, both audible and in the chat on the left: "Funkmeßkontakt. Entfernung zwo-null. Lisa. Entfernung fünf. Rolf Rolf. Kontakt verloren." You have really created a working script which lets a crew member / radar operator report the distance and angle to an enemy plane? This would absolutely great, a revolution for IL2 GB single player gaming! A version for messages by wingmen / by normal gunners / observers of the player's plane crew would be extremely helpful. My audio warning messages that I use for some years are much more primitive (no direction to enemy plane). Is there already a working version of your script available? Edited July 2, 2023 by kraut1 1
JGr2/J5_Baeumer Posted July 2, 2023 Posted July 2, 2023 @PatrickAWlson as had been stated its been available for a few months. Unfortunately, its not suitable for myltiplayer which is a real shame. The on screen notices go out to all players on server tegardless of coalition, tipping off defenders, and .ultiple planes assigned the task can complete the mission even if the one which took pictures etc, goes down dead/crashed but a second (or third) objective assigned plane lands correctly. Should work for your solo career style missions however.
JG4_Deciman Posted July 3, 2023 Posted July 3, 2023 Hi there I was active in RoF and did also update/modify the used flash script there (photorecon) But for me it seems like that that part (flash scripts) is completely dead... You needed software to edit (and compile) the script And that meant -> having the SDK for the used scripts (actionScript 2) for flash installed. But Adobe stopped support for Flash some time ago completely... So the 'given' scripts/swf files/...' may work, but no way to update them Deci
AEthelraedUnraed Posted July 3, 2023 Posted July 3, 2023 20 minutes ago, JG4_Deciman said: Hi there I was active in RoF and did also update/modify the used flash script there (photorecon) But for me it seems like that that part (flash scripts) is completely dead... You needed software to edit (and compile) the script And that meant -> having the SDK for the used scripts (actionScript 2) for flash installed. But Adobe stopped support for Flash some time ago completely... So the 'given' scripts/swf files/...' may work, but no way to update them Deci That's why I use JPEXS Free Flash Decompiler - it's a free program and allows you to edit the scripts. It still receives regular updates even
JG4_Deciman Posted July 3, 2023 Posted July 3, 2023 11 minutes ago, AEthelraedUnraed said: That's why I use JPEXS Free Flash Decompiler - it's a free program and allows you to edit the scripts. It still receives regular updates even Same here... But having the source code (and beeing able to change it) is only 50% of the task. How do you recompile the changed scripts? Deci
AEthelraedUnraed Posted July 3, 2023 Posted July 3, 2023 8 hours ago, JG4_Deciman said: But having the source code (and beeing able to change it) is only 50% of the task. How do you recompile the changed scripts? JPEXS does that automatically by pressing the "save" button
IckyATLAS Posted July 7, 2023 Posted July 7, 2023 WoW its a new world of possibilities here. Just discovered this script thing. Unfortunately I have no time to spare for the moment to explore this new space. Anyhow, here is my small scenario Number 1: The player plane flies low under a certain altitude to avoid radar. But due to ground and whatever reasons he goes through the radar ceiling slightly. Can I with a script get the altitude of the player's plane and check if this value is over or under a certain altitude value , simulate a radar detection by vectoring enemy planes in the region to attack the player's plane. Scenario Number 2: I push a button and I can trigger an action (MCU etc.) in the game. Does script allow for these to work?
JG4_Deciman Posted July 7, 2023 Posted July 7, 2023 Hmmm, Talking about RiseOfFlight (where I managed to modify a script for PhotoReacon) - Yes Talking about BoX - No The difference is: In RoF there was an existing connection from the flash script to the Game that gave the ability to read positions and altitudes (and even more) for all objects. So there I was finally able to make even moving objects a reacon target and check if all conditions for a successfull photo have been matched - distance to target (2d) - plane oriantation (pitch/roll) - plane altitude Unfortunately that connection is not available any more (or I'm not able to find it) On the other side: Ability of getting all data for objects would open a door for cheating so I can understand that it was removed (and that was a good decision) Deci
AEthelraedUnraed Posted July 9, 2023 Posted July 9, 2023 On 7/7/2023 at 2:59 PM, IckyATLAS said: Anyhow, here is my small scenario Number 1: The player plane flies low under a certain altitude to avoid radar. But due to ground and whatever reasons he goes through the radar ceiling slightly. Can I with a script get the altitude of the player's plane and check if this value is over or under a certain altitude value , simulate a radar detection by vectoring enemy planes in the region to attack the player's plane. Scenario Number 2: I push a button and I can trigger an action (MCU etc.) in the game. Does script allow for these to work? Yes, both scenarios are perfectly possible. Although for the altitude trigger, I'd still go with the old trick using multiple huge spherical CheckZone MCUs. On 7/7/2023 at 5:30 PM, JG4_Deciman said: Hmmm, Talking about RiseOfFlight (where I managed to modify a script for PhotoReacon) - Yes Talking about BoX - No The difference is: In RoF there was an existing connection from the flash script to the Game that gave the ability to read positions and altitudes (and even more) for all objects. So there I was finally able to make even moving objects a reacon target and check if all conditions for a successfull photo have been matched - distance to target (2d) - plane oriantation (pitch/roll) - plane altitude Unfortunately that connection is not available any more (or I'm not able to find it) On the other side: Ability of getting all data for objects would open a door for cheating so I can understand that it was removed (and that was a good decision) Deci It's still possible to get a list of all aircraft and get individual data for them (at least position and rotation).
IckyATLAS Posted July 9, 2023 Posted July 9, 2023 12 hours ago, AEthelraedUnraed said: Although for the altitude trigger, I'd still go with the old trick using multiple huge spherical CheckZone MCUs. Yes I did so with really huge spheres. It is not a clean approach but it helps.
Jaegermeister Posted July 10, 2023 Posted July 10, 2023 On 7/2/2023 at 7:03 PM, PatrickAWlson said: Any sample missions out there? I have generated in game careers that include the type of mission I want to duplicate or analyze, proceeded with the campaign until I get the type of mission I am looking for and then open the .gen mission in the ME. That's the only sample missions I know of at the moment and deciphering them is difficult because none of the mission elements are grouped when they are generated from a template. It's time consuming but the information is there if you have the time to find it.
JG4_Deciman Posted July 10, 2023 Posted July 10, 2023 On 7/9/2023 at 11:16 AM, AEthelraedUnraed said: Yes, both scenarios are perfectly possible. Although for the altitude trigger, I'd still go with the old trick using multiple huge spherical CheckZone MCUs. It's still possible to get a list of all aircraft and get individual data for them (at least position and rotation). From within the flash script? In case yes contact me by PM because I need to know how. And only Planes or every other (unique named) ground object (trains, vehicles, ...) with an entity, too Deci
=KG76=flyus747 Posted August 16, 2023 Posted August 16, 2023 On 6/29/2023 at 2:11 PM, AEthelraedUnraed said: Well, I don't know about the artillery spotting script specifically, but in general it works like this: - You start the flash script using a Media Translator. - If configured that way, the script will capture mouse input and respond to GUI input (if it has any). - The script will trigger some of the OnFlashDialogActionXX events (XX ranging from 00 to 15) depending on the programmed behaviour. - You can link these events in your mission to trigger certain actions (they work just like any other message). - The script will send the OnMediaStopped event when it's finished, which again you can use to trigger other stuff in your mission (note that the script has to be programmed to send this message too). If you're good at programming, you can even write your own flash scripts if you've got a flash decompiler/compiler Do flash scripts work online?
LLv34_Temuri Posted August 24, 2023 Posted August 24, 2023 On 7/10/2023 at 3:22 PM, JG4_Deciman said: because I need to know how. I need to know too. Did you get the information?
1PL-Husar-1Esk Posted August 24, 2023 Posted August 24, 2023 Current flash script work online, recently interactions which are using flash were imported from ROF but devs do not fix those since ROF days - if you trigger it online all players on the server can see and interact with it , which is huge problem. Again less effort line taken unfortunately IMHO. Could it be fixed by community , perhaps?
LLv34_Temuri Posted August 25, 2023 Posted August 25, 2023 On 8/24/2023 at 2:40 PM, 1PL-Husar-1Esk said: Current flash script work online Ok, interesting. So now to look into how to use the flash script to write something to a file or some such on the server machine...
PatrickAWlson Posted December 28, 2024 Author Posted December 28, 2024 Was hoping somebody could take a look at this. The mission successfully triggers the LWIN-1 message. Pressing LWIN-1 then gives me the photo recon media. All good. My problem is that the photo widget is always X'd out. I'm not sure if my mission is messed up or if I just don't know how to use the in flight mechanisms to accomplish the task. ReconTest.zip
kraut1 Posted December 29, 2024 Posted December 29, 2024 23 hours ago, PatrickAWlson said: Was hoping somebody could take a look at this. The mission successfully triggers the LWIN-1 message. Pressing LWIN-1 then gives me the photo recon media. All good. My problem is that the photo widget is always X'd out. I'm not sure if my mission is messed up or if I just don't know how to use the in flight mechanisms to accomplish the task. ReconTest.zip 5.63 kB · 4 downloads I have never used this function, but I found a Video: (maybe it is only active when you are over the target?)
PatrickAWlson Posted December 29, 2024 Author Posted December 29, 2024 @kraut1 Thanks for the post. I had a conversation with @Jaegermeister and got things resolved. Turns out the mission really does work but the placement of the components made it difficult to complete. Changed that and it works fine. 2
PatrickAWlson Posted January 9 Author Posted January 9 I was hoping to get some help with Artillery Spotting. Mission attached in zip. The mission is pared down to the artillery spotting and does not have extra flights. Everything works great except the cannons don't fire. The media displays and correctly registers clicks. The AttackArea is triggering (press A-1 square for subtitle confirming this). The guns are there (shift-F5 to see them). However, they just don't shoot. If you look at the mission you will see that the guns are object linked to the AttackArea. Any ideas? Patrik Schorner 1916-01-17.zip
Flashy Posted January 10 Posted January 10 (edited) 13 hours ago, PatrickAWlson said: I was hoping to get some help with Artillery Spotting. Mission attached in zip. The mission is pared down to the artillery spotting and does not have extra flights. Everything works great except the cannons don't fire. The media displays and correctly registers clicks. The AttackArea is triggering (press A-1 square for subtitle confirming this). The guns are there (shift-F5 to see them). However, they just don't shoot. If you look at the mission you will see that the guns are object linked to the AttackArea. Any ideas? Patrik Schorner 1916-01-17.zip 26.17 kB · 0 downloads Are the guns in range? If they are too far away (or too close) they wont fire even when instructed to do so. Also, are the attack area MCU's set to "Attack Ground" and "Attack Ground Targets"? If there are no ground targets and the MCU isnt set to "Attack Ground', the guns might not fire if there are no actual targets in that area. Thats all I can think of right now... Edited January 10 by Flashy
PatrickAWlson Posted January 10 Author Posted January 10 7 hours ago, Flashy said: Are the guns in range? If they are too far away (or too close) they wont fire even when instructed to do so. Also, are the attack area MCU's set to "Attack Ground" and "Attack Ground Targets"? If there are no ground targets and the MCU isnt set to "Attack Ground', the guns might not fire if there are no actual targets in that area. Thats all I can think of right now... The guns are 15 Km away, which I believe is in range. The MCUs are "Attack Ground". Initially they were at Attack Ground Targets, which was not correct. Didn't work in either instance. The 1C career mode only uses attack ground. I will try moving the guns closer. Thanks for the feedback.
AEthelraedUnraed Posted January 10 Posted January 10 According to JimTM's mission editor manual, guns need to be able to visually see the Attack Ground MCU. So be sure to set it to an altitude where your guns have a direct line of sight. Even then, artillery can be tricky to get working.
PatrickAWlson Posted January 10 Author Posted January 10 @Flashy Looks like 15km was too much. I moved them to within 10km and they started firing. Thanks. @AEthelraedUnraed So indirect fire attack areas MCUs need an altitude? That is bizarre. 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now