Page 1 of 1

loss of comms

Posted: Fri Sep 18, 2020 11:45 pm
by orca
I'm sorry for asking. I've tried searching but can't find the LUA code to make a unit go out of comms. Does anyone know it?
Thanks again

RE: loss of comms

Posted: Sat Sep 19, 2020 3:28 am
by KnightHawk75
Use SceneEdit_SetUnit to change the value, unit wrapper to check\get the current value:
--assumes scenario feature is enabled in scene settings.
local myunit = ScenEdit_GetUnit({name='Have Raider UCAV', guid='4FH7PU-0HM2RI7OS3EEF'});
print('original value: ' .. tostring(myunit.outOfComms)); --check current value
ScenEdit_SetUnit( {guid=myunit.guid, OUTOFCOMMS=true} ); --engage out-of-comms
print('on value: ' .. tostring(myunit.outOfComms)); --check updated value
ScenEdit_SetUnit( {guid=myunit.guid, OUTOFCOMMS=false} ); --disengage out-of-comms
print('off value: ' .. tostring(myunit.outOfComms)); -- check updated value