Difference between revisions of "MIST getRandomPointInZone"

From DCS World Wiki - Hoggitworld.com
(Created page with "{{Mission Scripting |fName= mist.getRandPointInZone| |vNum = Mist 3.6 |desc= Returns a randomly generated vec2 coordinate within the specified zone as defined within the mi...")
 
 
Line 1: Line 1:
 
{{Mission Scripting
 
{{Mission Scripting
  
|fName= mist.getRandPointInZone|
+
|fName= mist.getRandomPointInZone|
  
 
|vNum = Mist 3.6
 
|vNum = Mist 3.6

Latest revision as of 05:24, 10 September 2018


mist.getRandomPointInZone

Added with: Mist 3.6
Description
Returns a randomly generated vec2 coordinate within the specified zone as defined within the mission editor. If the optional variable innerRadius is given the random point will be generated that has a minimum distance of innerRadius and a maximum distance of radius from the point.
Syntax
vec2 mist.getRandomPointInZone(string zoneName , number innerRadius )
Valid Input Values:
The following values have to have the correct type of data
zoneName= any zone name created in the mission editor
innerRadius = any positive number less than radius
Return value:
vec2
Return example:
Template:Vec2
Usage Examples:
The following code will deploy a smoke marker randomly inside a zone with a minimum distance of 200 meters from the center of the zone

do

local newPoint = mist.getRandomPointInZone('myZone', 200)
trigger.action.smoke(newPoint, trigger.smokeColor.Red

end

Notes:
Uses: GetRandomPointInCircle
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