DCS func findPathOnRoads

From DCS World Wiki - Hoggitworld.com

Scripting Root

Envrioment: Mission Scripting
Function: findPathOnRoads Added with: 2.5
Member Of: land
Syntax: table land.findPathOnRoads(string roadType, number xCoord, number yCoord, number destX, number destY )
Description: Returns a table of points along a that define a route from a starting point to a destination point.

Returned table is a table of vec2 points indexed numerically from starting point to destination. Table can return a high number of points over a relatively short route. So expect to iterate through a large number of values.

Roadtype can be 'railroads' or 'roads'

NOTE!!! A bug exists where the value for railroads is actually 'rails'. This is different from the sister function getClosestPointOnRoads!

Return Value: table
Return Example:
Examples: The following returns the closest road to a point.

local testPoint = trigger.misc.getZone('test').point local x, y = land.getClosestPointOnRoads('roads',testPoint.x, testPoint.z)

Related Functions: land functions: getHeight, getSurfaceType, isVisible, getIP, profile, getClosestPointOnRoads, findPathOnRoads