diff --git a/PATHFIND/GetClosestRoad.md b/PATHFIND/GetClosestRoad.md index 3d5755b7f..d60eb0457 100644 --- a/PATHFIND/GetClosestRoad.md +++ b/PATHFIND/GetClosestRoad.md @@ -5,24 +5,23 @@ ns: PATHFIND ```c // 0x132F52BBA570FE92 0x567B0E11 -Any GET_CLOSEST_ROAD(float x, float y, float z, float p3, int p4, Vector3* p5, Vector3* p6, Any* p7, Any* p8, float* p9, BOOL p10); +cs_type(Any) bool GET_CLOSEST_ROAD(float x, float y, float z, float minimumEdgeLength, int minimumLaneCount, Vector3* srcNode, Vector3* targetNode, int* laneCountForward, int* laneCountBackward, float* width, BOOL onlyMajorRoads); ``` -``` -p1 seems to be always 1.0f in the scripts -``` +Finds an edge (node connection to another node) that satisfies the specified criteria. ## Parameters -* **x**: -* **y**: -* **z**: -* **p3**: -* **p4**: -* **p5**: -* **p6**: -* **p7**: -* **p8**: -* **p9**: -* **p10**: +* **x**: x position +* **y**: y position +* **z**: z position +* **minimumEdgeLength**: Minimum distance the srcNode must be from the targetNode. +* **minimumLaneCount**: Minimum number of lanes the connection must have. +* **srcNode**: Position of the edge source +* **targetNode**: Position of the edge target +* **laneCountForward**: Lane count forward +* **laneCountBackward**: Lane count backwards +* **width**: Width of gap in middle of road between forward and backward lanes. +* **onlyMajorRoads**: Return major roads only. ## Return value +Returns `true` if a road was found, `false` otherwise. diff --git a/PATHFIND/GetNthClosestVehicleNodeWithHeading.md b/PATHFIND/GetNthClosestVehicleNodeWithHeading.md index 087d1e7b9..e21487d74 100644 --- a/PATHFIND/GetNthClosestVehicleNodeWithHeading.md +++ b/PATHFIND/GetNthClosestVehicleNodeWithHeading.md @@ -5,23 +5,34 @@ ns: PATHFIND ```c // 0x80CA6A8B6C094CC4 0x7349C856 -BOOL GET_NTH_CLOSEST_VEHICLE_NODE_WITH_HEADING(float x, float y, float z, int nthClosest, Vector3* outPosition, float* heading, Any* unknown1, int unknown2, float unknown3, float unknown4); +BOOL GET_NTH_CLOSEST_VEHICLE_NODE_WITH_HEADING(float x, float y, float z, int nthClosest, Vector3* outPosition, float* heading, int* totalLanes, int searchFlags, float zMeasureMult, float zTolerance); ``` -``` -Get the nth closest vehicle node and its heading. (unknown2 = 9, unknown3 = 3.0, unknown4 = 2.5) +Get the nth closest vehicle node with its heading and total lane count. +If you need specific forward and backward lane counts use [GET_CLOSEST_ROAD](#_0x132F52BBA570FE92) + +```c +enum eNodeFlags { + NONE = 0, + INCLUDE_SWITCHED_OFF_NODES = 1, + INCLUDE_BOAT_NODES = 2, + IGNORE_SLIPLANES = 4, + IGNORE_SWITCHED_OFF_DEAD_ENDS = 8, +} ``` ## Parameters -* **x**: -* **y**: -* **z**: -* **nthClosest**: -* **outPosition**: -* **heading**: -* **unknown1**: -* **unknown2**: -* **unknown3**: -* **unknown4**: +* **x**: x position +* **y**: y position +* **z**: z position +* **nthClosest**: nth closest node +* **outPosition**: returned position of the found node +* **heading**: returned heading of the found node +* **totalLanes**: total lanes (forward + backward) of the found node +* **searchFlags**: Flags used when searching for a node, see `eNodeFlags` +* **zMeasureMult**: How strongly the difference in z direction should be weighted (defaults to 3.0) +* **zTolerance**: How far apart the Z coords have to be before the zMeasureMult kicks in + ## Return value +Returns `true` if the node was found, or `false` if the node was not found, or was not streamed in. diff --git a/PATHFIND/GetVehicleNodeProperties.md b/PATHFIND/GetVehicleNodeProperties.md index ea48f8103..a9aeb13d1 100644 --- a/PATHFIND/GetVehicleNodeProperties.md +++ b/PATHFIND/GetVehicleNodeProperties.md @@ -8,17 +8,32 @@ ns: PATHFIND BOOL GET_VEHICLE_NODE_PROPERTIES(float x, float y, float z, int* density, int* flags); ``` -``` Gets the density and flags of the closest node to the specified position. Density is a value between 0 and 15, indicating how busy the road is. -Flags is a bit field. + +```c +enum eVehicleNodeProperties { + OFF_ROAD = 1 << 0, + ON_PLAYERS_ROAD = 1 << 1, + NO_BIG_VEHICLES = 1 << 2, + SWITCHED_OFF = 1 << 3, + TUNNEL_OR_INTERIOR = 1 << 4, + LEADS_TO_DEAD_END = 1 << 5, + HIGHWAY = 1 << 6, + JUNCTION = 1 << 7, + TRAFFIC_LIGHT = 1 << 8, + GIVE_WAY = 1 << 9, + WATER = 1 << 10, +} ``` ## Parameters -* **x**: -* **y**: -* **z**: -* **density**: -* **flags**: +* **x**: x position of search +* **y**: y position of search +* **z**: z position of search +* **density**: The traffic density the current node will spawn in a range of 0-15. +* **flags**: The vehicle node flags, see `eVehicleNodeProperties`. + ## Return value +Returns `true` if the node was found, or `false` if the node was not found, or was not streamed in.