loss of comms

All discussions & material related to Command's Lua interface

Moderators: RoryAndersonCDT, michaelm75au, angster, MOD_Command

Post Reply
orca
Posts: 545
Joined: Wed Nov 06, 2013 4:59 pm

loss of comms

Post 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
KnightHawk75
Posts: 1850
Joined: Thu Nov 15, 2018 7:24 pm

RE: loss of comms

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

Return to “Lua Legion”