Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating node documentation #762

Merged
merged 16 commits into from
Aug 15, 2024
Merged
31 changes: 16 additions & 15 deletions PATHFIND/GetClosestRoad.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,25 @@ 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, cs_type(Any*) int* laneCountForward, cs_type(Any*) int* laneCountBackward, float* width, BOOL onlyMajorRoads);
AvarianKnight marked this conversation as resolved.
Show resolved Hide resolved
```

```
p1 seems to be always 1.0f in the scripts
```
## Description

AvarianKnight marked this conversation as resolved.
Show resolved Hide resolved
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
bool indicating whether a road was found.
AvarianKnight marked this conversation as resolved.
Show resolved Hide resolved
35 changes: 21 additions & 14 deletions PATHFIND/GetNthClosestVehicleNodeWithHeading.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,30 @@ 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, cs_type(Any*) int* totalLanes, int searchFlags, float unknown3, float unknown4);
AvarianKnight marked this conversation as resolved.
Show resolved Hide resolved
```

```
Get the nth closest vehicle node and its heading. (unknown2 = 9, unknown3 = 3.0, unknown4 = 2.5)
```
## Description
AvarianKnight marked this conversation as resolved.
Show resolved Hide resolved
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)
AvarianKnight marked this conversation as resolved.
Show resolved Hide resolved

## 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 below)
AvarianKnight marked this conversation as resolved.
Show resolved Hide resolved
* **unknown3**: always 3.0
AvarianKnight marked this conversation as resolved.
Show resolved Hide resolved
* **unknown4**: sometimes 0.0, sometimes 2.5
AvarianKnight marked this conversation as resolved.
Show resolved Hide resolved

### 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.
AvarianKnight marked this conversation as resolved.
Show resolved Hide resolved

## Return value
bool indicating whether a node was found
AvarianKnight marked this conversation as resolved.
Show resolved Hide resolved
28 changes: 20 additions & 8 deletions PATHFIND/GetVehicleNodeProperties.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,29 @@ ns: PATHFIND
BOOL GET_VEHICLE_NODE_PROPERTIES(float x, float y, float z, int* density, int* flags);
```

```
## Description
AvarianKnight marked this conversation as resolved.
Show resolved Hide resolved
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.
AvarianKnight marked this conversation as resolved.
Show resolved Hide resolved
Flags is a bit field.
```

## Parameters
* **x**:
* **y**:
* **z**:
* **density**:
* **flags**:
* **x**: x position of search
* **y**: y position of search
* **z**: z position of search
* **density**: returned density of traffic ranging from 0 - 15
AvarianKnight marked this conversation as resolved.
Show resolved Hide resolved
* **flags**: returned flags of this node (see below)
AvarianKnight marked this conversation as resolved.
Show resolved Hide resolved

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

## Return value
bool indicating whether a node was found
AvarianKnight marked this conversation as resolved.
Show resolved Hide resolved
AvarianKnight marked this conversation as resolved.
Show resolved Hide resolved