MIST isTerrainValid

From DCS World Wiki - Hoggitworld.com
Revision as of 23:16, 13 April 2018 by Grimes (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


mist.isTerrainValid

Added with: Mist 3.0
Description
Returns true if the specified vec2 or vec3 coordinate is the correct type of terrain.
Syntax
boolean mist.isTerrainValid(table vec2/vec3 ,table terrainTypes )
Valid Input Values:
vec2/vec3 = valid vec2/3 table

terrainTypes = table of strings

valid string:

 LAND 
 SHALLOW_WATER 
 WATER 
 ROAD 
 RUNWAY
Return value:
boolean
Return example:
true
Usage Examples:
  do
    for i = 1, 10 do
      local newPoint = mist.getRandomPointInZone(point1, 1000)      
        if mist.isTerrainValid(newPoint, {'LAND', 'ROAD'}) == true then
          -- use newPoint for something
          break
      end
    end
  end
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