ScenEdit_GetUnit (table)
This function gets the properties of the Unit.
Parameters
-
table {}
- side = string The side name/GUID of the unit
- unitname = string The name of unit
- guid = string The GUID of the unit
Returns
Unit wrapper if the unit exists, ornil
otherwise
Note: When run interactively (i.e. in the console) ScenEdit_GetUnit() will raise an exception if the selected unit is not found. This can be prevented using Tool_EmulateNoConsole().
Example 1
local myUnit =
ScenEdit_GetUnit( { guid=
'f4f9e0af-15c2-4582-8e80-b827c2ec2f56'} )
print( myUnit)
Example 2
local myUnit =
ScenEdit_GetUnit( { side='United States', unitname='CG 56 San Jacinto'} )
print( myUnit)