Skip to content

Commit

Permalink
tweak: cleanup docs a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
AvarianKnight authored Aug 14, 2024
1 parent c1d368d commit 070d0bc
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 32 deletions.
6 changes: 2 additions & 4 deletions PATHFIND/GetClosestRoad.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ ns: PATHFIND

```c
// 0x132F52BBA570FE92 0x567B0E11
cs_type(Any) bool GET_CLOSEST_ROAD(float x, float y, float z, float minimumEdgeLength, int minimumLaneCount, Vector3* srcNode, Vector3* targetNode, cs_type(Any*) int* laneCountForward, cs_type(Any*) int* laneCountBackward, float* width, BOOL onlyMajorRoads);
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);
```
## Description
Finds an edge (node connection to another node) that satisfies the specified criteria.
## Parameters
Expand All @@ -26,4 +24,4 @@ Finds an edge (node connection to another node) that satisfies the specified cri
* **onlyMajorRoads**: Return major roads only.
## Return value
bool indicating whether a road was found.
Returns `true` if a road was found, `false` otherwise.
28 changes: 16 additions & 12 deletions PATHFIND/GetNthClosestVehicleNodeWithHeading.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,21 @@ 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, cs_type(Any*) int* totalLanes, int searchFlags, 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);
```
## Description
Get the nth closest vehicle node with its heading and total lane count.
If you need specific foward and backward lane counts use [GET_CLOSEST_ROAD](#_0x132F52BBA570FE92)
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**: x position
Expand All @@ -20,15 +29,10 @@ If you need specific foward and backward lane counts use [GET_CLOSEST_ROAD](#_0x
* **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 below)
* **unknown3**: always 3.0
* **unknown4**: sometimes 0.0, sometimes 2.5
* **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

### SearchFlags
* **0x1**: Include Disabled Roads.
* **0x2**: Only Water Nodes. Must be used alongside "Include Disabled" as all water nodes are disabled. (use the number 3)
* **0x4**: Removes secondary nodes from the search. (Junction, Stop, LeftTurnOnly, SlipRoad, Shortcut & edge merges/splits nodes)
* **0x8**: No Dead Ends.

## Return value
bool indicating whether a node was found
Returns `true` if the node was found, or `false` if the node was not found, or was not streamed in.
35 changes: 19 additions & 16 deletions PATHFIND/GetVehicleNodeProperties.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,32 @@ ns: PATHFIND
BOOL GET_VEHICLE_NODE_PROPERTIES(float x, float y, float z, int* density, int* flags);
```
## Description
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.
```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**: x position of search
* **y**: y position of search
* **z**: z position of search
* **density**: returned density of traffic ranging from 0 - 15
* **flags**: returned flags of this node (see below)
* **density**: The traffic density the current node will spawn in a range of 0-15.
* **flags**: The vehicle node flags, see `eVehicleNodeProperties`.

### Flags
* **0x1**: Offroad
* **0x2**: Unknown. Potentially a target for wander tasks as it follows game camera.
* **0x4**: NoBigVehicles
* **0x8**: Disabled
* **0x10**: Tunnel
* **0x20**: DeadEnd
* **0x40**: Highway
* **0x80**: Junction
* **0x100**: TrafficLight
* **0x200**: StopSign
* **0x400**: Unknown

## Return value
bool indicating whether a node was found
Returns `true` if the node was found, or `false` if the node was not found, or was not streamed in.

0 comments on commit 070d0bc

Please sign in to comment.