ProdigyofMilitaryPride -> RE: Adding aircraft to a ship or airfield? (6/6/2020 5:45:27 AM)
|
I found out there was meant to be a matching element, what am I missing here? quote:
>> local c, u,retval; c = ScenEdit_AddUnit({type = 'Ship', name = 'MyCarrier', loadoutid = 0, heading = 0, dbid = 2370, side = 'Blue', Latitude="S4.50.00",Longitude="W5.00.00", autodetectable="false",holdfire="true",proficiency=4,speed=0}); c.group = 'MyCarrierGroup'; u = ScenEdit_AddUnit({type = 'Aircraft', name = 'F-35 single', loadoutid = 10098, heading = 0, dbid = 824, side = 'Blue', Latitude="N00.50.00",Longitude="E0.50.00", altitude="0 ft",autodetectable="false",holdfire="true",proficiency=4,speed=350, base=c.name}); -- <<--- base= parameter --or exclude base= parameters above in unit creation and after creation use.. --retval = ScenEdit_HostUnitToParent({HostedUnitNameOrID=u.guid,SelectedHostNameOrID=c.guid}) --if retval == true then print(string.format('Successfully inserted %s into %s',u.name,c.name)); end c=nil;u=nil;retval=nil; ERROR: Sequence contains no matching element And in trying to craft the code so far for a scenario I'm making, I keep getting a Syntax error by the ", proficiency=4, speed=350, basename=USS George Washington});. quote:
local c, u retval; c = ScenEdit_AddUnit({type = 'Ship', name = 'USS George Washington', heading = 85, dbid = 657, side = 'USN', Latitude = "N32.51.55", Longitude = "W13.43.21", autodetectable="false",holdfire="false",proficiency=4,speed=20}); c.group='George Washington CSG'; u = ScenEdit_AddUnit({type = 'Aircraft', name = "Dog", loadoutid = 17020, heading = 85, dbid = 46, side = 'USN', Latitude='N32.51.55', Longitude = "W13.43.21', autodetectable='false',holdfire="false", proficiency=4, speed=350, basename=USS George Washington}); c = ScenEdit_AddUnit({type = 'Ship', name = 'USS Thomas S. Gates', heading = 85, dbid = 1054, side = 'USN', Latitude = "32.51.55", Longitude = "W13.43.21", autodetectable="false",holdfire="false",proficiency=4,speed=20}); c.group='George Washington CSG' c = ScenEdit_AddUnit({type = 'Ship', name = 'USS San Jacinto', heading = 85, dbid = 628, side = 'USN', Latitude = "32.51.55", Longitude = "W13.43.21", autodetectable="false",holdfire="false",proficiency=4,speed=20}); c.group='George Washington CSG' c = ScenEdit_AddUnit({type = 'Ship', name = 'USS Barry', heading = 85, dbid = 112, side = 'USN', Latitude = "32.51.55", Longitude = "W13.43.21", autodetectable="false",holdfire="false",proficiency=4,speed=20}); u.group='George Washington CSG' c = ScenEdit_AddUnit({type = 'Ship', name = 'USS Deyo', heading = 85, dbid = 810, side = 'USN', Latitude = "32.51.55", Longitude = "W13.43.21", autodetectable="false",holdfire="false",proficiency=4,speed=20}); --or exclude base= parameters above in unit creation and after creation use.. --retval = ScenEdit_HostUnitToParent({HostedUnitNameOrID=u.guid,SelectedHostNameOrID=c.guid}) --if retval == true then print(string.format('Successfully inserted %s into %s',u.name,c.name)); end c=nil;u=nil;retval=nil;
|
|
|
|