ScenEdit_SetEMCON troubles [user error]

All discussions & material related to Command's Lua interface

Moderators: angster, RoryAndersonCDT, michaelm75au, MOD_Command

Post Reply
Whicker
Posts: 664
Joined: Tue Jun 19, 2018 9:54 pm

ScenEdit_SetEMCON troubles [user error]

Post 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')



Image
Attachments
cmanoemcon.gif
cmanoemcon.gif (16.25 KiB) Viewed 271 times
Whicker
Posts: 664
Joined: Tue Jun 19, 2018 9:54 pm

RE: ScenEdit_SetEMCON troubles

Post 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.
User avatar
stilesw
Posts: 1569
Joined: Wed Jun 25, 2014 10:08 pm
Location: Hansville, WA, USA

RE: ScenEdit_SetEMCON troubles

Post 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.

“There is no limit to what a man can do so long as he does not care a straw who gets the credit for it.”

Charles Edward Montague, English novelist and essayist
~Disenchantment, ch. 15 (1922)
User avatar
Gunner98
Posts: 5881
Joined: Fri Apr 29, 2005 12:49 am
Location: The Great White North!
Contact:

RE: ScenEdit_SetEMCON troubles

Post 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
Check out our novel, Northern Fury: H-Hour!: http://northernfury.us/
And our blog: http://northernfury.us/blog/post2/
Twitter: @NorthernFury94 or Facebook https://www.facebook.com/northernfury/
Whicker
Posts: 664
Joined: Tue Jun 19, 2018 9:54 pm

RE: ScenEdit_SetEMCON troubles

Post 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.
User avatar
kevinkins
Posts: 2465
Joined: Wed Mar 08, 2006 11:54 am

RE: ScenEdit_SetEMCON troubles

Post 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



“The study of history lies at the foundation of all sound military conclusions and practice.”
Alfred Thayer Mahan
User avatar
michaelm75au
Posts: 12455
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

RE: ScenEdit_SetEMCON troubles

Post 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']
Michael
User avatar
kevinkins
Posts: 2465
Joined: Wed Mar 08, 2006 11:54 am

RE: ScenEdit_SetEMCON troubles

Post 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?
“The study of history lies at the foundation of all sound military conclusions and practice.”
Alfred Thayer Mahan
User avatar
kevinkins
Posts: 2465
Joined: Wed Mar 08, 2006 11:54 am

RE: ScenEdit_SetEMCON troubles

Post 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]
Attachments
RadarTest.zip
(123.77 KiB) Downloaded 10 times
“The study of history lies at the foundation of all sound military conclusions and practice.”
Alfred Thayer Mahan
Post Reply

Return to “Lua Legion”