Difference between revisions of "ScenEdit AddUnit"

From Baloogan Campaign Wiki
Jump to: navigation, search
 
 
(6 intermediate revisions by the same user not shown)
Line 18: Line 18:
  
 
--Latitude: Can be a string with a number in it ("5.1"), a number (5.1), or a latitude string specifying degrees minutes and seconds "S 50.23.41"
 
--Latitude: Can be a string with a number in it ("5.1"), a number (5.1), or a latitude string specifying degrees minutes and seconds "S 50.23.41"
--Longitude: Can be a string with a number in it ("5.1"), a number (5.1), or a latitude string specifying degrees minutes and seconds "S 50.23.41"
+
--Longitude: Can be a string with a number in it ("5.1"), a number (5.1), or a longitude string specifying degrees minutes and seconds "W 50.23.41"
 
--For Latitude and Longitude: Lat, Lon, Long, are all valid ways to input Latitude and longitude.  
 
--For Latitude and Longitude: Lat, Lon, Long, are all valid ways to input Latitude and longitude.  
 +
--ONE IMPORTANT THING TO NOTE, this is designed to synergize well with the Ctrl-X shortcut to copy a location into your clipboard.
 +
 +
 +
 +
--AIRCRAFT SPECIFIC
 +
--Altitude: Only valid for aircraft, if a number is passed to this function it will assume its in meters, otherwise pass a string in with units; for example: "5000 ft", "2000 m", "40000 ft"
 +
--Alt is also a valid way to input altitude
 +
 +
--Loadoutid: Only valid for aircraft, denotes the loadout's id.
 +
 +
 +
 +
--OPTIONAL ARGUMENTS:
 +
 +
--Heading: Can be a number in degrees specifying the heading of the unit
 +
 +
--Autodetectable: Can be 0, 1, "yes", "no", "true", "false"
 +
 +
--HoldPosition: Can be 0, 1, "yes", "no", "true", "false"
 +
 +
--HoldFire: Can be 0, 1, "yes", "no", "true", "false"
 +
 +
--Proficiency: Can be "0"=Novice, "1"=Cadet, "2"=Regular, "3"=Veteran, "4"=Ace
 +
 +
--An example of a very long ScenEdit_AddUnit command
 +
f15 = ScenEdit_AddUnit({type = 'Aircraft', name = 'F-15C Eagle', loadoutid = 16934,
 +
      heading = 0, dbid = 3500, side = 'NATO', Latitude="N46.00.00",Longitude="E25.00.00",
 +
      altitude="5000 ft",autodetectable="false",holdfire="true",proficiency="4"})
 +
 +
--And the same command without optional arguments (And different lat/lon/alt)
 +
f15 = ScenEdit_AddUnit({type = 'Air', name = 'F-15C Eagle', loadoutid = 16934, dbid = 3500, side = 'NATO', Lat="5.123",Lon="-12.51",alt=5000}) --note altitude will be 5000m
 +
 +
--Having the "f15 = ScenEdit_AddUnit..." at the beginning of the line allows one to assign this f15 to a mission by using f15.guid
 +
ScenEdit_AssignUnitToMission(f15.guid, "Southern Ukraine AAW Patrol")
  
--Altitude:
 
  
  
 
</syntaxhighlight>
 
</syntaxhighlight>

Latest revision as of 20:59, 12 December 2014

<syntaxhighlight lang="lua"> --basic function: newship = ScenEdit_AddUnit({type="Ship", name = "USS Test", side = "United States", DBID = 1023, Latitude = "S 50.23.41", Longitude = 5.2}) print(newship.guid) -- prints the ship's unique id


--advanced function: newship = ScenEdit_AddUnit({type="Ship", name = "USS Test", side = "United States", DBID = 1023, Latitude = "S 50.23.41", Longitude = 5.2})

--Type: Can be one of the following: Ship, Submarine, Aircraft, Facility --For Type: Sub, Air, Land are also valid.

--Name: Can be any string

--Side: Can be any side's name. 'PlayerSide' is a special value that will evaluate to the player's side

--DBID: Database id

--Latitude: Can be a string with a number in it ("5.1"), a number (5.1), or a latitude string specifying degrees minutes and seconds "S 50.23.41" --Longitude: Can be a string with a number in it ("5.1"), a number (5.1), or a longitude string specifying degrees minutes and seconds "W 50.23.41" --For Latitude and Longitude: Lat, Lon, Long, are all valid ways to input Latitude and longitude. --ONE IMPORTANT THING TO NOTE, this is designed to synergize well with the Ctrl-X shortcut to copy a location into your clipboard.


--AIRCRAFT SPECIFIC --Altitude: Only valid for aircraft, if a number is passed to this function it will assume its in meters, otherwise pass a string in with units; for example: "5000 ft", "2000 m", "40000 ft" --Alt is also a valid way to input altitude

--Loadoutid: Only valid for aircraft, denotes the loadout's id.


--OPTIONAL ARGUMENTS:

--Heading: Can be a number in degrees specifying the heading of the unit

--Autodetectable: Can be 0, 1, "yes", "no", "true", "false"

--HoldPosition: Can be 0, 1, "yes", "no", "true", "false"

--HoldFire: Can be 0, 1, "yes", "no", "true", "false"

--Proficiency: Can be "0"=Novice, "1"=Cadet, "2"=Regular, "3"=Veteran, "4"=Ace

--An example of a very long ScenEdit_AddUnit command f15 = ScenEdit_AddUnit({type = 'Aircraft', name = 'F-15C Eagle', loadoutid = 16934,

     heading = 0, dbid = 3500, side = 'NATO', Latitude="N46.00.00",Longitude="E25.00.00",
     altitude="5000 ft",autodetectable="false",holdfire="true",proficiency="4"})

--And the same command without optional arguments (And different lat/lon/alt) f15 = ScenEdit_AddUnit({type = 'Air', name = 'F-15C Eagle', loadoutid = 16934, dbid = 3500, side = 'NATO', Lat="5.123",Lon="-12.51",alt=5000}) --note altitude will be 5000m

--Having the "f15 = ScenEdit_AddUnit..." at the beginning of the line allows one to assign this f15 to a mission by using f15.guid ScenEdit_AssignUnitToMission(f15.guid, "Southern Ukraine AAW Patrol")


</syntaxhighlight>