add unit, set base, and RTB

All discussions & material related to Command's Lua interface

Moderators: angster, RoryAndersonCDT, michaelm75au, MOD_Command

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

add unit, set base, and RTB

Post by orca »

I'm am trying to use LUA to add a unit, assign it to a base, and have it immediately return to that base.

I'm able to add the unit but can't figure out how to assign it to a base and order it to return to base. This is what I have so far.

local lat='12.1153187396068'
local lon='43.1328182053093'

ScenEdit_AddUnit({type ='Aircraft', name ='Su-35 #1', loadoutid =11076, heading =180, dbid =4958, side ='Axis', mission='Djibouti air intercept Su-35',Latitude=lat,Longitude=lon, altitude="5000 ft",autodetectable="false",proficiency=4})

Does anyone know how to assign the base and have it RTB?

Thanks
boogabooga
Posts: 988
Joined: Wed Jul 18, 2018 12:05 am

RE: add unit, set base, and RTB

Post by boogabooga »

ScenEdit_SetUnit({guid = LibyanAircraft.guid, RTB = true})

The boogabooga doctrine for CMO: Any intentional human intervention needs to be able to completely and reliably over-ride anything that the AI is doing at any time.
Post Reply

Return to “Lua Legion”