MIST isTerrainValid

From DCS World Wiki - Hoggitworld.com


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, isTerrainValid, terrainHeightDiff, getUnitsInZones, getUnitsInMovingZones, pointInPolygon, getUnitsInPolygon, getDeadMapObjsInZones, getDeadMapObjsInPolygonZone, getUnitsLOS, random, randomizeNumTable, stringMatch, getAvgPoint, getQFE

Scripting Engine

MIST Root Page