Difference between revisions of "DCS func findPathOnRoads"

From DCS World Wiki - Hoggitworld.com
m (1 revision imported)
 
 
(2 intermediate revisions by the same user not shown)
Line 18: Line 18:
  
 
Roadtype can be 'railroads' or 'roads'
 
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!
  
 
|rtnType= table
 
|rtnType= table
Line 62: Line 65:
 
|notes=  
 
|notes=  
 
}}
 
}}
[[Category:Singleton Functions|getHeight]]
+
[[Category:Singleton Functions|findPathOnRoads]]
 +
[[Category:Game Patch 2.5.0|findPathOnRoads]]

Latest revision as of 06:49, 17 March 2022

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: