MIST getGroupsByAttribute

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


mist.getGroupsByAttribute

Added with: Mist 4.5
Description
Iterates the mist database and the passed attributes table to find groups matching those parameters. Consider it to be an alternative of mist.makeUnitTable.
  typeName
  country
  coalition
  skill
  category

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 within a given group.

Optional boolean value of id will if present return the groupId instead of group names.

Syntax
table mist.getGroupsByAttribute(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:
table
Return example:
Usage Examples:
The following would return a table of ids for all blue clients
  local list = mist.getGroupsByAttribute({skill = 'Clients', coalition = "blue"}, 2, true)
Notes:
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