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

Update some scenario natives #1182

Merged
merged 4 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions PED/IsPedUsingAnyScenario.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ ns: PED
BOOL IS_PED_USING_ANY_SCENARIO(Ped ped);
```


## Parameters
* **ped**:
* **ped**: The ped handle.

## Return value
Returns true if the ped is using any scenario.
6 changes: 4 additions & 2 deletions PED/IsPedUsingScenario.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ ns: PED
BOOL IS_PED_USING_SCENARIO(Ped ped, char* scenario);
```

See [`TASK_START_SCENARIO_IN_PLACE`](#_0x142A02425FF02BD9) for a list of scenarios.

## Parameters
* **ped**:
* **scenario**:
* **ped**: The ped handle.
* **scenario**: The scenario name.

## Return value
Returns true if the specified ped is using the specified scenario.
5 changes: 3 additions & 2 deletions TASK/IsPedActiveInScenario.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ ns: TASK
BOOL IS_PED_ACTIVE_IN_SCENARIO(Ped ped);
```

When passing a ped parameter, the function returns true if the ped is currently in any scenario.
This is a stricter version of [`IS_PED_USING_ANY_SCENARIO`](#_0x57AB4A3080F85143). It only returns true if the ped is playing the ambient animations associated with the scenario.

## Parameters
* **ped**:
* **ped**: The ped handle.

## Return value
coalaura marked this conversation as resolved.
Show resolved Hide resolved
Returns true if the ped is in a using a scenario and is doing the ambient animations.
6 changes: 3 additions & 3 deletions TASK/SetPedCanPlayAmbientIdles.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ aliases: ["0x8FD89A6240813FD0"]

```c
// 0x8FD89A6240813FD0 0xB5AD044E
void SET_PED_CAN_PLAY_AMBIENT_IDLES(Ped ped, BOOL bDisableIdleAnims, BOOL bStopCurrentAnim);
void SET_PED_CAN_PLAY_AMBIENT_IDLES(Ped ped, BOOL bBlockIdleClips, BOOL bRemoveIdleClipIfPlaying);
```

Prevents a ped from playing ambient idle animations.
Expand All @@ -15,6 +15,6 @@ Prevents a ped from playing ambient idle animations.

## Parameters
* **ped**: Ped index.
* **bDisableIdleAnims**: If true, prevents a ped from playing an idle animation this frame.
* **bStopCurrentAnim**: If true and the ped is playing an idle animation, the clip is stopped.
* **bBlockIdleClips**: If true, prevents a ped from playing an idle animation this frame.
* **bRemoveIdleClipIfPlaying**: If true and the ped is playing an idle animation, the clip is stopped.

33 changes: 11 additions & 22 deletions TASK/TaskStartScenarioAtPosition.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,19 @@ ns: TASK

```c
// 0xFA4EFC79F69D4F07 0xAA2C4AC2
void TASK_START_SCENARIO_AT_POSITION(Ped ped, char* scenarioName, float x, float y, float z, float heading, int duration, BOOL sittingScenario, BOOL teleport);
void TASK_START_SCENARIO_AT_POSITION(Ped ped, char* scenarioName, float x, float y, float z, float heading, int timeToLeave, BOOL playIntro, BOOL warp);
```

```
Also a few more listed at TASK::TASK_START_SCENARIO_IN_PLACE just above.
---------------
The first parameter in every scenario has always been a Ped of some sort. The second like TASK_START_SCENARIO_IN_PLACE is the name of the scenario.
The next 4 parameters were harder to decipher. After viewing "hairdo_shop_mp.ysc.c4", and being confused from seeing the case in other scripts, they passed the first three of the arguments as one array from a function, and it looked like it was obviously x, y, and z.
I haven't seen the sixth parameter go to or over 360, making me believe that it is rotation, but I really can't confirm anything.
I have no idea what the last 3 parameters are, but I'll try to find out.
-going on the last 3 parameters, they appear to always be "0, 0, 1"
p6 -1 also used in scrips
p7 used for sitting scenarios
p8 teleports ped to position
```
The ped will move or warp to the position and heading given, then start the scenario passed. See [`TASK_START_SCENARIO_IN_PLACE`](#_0x142A02425FF02BD9) for a list of scenarios.

## Parameters
* **ped**:
* **scenarioName**:
* **x**:
* **y**:
* **z**:
* **heading**:
* **duration**:
* **sittingScenario**:
* **teleport**:
* **ped**: The ped handle.
* **scenarioName**: The name of the scenario to start.
* **x**: The x coordinate to start at.
* **y**: The y coordinate to start at.
* **z**: The z coordinate to start at. Should be the ground position plus the ped's ground to root offset.
* **heading**: The heading to start at.
* **timeToLeave**: Sets the timeout on the scenario point to the specified time in milliseconds. If less than 0, sets the `IdleForever` flag.
* **playIntro**: If the ped should play the scenarios enter animation. Sets the `SkipEnterClip` flag.
* **warp**: If the ped should be warped to the position. Sets the `Warp` flag.

39 changes: 6 additions & 33 deletions TASK/TaskStartScenarioInPlace.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,14 @@ ns: TASK

```c
// 0x142A02425FF02BD9 0xE50D6DDE
void TASK_START_SCENARIO_IN_PLACE(Ped ped, char* scenarioName, int unkDelay, BOOL playEnterAnim);
void TASK_START_SCENARIO_IN_PLACE(Ped ped, char* scenarioName, int timeToLeave, BOOL playIntroClip);
```

```
Plays a scenario on a Ped at their current location.
unkDelay - Usually 0 or -1, doesn't seem to have any effect. Might be a delay between sequences.
playEnterAnim - Plays the "Enter" anim if true, otherwise plays the "Exit" anim. Scenarios that don't have any "Enter" anims won't play if this is set to true.

List of scenarioNames: pastebin.com/6mrYTdQv

Also these:
WORLD_FISH_FLEE
DRIVE
WORLD_HUMAN_HIKER
WORLD_VEHICLE_ATTRACTOR
WORLD_VEHICLE_BICYCLE_MOUNTAIN
WORLD_VEHICLE_BIKE_OFF_ROAD_RACE
WORLD_VEHICLE_BIKER
WORLD_VEHICLE_CONSTRUCTION_PASSENGERS
WORLD_VEHICLE_CONSTRUCTION_SOLO
WORLD_VEHICLE_DRIVE_PASSENGERS
WORLD_VEHICLE_DRIVE_SOLO
WORLD_VEHICLE_EMPTY
WORLD_VEHICLE_PARK_PARALLEL
WORLD_VEHICLE_PARK_PERPENDICULAR_NOSE_IN
WORLD_VEHICLE_POLICE_BIKE
WORLD_VEHICLE_POLICE_CAR
WORLD_VEHICLE_POLICE_NEXT_TO_CAR
WORLD_VEHICLE_SALTON_DIRT_BIKE
WORLD_VEHICLE_TRUCK_LOGS
```
Puts the ped into the given scenario immediately at their current location. [List of scenario names](https://pastebin.com/6mrYTdQv) or in `update/update.rpf/common/data/ai/scenarios.meta`.

## Parameters
* **ped**:
* **scenarioName**:
* **unkDelay**:
* **playEnterAnim**:
* **ped**: The ped handle.
* **scenarioName**: The name of the scenario to start.
* **timeToLeave**: Sets the timeout on the scenario point to the specified time in milliseconds. If less than 0, sets the `IdleForever` flag.
* **playIntroClip**: If the ped should play the scenarios enter animation. Sets the `SkipEnterClip` flag.

Loading