MIST getRandomPointInZone

From DCS World Wiki - Hoggitworld.com
Revision as of 08:35, 13 April 2018 by Grimes (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


mist.getRandPointInZone

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.getRandPointInZone(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