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 Patrol Route natives #811

Merged
merged 7 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions TASK/AddPatrolRouteLink.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,26 @@ ns: TASK

```c
// 0x23083260DEC3A551 0xD8761BB3
void ADD_PATROL_ROUTE_LINK(Any p0, Any p1);
void ADD_PATROL_ROUTE_LINK(int id1, int id2);
```

connects 2 route nodes to make it clear how the ped should move

## Parameters
* **p0**:
* **p1**:
* **id1**:
* **id2**:

## Examples
![image](https://user-images.githubusercontent.com/55803068/188470866-c32c6a9f-a25d-4772-9b18-5be46e2c14a1.png)
XenoS-ITA marked this conversation as resolved.
Show resolved Hide resolved

``` lua
XenoS-ITA marked this conversation as resolved.
Show resolved Hide resolved
-- these lines connect 1,2,3,4,5,6 in a cyclic manner (1 > 2 > 3 > 4 > 5 > 6 > 1)


AddPatrolRouteLink(1,2)
AddPatrolRouteLink(2,3)
AddPatrolRouteLink(3,4)
AddPatrolRouteLink(4,5)
AddPatrolRouteLink(5,6)
AddPatrolRouteLink(6,1)
```
39 changes: 17 additions & 22 deletions TASK/AddPatrolRouteNode.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,25 @@ ns: TASK

```c
// 0x8EDF950167586B7C 0x21B48F10
void ADD_PATROL_ROUTE_NODE(int p0, char* p1, float x1, float y1, float z1, float x2, float y2, float z2, int p8);
void ADD_PATROL_ROUTE_NODE(int id, char* guardScenario, float x1, float y1, float z1, float x2, float y2, float z2, int waitTime);
```

```
Example:
TASK::ADD_PATROL_ROUTE_NODE(2, "WORLD_HUMAN_GUARD_STAND", -193.4915, -2378.864990234375, 10.9719, -193.4915, -2378.864990234375, 10.9719, 3000);
p0 is between 0 and 4 in the scripts.
p1 is "WORLD_HUMAN_GUARD_STAND" or "StandGuard".
p2, p3 and p4 is only one parameter sometimes in the scripts. Most likely a Vector3 hence p2, p3 and p4 are coordinates.
Examples:
TASK::ADD_PATROL_ROUTE_NODE(1, "WORLD_HUMAN_GUARD_STAND", l_739[7/*3*/], 0.0, 0.0, 0.0, 0);
TASK::ADD_PATROL_ROUTE_NODE(1, "WORLD_HUMAN_GUARD_STAND", l_B0[17/*44*/]._f3, l_B0[17/*44*/]._f3, 2000);
p5, p6 and p7 are for example set to: 1599.0406494140625, 2713.392578125, 44.4309.
p8 is an int, often random set to for example: MISC::GET_RANDOM_INT_IN_RANGE(5000, 10000).
```
x2,y2 and z2 are the coordinates to which the ped should look at

## Parameters
* **p0**:
* **p1**:
* **x1**:
* **y1**:
* **z1**:
* **x2**:
* **y2**:
* **z2**:
* **p8**:
* **id**: is an integer that "identifies" the route node for linking to the route with ADD_PATROL_ROUTE_LINK.
* **guardScenario**: can be "WORLD_HUMAN_GUARD_STAND" or "StandGuard"
* **x1**: destination
* **y1**: destination
* **z1**: destination
* **x2**: coordinates to which the ped should look
* **y2**: coordinates to which the ped should look
* **z2**: coordinates to which the ped should look
* **waitTime**: written in ms

## Examples

```lua
-- the guard will go toward vector3(1.0, 1.0, 1.0) coordinates looking toward vector3(0.0, 0.0, 0.0) coordinates waiting 1000ms with the WORLD_HUMAN_GUARD_STAND animation
AddPatrolRouteNode(1, "WORLD_HUMAN_GUARD_STAND", vector3(1.0, 1.0, 1.0), vector3(0.0, 0.0, 0.0), 1000)
```