Difference between revisions of "MIST getPathInSegments"

From DCS World Wiki - Hoggitworld.com
(Created page with "{{Mission Scripting |fName= mist.getPathInSegments| |vNum = Mist 4.5 |desc= Returns a table of points that divide the passed path in a given number of segments. For example...")
 
(No difference)

Latest revision as of 06:38, 2 November 2020


mist.getPathInSegments

Added with: Mist 4.5
Description
Returns a table of points that divide the passed path in a given number of segments. For example if a path is approximately 100km in length and you pass number of segments of 5, then the function will return 6 points that are approximately 20 km apart from another.
Syntax
table mist.getPathInSegments(table path , number segments ,boolean exact )
Valid Input Values:
{[1] = {x = 2300, y = 234526}, [2] = {x = 2300, y = -2352},[3] = {x = 35235, y = -564156},[4] = {x = 54, y = 48456456}, }
Return value:
table
Return example:
Usage Examples:
The following example uses land.finPathOnroads to get a path that a ground AI group could take between two points.
           local rPath = land.findPathOnRoads('roads', spawnPoint.x, spawnPoint.y, roadEnd.x, roadEnd.y)
           local segments = mist.getPathInSegments(rPath, 5)
Notes:
At time of creation exact value is not coded.
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