MIST makeUnitTable

From DCS World Wiki - Hoggitworld.com


Added with: Mist 1.0
This function accepts table t (which must be indexed sequentially starting at 1), applies the UnitNameTable short-cut rules, and returns a new table of unit names. Also, this function adds the table key and value processed = true to the returned table, indicating that the table has already been “run through” the UnitNameTable processing/shortcuts (useful for self-rescheduling functions- obviously, you only need to apply the UnitNameTable rules the first time a self-rescheduling function is run!).

Optional value "exclude" is used to exclude a certain category of unit object. Accepts lower case string or table of strings. Valid entries are:

   'plane', helicopter', 'vehicle', 'ship', 'static'
table mist.makeUnitTable(table t , string/table exclude )
Valid Input Values:
See unitNameTables
Return value:
Return example:
        [1] = "Unit1', 
        [2] = "Unit2', 
        [3] = "Unit3', 
        [4] = "Unit4', 
        processed = 235.542,
Usage Examples:
The following would return a list of all objects except for statics.
       local units = mist.makeUnitTable({'[all]'}, 'static')
See unitNameTables
Related Functions
List of functions that use unitNameTables:

makeUnitTable, units_in_zones, units_in_moving_zones, units_in_polygon, units_LOS, getUnitsInZones, getUnitsInMovingZones, pointInPolygon, getUnitsInPolygon, getUnitsLOS

Scripting Engine

MIST Root Page