Page 1 of 1
Moving Aircraft Around on the Ground
Posted: Mon Sep 21, 2020 12:51 pm
by SeaQueen
Is there a way in LUA to periodically reposition aircraft on the ground? In order to make a strike problem harder, I'd like to "reshuffle the deck," now and then.
RE: Moving Aircraft Around on the Ground
Posted: Mon Sep 21, 2020 5:50 pm
by Durendal28
You could use the ScenEdit_HostUnitToParent function to move aircraft to hangers, parking spaces, etc.
RE: Moving Aircraft Around on the Ground
Posted: Mon Sep 21, 2020 6:06 pm
by michaelm75au
Use unit.base to set the aircraft to a different 'facility' such as below
local base = ScenEdit_GetUnit( { name='Airfield', side='NATO' })
local facilities = base.group.unitlist -- list of facilities at base
local x = math.random(1,#facilities )
u = ScenEdit_GetUnit({ name = facilities[x]})
unit.base = u
You would filter the 'facilities' list to only include items that can host the aircraft; like a 'control tower' shouldn't be counted. Or leave them in, and skip assigning the aircraft to it - let it stay at the original location.
[This is just scripted without any checking as to practicality as not running Command at the moment. I sure others can give you a more precise example.[:D]]