Can't get location/handle for smoke or fire in IL2 CloD FMB scripting - Printable Version +- The Wrecking Crew Forums (https://forums.twcpilots.com) +-- Forum: Cliffs of Dover Blitz (https://forums.twcpilots.com/forumdisplay.php?fid=7) +--- Forum: Full Mission Builder (https://forums.twcpilots.com/forumdisplay.php?fid=9) +--- Thread: Can't get location/handle for smoke or fire in IL2 CloD FMB scripting (/showthread.php?tid=165) |
Can't get location/handle for smoke or fire in IL2 CloD FMB scripting - Flug - 02-23-2020 So here is an issue I came across in scripting Cliffs of Dover FMB missions. Generally you can get a list of all ground stationaries using a few simple functions CloD makes available to script writers. HOWEVER - those lists of ground stationaries do not include a few important items! In particular, they don't seem to include smoke or fire objects. So I can understand how this likely happened--smoke & fire are simply a different type of object than most others. For example, if you bomb a location you might kill any nearby static object, but you probably wouldn't kill nearby smoke or fire. Anyway, this is an issue because for most ground stationary objects, you can place them and then later remove them. But with smoke & fire, you can place them--but you can't EVER remove them unless you completely restart the mission. Anyone who knows a solution to this, I would really appreciate hearing it! Sample .cs file that lists all ground stationaries of the mission and any submission loaded. If you create a .mis file with various groundstationaries including some smoke and fire, you'll see that everything is listed EXCEPT the smoke and fire: Code: using System; Example of how to get groundstationaries within a distance of a given point--except not that it will NOT list any smoke or fire groundstationaries! Code: GroundStationary[] gs = GamePlay.gpGroundStationarys(250000, 252000, 1000); //Find all groundstationaries within 1000 meters of map coordinate (250000,252000) Example of how to create and place smoke or fire mid-mission via script: Code: public static void loadSmokeOrFire(maddox.game.IGamePlay GamePlay, AMission mission, double x, double y, double z, string type = "BuildingFireBig", double duration_s = 300) The smoke & fire types listed there are exactly the ones that cannot be found via the groundstationarys() method--as far as I know. Example of how to create a SectionFile via script, put a static object (groundstationary) in it, and then load it in: Code: public static void loadStatic(maddox.game.IGamePlay GamePlay, AMission mission, double x, double y, double z, string type = "Stationary.Opel_Blitz_cargo", double heading = 0, string side = "nn") Examples of what static objects look like in a .mis file--you can load any of these types or dozens of others (discover them using FMB and then looking at the resulting .mis file) using the above routine: Code: Static4 Stationary.Environment.Table_empty_UK-GER_1 nn 14334.77 15015.75 661.10 |