MIST getUnitsByAttribute

From DCS World Wiki - Hoggitworld.com
Revision as of 08:11, 16 August 2021 by Grimes (talk | contribs) (Created page with "{{Mission Scripting |fName= mist.getUnitsByAttribute| |vNum = Mist 4.5 |desc= Iterates the mist database and the passed attributes table to find units matching those parame...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Added with: Mist 4.5
Iterates the mist database and the passed attributes table to find units matching those parameters. Consider it to be an alternative of mist.makeUnitTable.

Optional value matches determines how many of those entries must match. Defaults to 1. For instance if you pass 2, then any 2 of the above list must be present for a given unit.

Optional boolean value of id will if present return the unitId instead of unit names.

table mist.getUnitsByAttribute(table attributes , number matches ,boolean id )
Valid Input Values:
Valid attributes:

  typeName       : a string of any unit type
  country        : a string of the country name
  coalition      : a string of the coalition name
  skill          : a string of the skill
  category       : a string of the category
Return value:
Return example:
Usage Examples:
The following would return a table of ids for all blue clients
  local list = mist.getUnitsByAttribute({skill = 'Clients', coalition = "blue"}, 2, true)
Related Functions
makeUnitTable, getRandPointInCircle, getRandomPointInZone, getRandomPointInPoly, isTerrainValid, terrainHeightDiff, getUnitsInZones, getUnitsInMovingZones, pointInPolygon, getUnitsInPolygon, getDeadMapObjsInZones, getDeadMapObjsInPolygonZone, getUnitsLOS, random, randomizeNumTable, getAvgPoint, getQFE, getWindBearingAndVel, getPathLength, getPathInSegments, getPointAtDistanceOnPath, projectPoint, getGroupsByAttribute, , getUnitsByAttribute, mapValue,

Scripting Engine

MIST Root Page