Page 1 of 1

Adding Helo to Ship via LUA

Posted: Thu Oct 24, 2019 10:05 pm
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?

RE: Adding Helo to Ship via LUA

Posted: Fri Oct 25, 2019 4:32 am
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)});