DCS func findPathOnRoads

From DCS World Wiki - Hoggitworld.com
Revision as of 06:49, 17 March 2022 by Grimes (talk | contribs)
(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'

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