MIST getRandomPointInPoly

From DCS World Wiki - Hoggitworld.com
Revision as of 23:45, 18 October 2023 by Grimes (talk | contribs) (Created page with "{{Mission Scripting |fName= mist.getRandomPointInPoly| |vNum = Mist 3.6 |desc= Returns a randomly generated vec2 coordinate within the specified set of points that make up...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


mist.getRandomPointInPoly

Added with: Mist 3.6
Description
Returns a randomly generated vec2 coordinate within the specified set of points that make up a polygon.
Syntax
vec2 mist.getRandomPointInPoly(table points )
Valid Input Values:
Return value:
vec2
Return example:
Template:Vec2
Usage Examples:
The following code will get a random point inside a zone defined by the route of the group "whatever"

local points = mist.getGroupPoints("whatever")
local rndPoint = mist.getRandomPointInPoly(points)

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