DCS func findPathOnRoads

From DCS World Wiki - Hoggitworld.com
Revision as of 00:12, 12 April 2018 by Grimes (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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'


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, getSurfaceHeightWithSeabed, getSurfaceType, isVisible, getIP, profile, getClosestPointOnRoads, findPathOnRoads
Notes: