Adding Helo to Ship via LUA

All discussions & material related to Command's Lua interface

Moderators: angster, RoryAndersonCDT, michaelm75au, MOD_Command

Post Reply
TheOttoman
Posts: 139
Joined: Thu Dec 14, 2017 3:29 pm

Adding Helo to Ship via LUA

Post by TheOttoman »

If I use the code

ScenEdit_AddUnit({type="ship", side="US Navy", name="FFG-49 Robert G. Bradley", dbid=726, lat=28.58694, lon=49.409, heading=270})

to create a unit, how would I assign a helo to it?
KnightHawk75
Posts: 1850
Joined: Thu Nov 15, 2018 7:24 pm

RE: Adding Helo to Ship via LUA

Post by KnightHawk75 »

Code: Select all

 local u1;
 local u2;
 u1 = ScenEdit_AddUnit({type="ship", side="US Navy", name="FFG-49 Robert G. Bradley", dbid=726, lat=28.58694, lon=49.409, heading=270});
 u2 = ScenEdit_AddUnit({type="aircraft", side="US Navy", name="SmallHeloThatFits", dbid=1593, lat=28.58694, lon=49.409, heading=270,altitude=1000,loadoutid=15083});
 --Put unit2 into unit1
 ScenEdit_HostUnitToParent({HostedUnitNameOrID= tostring(u2.guid), SelectedHostNameOrID= tostring(u1.guid)});
 
 
Post Reply

Return to “Lua Legion”