MIST getPathInSegments

From DCS World Wiki - Hoggitworld.com


Added with: Mist 4.5
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.
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:
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)
At time of creation exact value is not coded.
Related Functions
makeUnitTable, getRandPointInCircle, getRandomPointInZone, isTerrainValid, terrainHeightDiff, getUnitsInZones, getUnitsInMovingZones, pointInPolygon, getUnitsInPolygon, getDeadMapObjsInZones, getDeadMapObjsInPolygonZone, getUnitsLOS, random, randomizeNumTable, stringMatch, getAvgPoint, getQFE, getPathLength, getPathInSegments, getPointAtDistanceOnPath, projectPoint

Scripting Engine

MIST Root Page