Page 1 of 1
ScenEdit_SetEMCON troubles [user error]
Posted: Mon Aug 06, 2018 2:02 am
by Whicker
I am trying to turn off a Radar using lua - doesn't matter if it is a facility or an AC I am getting the same thing either way. Using the below command changes the value on the EMCON screen, but not on the sensor screen... if I do it manually I have to choose yes or no, but they both change the value on the sensor screen which does what I want.
I can't get the radar to actually turn off - it is just changing the EMCON value which isn't carrying thru to the sensor for some reason.
ScenEdit_SetEMCON('Unit', 'A-50U Mainstay North', 'Radar=Passive')

RE: ScenEdit_SetEMCON troubles
Posted: Mon Aug 06, 2018 2:16 am
by Whicker
I think it takes a few game seconds to change, I was trying to do this in editor mode and couldn't advance time so nothing was changing. I made a test scen and did it a few times and it looks like it works properly other than sometimes it doesn't take effect immediately.
RE: ScenEdit_SetEMCON troubles
Posted: Mon Aug 06, 2018 11:00 am
by stilesw
Whicker,
That has been my experience. There is a brief time delay before the changes in EMCON (radar, OECM or sonar) changes. But the Lua sample you provided should work ok.
RE: ScenEdit_SetEMCON troubles
Posted: Thu Feb 28, 2019 11:00 pm
by Gunner98
I'm trying this out, but ran it for 45 seconds and no radar
ScenEdit_SetEMCON('Unit', 'Radar A', 'Radar=Active')
Not convinced its working. Also tried with GUID but kept getting errors so went back to the name.
Any thoughts?
B
RE: ScenEdit_SetEMCON troubles
Posted: Thu Feb 28, 2019 11:47 pm
by Whicker
hmmm.. I just went and checked it and at first it didn't work, then I tried it with Side instead of Unit and it did work, then went back to Unit and that worked. At some point I went to Side Doctrine and fiddled with that. I also fiddled with the checkbox on the right side of the normal view where it says Inherit from parent.
Not sure what I did to make it work but now it works as expected and I can turn it on or off.
I just pasted your code and named a radar appropriately and it worked so your code is good.
RE: ScenEdit_SetEMCON troubles
Posted: Fri Dec 13, 2019 8:27 pm
by kevinkins
Having trouble in CMO. Can anyone get the radars of a side or unit to turn on/off? If I recall the side and unit EMCON need to be set in a specific way. If you can get the function to work, please post your settings. Here is my single line of lau; it does not throw an error in the console:
ScenEdit_SetEMCON('Unit', 'SAM Plt (SA-22 Greyhound [Pantsir-S1E])', 'OECM=Passive')
Thanks ... Kevin
RE: ScenEdit_SetEMCON troubles
Posted: Fri Dec 13, 2019 9:35 pm
by michaelm75au
local a = ScenEdit_SetEMCON('Unit', 'AAA Sec (35mm Twin Gepard x 2)', 'OECM=Passive')
print(a)
Worked okay. I could swap Active/Passive
[It was not set to 'inherit']
RE: ScenEdit_SetEMCON troubles
Posted: Fri Dec 13, 2019 10:08 pm
by kevinkins
Thanks. will try now. Just to confirm, by "it" you mean the unit AAA Sec (35mm Twin Gepard x 2) and its inherit setting?
RE: ScenEdit_SetEMCON troubles
Posted: Fri Dec 13, 2019 10:47 pm
by kevinkins
Well for the life of me I can get the Pastsir (red side) to turn off but not cycle back on. Tried all the side and unit settings. Here is a save. If you can take a look. It must be simple. I have cycled before, so I am just dense about this now.
Kevin
PS: Got it working. No worries. Will quickly record the settings and put them in a vault. [&o]