LUA Script to automate EMCON when ELINT satellites are near (Full Version)

All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion



Message


LettuceTurnipTheBeet -> LUA Script to automate EMCON when ELINT satellites are near (12/18/2021 3:43:03 PM)

I wrote a script to automate EMCON control when an ELINT sat approaches. Found it useful in scenarios with a lot of satellites, like "A Helping Hand 1979". Turns off radar if a satellite is within a specified range and turns it back on if it leaves said range. Had to loop through units and filter out satellites because UnitEntersArea does not appear to work for sats.

Just extract the script and load it from the LUA console window, adjust a few variables according to your needs and run.

Let me know if any problems arise.




Parel803 -> RE: LUA Script to automate EMCON when ELINT satellites are near (2/13/2022 7:59:29 PM)

Lettuce,
This is nice, going to try it out.
Not fully undertand the lua but understand the feature
regards GJ

Works great. A question if I may. I tried to put in a table with the name/guids of my TG but cannot get that to work. Not sure how to make the correct loop so they all swith rdr on/off.





KnightHawk75 -> RE: LUA Script to automate EMCON when ELINT satellites are near (2/14/2022 5:22:59 PM)


quote:

ORIGINAL: Parel803

Lettuce,
This is nice, going to try it out.
Not fully undertand the lua but understand the feature
regards GJ

Works great. A question if I may. I tried to put in a table with the name/guids of my TG but cannot get that to work. Not sure how to make the correct loop so they all swith rdr on/off.



It's really good for one unit, one side.

But if you need something that supports:
+ multiple units via table entries
+ multiple sides included in what sats to scan
+ per-unit-entry control of min_range, flipping radar and|or also flipping oecm, temporary disabling entries.
+ overcome some issues with 'groups' due to the group objects location often being the 'lead' or cases where it can be invalid (0,0) on hidden groups as demonstrated in the sample.


Then you could try the attached. I took the basic concept and reworked and extended it to support the above for myself. Built and tested with build 1147.41.
att: SatRangeMonitor.zip

zip contents:
TestRig_SatRangeMonitor.scen -- A sample scene with everything already applied to it.
TestRig_SatRangeMonitor-noEventsYet.scen -- Same sample scene without the events installed yet.
Lua\SatRangeMonitorSetup.lua -- Setup Script, change and then copy & paste and run in Lua Console to install events into a scene. Scroll down about ~70 or so lines for where you change the unit table,sides, and other defaults.
Lua\SatRangeMonitor_nosetup.lua -- This 99% of the code (ie all the global functions) in a file with formatting for easier editing.
Lua\SatRangeMonitor_changelog.txt -- simple change log.

Hope it helps.




Parel803 -> RE: LUA Script to automate EMCON when ELINT satellites are near (2/14/2022 7:42:26 PM)

thank you for your time and help,
Going to look tomorrow
regards GJ

Works nice, played it. not tried to make for own scen.
Thanks both
regards GJ




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
1.890625