Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

LUA Script to automate EMCON when ELINT satellites are near

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion >> LUA Script to automate EMCON when ELINT satellites are near Page: [1]
Login
Message << Older Topic   Newer Topic >>
LUA Script to automate EMCON when ELINT satellites are ... - 12/18/2021 3:43:03 PM   
LettuceTurnipTheBeet

 

Posts: 7
Joined: 12/18/2021
Status: offline
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.

Attachment (1)
Post #: 1
RE: LUA Script to automate EMCON when ELINT satellites ... - 2/13/2022 7:59:29 PM   
Parel803

 

Posts: 579
Joined: 10/10/2019
From: Netherlands
Status: offline
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.



< Message edited by Parel803 -- 2/14/2022 8:12:38 AM >

(in reply to LettuceTurnipTheBeet)
Post #: 2
RE: LUA Script to automate EMCON when ELINT satellites ... - 2/14/2022 5:22:59 PM   
KnightHawk75

 

Posts: 1450
Joined: 11/15/2018
Status: offline

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.


Attachment (1)

(in reply to Parel803)
Post #: 3
RE: LUA Script to automate EMCON when ELINT satellites ... - 2/14/2022 7:42:26 PM   
Parel803

 

Posts: 579
Joined: 10/10/2019
From: Netherlands
Status: offline
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

< Message edited by Parel803 -- 2/15/2022 6:17:54 PM >

(in reply to KnightHawk75)
Post #: 4
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion >> LUA Script to automate EMCON when ELINT satellites are near Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

1.547