Page 1 of 1

WCS and engate opportunity targets

Posted: Fri Apr 17, 2020 4:18 pm
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


RE: WCS and engate opportunity targets

Posted: Fri Apr 17, 2020 5:44 pm
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.

RE: WCS and engate opportunity targets

Posted: Sun Apr 19, 2020 1:23 pm
by orca
thanks!