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

Document various natives #938

Closed
wants to merge 9 commits into from
Closed
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
18 changes: 8 additions & 10 deletions CAM/AnimatedShakeCam.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,16 @@ ns: CAM

```c
// 0xA2746EEAE3E577CD 0xE1168767
void ANIMATED_SHAKE_CAM(Cam cam, char* p1, char* p2, char* p3, float amplitude);
void ANIMATED_SHAKE_CAM(Cam cam, char* shakeAnimDict, char* shakeAnimName, char* shakeName, float amplitude);
```

```
Example from michael2 script.
CAM::ANIMATED_SHAKE_CAM(l_5069, "shake_cam_all@", "light", "", 1f);
```
Initiate a camera animation to be played on the scripted camera.
You must request the animation dictionary with [REQUEST_ANIM_DICT](#_0xD3BD40951412FEF6) and wait for it to load with [HAS_ANIM_DICT_LOADED](#_0xD031A9162D01088C).

## Parameters
* **cam**:
* **p1**:
* **p2**:
* **p3**:
* **amplitude**:
* **cam**: Cam ID returned by [`CREATE_CAM`](#_0xC3981DCE61D9E13F)
* **shakeAnimDict**: Animation dictionary to shake this camera with.
* **shakeAnimName**: Animation name from the dictionary to play on this camera.
* **shakeName**: Controls how shake ramps up/down at start/end. This parameter is optional, scripts mostly use ""
* **amplitude**: Strength of the shake

15 changes: 7 additions & 8 deletions CAM/AnimatedShakeScriptGlobal.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@ aliases: ["0xC2EAE3FB8CDBED31"]

```c
// 0xC2EAE3FB8CDBED31 0xCB75BD9C
void ANIMATED_SHAKE_SCRIPT_GLOBAL(char* p0, char* p1, char* p2, float p3);
void ANIMATED_SHAKE_SCRIPT_GLOBAL(char* shakeAnimDict, char* shakeAnimName, char* shakeName, float amplitude);
```

```
CAM::ANIMATED_SHAKE_SCRIPT_GLOBAL("SHAKE_CAM_medium", "medium", "", 0.5f);
```
Applies preset shake effect universally across the rendered output of all currently active scripted cameras.
You must request the animation dictionary with [REQUEST_ANIM_DICT](#_0xD3BD40951412FEF6) and wait for it to load with [HAS_ANIM_DICT_LOADED](#_0xD031A9162D01088C).

## Parameters
* **p0**:
* **p1**:
* **p2**:
* **p3**:
* **shakeAnimDict**: Animation dictionary of the shake.
* **shakeAnimName**: Animation name of the shake.
* **shakeName**: Controls how shake ramps up/down at start/end. This parameter is optional, scripts mostly use ""
* **amplitude**: Strength of the shake.

16 changes: 0 additions & 16 deletions CAM/N_0x79c0e43eb9b944e2.md

This file was deleted.

29 changes: 29 additions & 0 deletions CAM/SetTableGamesCameraThisUpdate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
ns: CAM
aliases: ["0x79C0E43EB9B944E2"]
---
## SET_TABLE_GAMES_CAMERA_THIS_UPDATE

```c
// 0x79C0E43EB9B944E2
BOOL SET_TABLE_GAMES_CAMERA_THIS_UPDATE(Hash typeHash);
```

Makes the gameplay camera focus on a casino table game object, depending on the type.
Call this native every frame.

### Availables hashes:
- CASINO_INSIDE_TRACK_CAMERA
- CASINO_SLOT_MACHINE_CAMERA
- CASINO_LUCKY_WHEEL_CAMERA
- CASINO_BLACKJACK_CAMERA
- CASINO_ROULETTE_CAMERA
- CASINO_POKER_CAMERA
- ARCADE_LOVE_PROFESSOR_P1_CAMERA
- ARCADE_LOVE_PROFESSOR_P2_CAMERA

## Parameters
* **typeHash**: Which table game object to focus on
freedy69 marked this conversation as resolved.
Show resolved Hide resolved

## Return value
True if the camera settings were successfully updated.
31 changes: 13 additions & 18 deletions CAM/ShakeCam.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,21 @@ ns: CAM

```c
// 0x6A25241C340D3822 0x1D4211B0
void SHAKE_CAM(Cam cam, char* type, float amplitude);
void SHAKE_CAM(Cam cam, char* shakeType, float amplitude);
```

```
Possible shake types (updated b617d):
DEATH_FAIL_IN_EFFECT_SHAKE
DRUNK_SHAKE
FAMILY5_DRUG_TRIP_SHAKE
HAND_SHAKE
JOLT_SHAKE
LARGE_EXPLOSION_SHAKE
MEDIUM_EXPLOSION_SHAKE
SMALL_EXPLOSION_SHAKE
ROAD_VIBRATION_SHAKE
SKY_DIVING_SHAKE
VIBRATE_SHAKE
```
### Shake types:
- SMALL_EXPLOSION_SHAKE
- MEDIUM_EXPLOSION_SHAKE
- LARGE_EXPLOSION_SHAKE
- HAND_SHAKE
- JOLT_SHAKE
- VIBRATE_SHAKE
- WOBBLY_SHAKE
- DRUNK_SHAKE

## Parameters
* **cam**:
* **type**:
* **amplitude**:
* **cam**: Cam ID returned by [`CREATE_CAM`](#_0xC3981DCE61D9E13F)
* **shakeType**: How the camera should shake
* **amplitude**: Strength of this shake

11 changes: 5 additions & 6 deletions CAM/ShakeCinematicCam.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ ns: CAM

```c
// 0xDCE214D9ED58F3CF 0x61815F31
void SHAKE_CINEMATIC_CAM(char* p0, float p1);
void SHAKE_CINEMATIC_CAM(char* shakeType, float amplitude);
```

```
p0 argument found in the b617d scripts: "DRUNK_SHAKE"
```
Makes the idle and/or cinematic camera shake.
See [SHAKE_CAM](#_0x6A25241C340D3822) for a list of available shakeTypes.

## Parameters
* **p0**:
* **p1**:
* **shakeType**: How the cinematic/idle camera should shake
* **amplitude**: Strength of the cam shake

22 changes: 5 additions & 17 deletions CAM/ShakeGameplayCam.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,13 @@ ns: CAM

```c
// 0xFD55E49555E017CF 0xF2EFE660
void SHAKE_GAMEPLAY_CAM(char* shakeName, float intensity);
void SHAKE_GAMEPLAY_CAM(char* shakeType, float amplitude);
```

```
Possible shake types (updated b617d):
DEATH_FAIL_IN_EFFECT_SHAKE
DRUNK_SHAKE
FAMILY5_DRUG_TRIP_SHAKE
HAND_SHAKE
JOLT_SHAKE
LARGE_EXPLOSION_SHAKE
MEDIUM_EXPLOSION_SHAKE
SMALL_EXPLOSION_SHAKE
ROAD_VIBRATION_SHAKE
SKY_DIVING_SHAKE
VIBRATE_SHAKE
```
Makes the main gameplay camera shake.
See [SHAKE_CAM](#_0x6A25241C340D3822) for a list of available shakeTypes.

## Parameters
* **shakeName**:
* **intensity**:
* **shakeType**: How the camera should shake
* **amplitude**: Strength of the shake

11 changes: 5 additions & 6 deletions CAM/ShakeScriptGlobal.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ aliases: ["0xF4C8CF9E353AFECA"]

```c
// 0xF4C8CF9E353AFECA 0x2B0F05CD
void SHAKE_SCRIPT_GLOBAL(char* p0, float p1);
void SHAKE_SCRIPT_GLOBAL(char* shakeType, float amplitude);
```

```
CAM::SHAKE_SCRIPT_GLOBAL("HAND_SHAKE", 0.2);
```
Makes every camera created by scripts shake.
See [SHAKE_CAM](#_0x6A25241C340D3822) for a list of available shakeTypes.

## Parameters
* **p0**:
* **p1**:
* **shakeType**: How script cams should shake
* **amplitude**: Intensity of cam shake

6 changes: 3 additions & 3 deletions CAM/StopCamShaking.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ ns: CAM

```c
// 0xBDECF64367884AC3 0x40D0EB87
void STOP_CAM_SHAKING(Cam cam, BOOL p1);
void STOP_CAM_SHAKING(Cam camIndex, BOOL instantly);
```


## Parameters
* **cam**:
* **p1**:
* **camIndex**: Cam index returned by [CREATE_CAM](#_0xC3981DCE61D9E13F)
* **instantly**: If true, the camera stops shaking instantly. If false, it will enter its release phase and fade out.

4 changes: 2 additions & 2 deletions CAM/StopCinematicCamShaking.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ ns: CAM

```c
// 0x2238E588E588A6D7 0x71C12904
void STOP_CINEMATIC_CAM_SHAKING(BOOL p0);
void STOP_CINEMATIC_CAM_SHAKING(BOOL instantly);
```


## Parameters
* **p0**:
* **instantly**: If true, the camera stops shaking instantly. If false, it will enter its release phase and fade out.

4 changes: 2 additions & 2 deletions CAM/StopGameplayCamShaking.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ ns: CAM

```c
// 0x0EF93E9F3D08C178 0xFD569E4E
void STOP_GAMEPLAY_CAM_SHAKING(BOOL p0);
void STOP_GAMEPLAY_CAM_SHAKING(BOOL instantly);
```


## Parameters
* **p0**:
* **instantly**: If true, the camera stops shaking instantly. If false, it will enter its release phase and fade out.

11 changes: 2 additions & 9 deletions CAM/StopScriptGlobalShaking.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,9 @@ aliases: ["0x1C9D7949FA533490"]

```c
// 0x1C9D7949FA533490 0x26FCFB96
void STOP_SCRIPT_GLOBAL_SHAKING(BOOL p0);
```

```
In drunk_controller.c4, sub_309
if (CAM::IS_SCRIPT_GLOBAL_SHAKING()) {
CAM::STOP_SCRIPT_GLOBAL_SHAKING(0);
}
void STOP_SCRIPT_GLOBAL_SHAKING(BOOL instantly);
```

## Parameters
* **p0**:
* **instantly**: If true, the current camera stops shaking instantly. If false, it will enter its release phase and fade out.

11 changes: 0 additions & 11 deletions CAM/UseStuntCameraThisFrame.md

This file was deleted.

13 changes: 13 additions & 0 deletions CAM/UseVehicleCamStuntSettingsThisUpdate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
ns: CAM
aliases: ["0x6493CF69859B116A", "_USE_STUNT_CAMERA_THIS_FRAME"]
---
## USE_VEHICLE_CAM_STUNT_SETTINGS_THIS_UPDATE

```c
// 0x6493CF69859B116A
void USE_VEHICLE_CAM_STUNT_SETTINGS_THIS_UPDATE();
```

Modifies a set of settings for the vehicle camera to prevent confusion when performing specific stunts, such as navigating inside pipes or similar scenarios.
Call this native every frame.
15 changes: 15 additions & 0 deletions HUD/CodeWantsScriptToTakeControl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
ns: HUD
aliases: ["0x66E7CB63C97B7D20"]
---
## CODE_WANTS_SCRIPT_TO_TAKE_CONTROL

```c
// 0x66E7CB63C97B7D20 0x92DAFA78
cs_type(Any) BOOL CODE_WANTS_SCRIPT_TO_TAKE_CONTROL();
```

Use this native every frame. If it returns true, you can get the screen value with [`GET_SCREEN_CODE_WANTS_SCRIPT_TO_CONTROL`](#_0x593FEAE1F73392D4).

## Return value
Returns true if game code wants script to take control of a Pause Menu screen this frame.
2 changes: 1 addition & 1 deletion HUD/DisableFrontendThisFrame.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ ns: HUD
void DISABLE_FRONTEND_THIS_FRAME();
```


Disables opening frontend menus this frame.
16 changes: 16 additions & 0 deletions HUD/DisablePausemenuSpinner.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
ns: HUD
aliases: ["0x9245e81072704b8a", "_PAUSE_MENU_DISABLE_BUSYSPINNER"]
---
## DISABLE_PAUSEMENU_SPINNER

```c
// 0x9245E81072704B8A
void DISABLE_PAUSEMENU_SPINNER(BOOL toggle);
```

Disables the loading spinner in Pause Menu which appears when switching from one header tab to another.

## Parameters
* **toggle**: true to disable and false to re-enable the loading icon.

8 changes: 4 additions & 4 deletions HUD/ForceCloseTextInputBox.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
ns: HUD
aliases: ["0x8817605C2BA76200"]
aliases: ["0x8817605C2BA76200", "_FORCE_CLOSE_TEXT_INPUT_BOX"]
---
## _FORCE_CLOSE_TEXT_INPUT_BOX
## FORCE_CLOSE_TEXT_INPUT_BOX

```c
freedy69 marked this conversation as resolved.
Show resolved Hide resolved
// 0x8817605C2BA76200
void _FORCE_CLOSE_TEXT_INPUT_BOX();
void FORCE_CLOSE_TEXT_INPUT_BOX();
```


Forces the text input box to close if it is open.
35 changes: 35 additions & 0 deletions HUD/GetMenuLayoutChangedEventDetails.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
ns: HUD
aliases: ["0x7E17BE53E1AAABAF", "_GET_PAUSE_MENU_SELECTION_DATA"]
---
## GET_MENU_LAYOUT_CHANGED_EVENT_DETAILS

```c
// 0x7E17BE53E1AAABAF 0x6025AA2F
void GET_MENU_LAYOUT_CHANGED_EVENT_DETAILS(int* oldMenuState, int* currentMenuState, int* selectedItemUniqueId);
```

Returns details of the current layout changed event which is triggered from the Pause Menu scaleform.
Also see [`HAS_MENU_LAYOUT_CHANGE_EVENT_OCCURED`](#_0x2E22FEFA0100275E).

Menu state values can be viewed in [PauseMenuLUT.as](https://gist.github.com/freedy69/19c4be9699e07946285f9b51799b67a9) in scaleform files.

When the Pause Menu is closed:
* `oldMenuState` = -1
* `currentMenuState` = -1
* `selectedItemUniqueId` = 0

When the header gains focus:
* `oldMenuState` updates as normal or 0 if the Pause Menu was just opened
* `currentMenuState` becomes a unique id for the Pause Menu page that focus was taken from (?) or 0 if the Pause Menu was just opened
* `selectedItemUniqueId` = -1

When focus is moved from the header to a Pause Menu page:
* `oldMenuState` becomes a unique id for the Pause Menu page that focus was moved to (?)
* `currentMenuState` = -1
* `selectedItemUniqueId` updates as normal

## Parameters
* **oldMenuState**: This is the menuID of the last selected item minus 1000 (lastItem.menuID - 1000)
* **currentMenuState**: Same as oldMenuState except for the currently selected menu item
* **selectedItemUniqueId**: This is uniqueID of the currently selected menu item
Loading
Loading