Struan76
Posts: 36
Joined: 9/3/2019 Status: offline
|
Here's how I'm adding a test OECM sensor: -- setup Growler arcs
local u = ScenEdit_GetUnit({name='EA-18G Growler', guid='ActualUnitGUID'})
ScenEdit_UpdateUnit({guid=u.guid,mode='remove_sensor',dbid=1901,sensorId=u.sensors[8].sensor_guid})
-- need to work out how to remove default loadout sensor for above
ScenEdit_UpdateUnit({guid=u.guid,mode='add_sensor',dbid=1901,arc_detect={'PB1','PB2','SB1','SB2'},arc_track={'PB1','PB2','SB1','SB2'}}) -- this is frontal 45deg sector only
-- don't know yet how to check the above arcs are active
u.obeyEMCON = false; --Unit will not use emcon setting [required].
local s = {sensor_guid=u.sensors[8].sensor_guid, sensor_isactive=true, sensor_status='Operational'};
u.sensors = s; --Apply changes for that specific sensor (turn on in this case)
print( u.sensors[8]) (thanks to KnightHawk75 for second half of above code)
< Message edited by Struan76 -- 8/23/2021 1:33:37 AM >
|