Moving Aircraft Around on the Ground (Full Version)

All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion



Message


SeaQueen -> Moving Aircraft Around on the Ground (9/21/2020 3:51:07 PM)

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.




Durendal28 -> RE: Moving Aircraft Around on the Ground (9/21/2020 8:50:34 PM)

You could use the ScenEdit_HostUnitToParent function to move aircraft to hangers, parking spaces, etc.




michaelm75au -> RE: Moving Aircraft Around on the Ground (9/21/2020 9:06:29 PM)

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]]




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.53125