Skip to content

Commit

Permalink
Updating node documentation (#762)
Browse files Browse the repository at this point in the history
* Update GetNthClosestVehicleNodeWithHeading.md

* Update GetNthClosestVehicleNodeWithHeading.md

* Update GetClosestRoad.md

* Update GetClosestRoad.md

* Update GetVehicleNodeProperties.md

* Fixed src and dest node order

* Update GetClosestRoad.md

* Update GetClosestRoad.md

* Update GetClosestRoad.md

* Update GetClosestRoad.md

* Update GetNthClosestVehicleNodeWithHeading.md

* Update GetVehicleNodeProperties.md

* Update GetVehicleNodeProperties.md

* Update GetVehicleNodeProperties.md

* Update GetNthClosestVehicleNodeWithHeading.md

* tweak: cleanup docs a bit

---------

Co-authored-by: Dillon Skaggs <[email protected]>
  • Loading branch information
lfshr and AvarianKnight authored Aug 15, 2024
1 parent e92dcdb commit c184738
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 35 deletions.
29 changes: 14 additions & 15 deletions PATHFIND/GetClosestRoad.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
37 changes: 24 additions & 13 deletions PATHFIND/GetNthClosestVehicleNodeWithHeading.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
29 changes: 22 additions & 7 deletions PATHFIND/GetVehicleNodeProperties.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit c184738

Please sign in to comment.