WCS and engate opportunity targets

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

WCS and engate opportunity targets

Post by orca »

how can I change the ROE for a unit (or group) using LUA?

I'm specifically wanting to:

change the weapon control status, land from hold to free
and
change the engage opportunity targets from no to yes

thanks

KnightHawk75
Posts: 1850
Joined: Thu Nov 15, 2018 7:24 pm

RE: WCS and engate opportunity targets

Post by KnightHawk75 »

I think this should do it.

Code: Select all

local u = ScenEdit_GetUnit({name='TheUnitOrGroupName'})
 if (u~=nil) then
   ScenEdit_SetDoctrine({side=u.side, unitname=u.name}, {weapon_control_status_land='0',engage_opportunity_targets='yes'}) 
 end

for a mission use mission=, for escorts add mission = and escort = true, for whole side omit everything but side=, for group... it may work as is, can't remember if it auto handles groups or if you have to check if type of unit == group and loop through setting each unit.
orca
Posts: 545
Joined: Wed Nov 06, 2013 4:59 pm

RE: WCS and engate opportunity targets

Post by orca »

thanks!
Post Reply

Return to “Lua Legion”