EMCOM Issue (Full Version)

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



Message


vettim89 -> EMCOM Issue (9/6/2021 6:40:28 PM)

I have what I thought was a simple event that does not seem to be working

The Trigger is 'unit is detected with the specification of platform being an aircraft'

The event action is supposed to have the select SAM site activate its radars with the following code

ScenEdit_SetUnit({side='Cuba', guid='fed83872-a7b5-41ed-ace0-1e91eb1cb722', obeyEMCOM=false})
ScenEdit_SetEMCON('unit', 'fed83872-a7b5-41ed-ace0-1e91eb1cb722', 'Radar=Active')

When I run the above code the "unit obeys EMCOM" button remains checked and the radars remain off. I feel like I am missing something really simple here




BDukes -> RE: EMCOM Issue (9/6/2021 11:07:10 PM)

Mine was like this

ScenEdit_SetUnit({side='Cuba', guid='1T8G9D-0HMBHGG8ARV1L', obeyEMCOM=false})
ScenEdit_SetEMCON('Unit','SiteX','Radar=Active')

Started the game clock and the radar went active. It doesn't happen when the game isn't running.

I'd start by starting the game to see if your code works.




vettim89 -> RE: EMCOM Issue (9/6/2021 11:19:52 PM)


quote:

ORIGINAL: BDukes

Mine was like this

ScenEdit_SetUnit({side='Cuba', guid='1T8G9D-0HMBHGG8ARV1L', obeyEMCOM=false})
ScenEdit_SetEMCON('Unit','SiteX','Radar=Active')

Started the game clock and the radar went active. It doesn't happen when the game isn't running.

I'd start by starting the game to see if your code works.


thank you - you are correct I did not run the game




KnightHawk75 -> RE: EMCOM Issue (9/6/2021 11:34:03 PM)

If I follow correctly you want all the radars on right? So really you don't need the unit obey's EMCON.
  ScenEdit_SetEMCON('Unit','fed83872-a7b5-41ed-ace0-1e91eb1cb722', 'Radar=Active'); 

Now if you wanted only a specific radar sensor on the unit then you would need to turn off unit obeys emcon.
  local u = ScenEdit_GetUnit({guid='fed83872-a7b5-41ed-ace0-1e91eb1cb722'});
  u.obeyEMCON=false <-- spelling (I make the con\com mistake all the time too.
  --(now feed a singular table of what you want changed to the setter for each item you want changed.)
  u.sensors = {sensor_guid="TheguidOfTheSensorEntryToChangehere",sensor_isactive=true}; 
  u.sensors = {sensor_guid="TheguidOfTheSensorEntry#2ToChangehere",sensor_isactive=true}; --'sensor_status' is also available if needed to change.


And yes, click off the unit and back onto it in the editor to see the change if not advancing time.





Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
3.710938E-02