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 4 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* unknown, float amplitude);
freedy69 marked this conversation as resolved.
Show resolved Hide resolved
```

```
Example from michael2 script.
CAM::ANIMATED_SHAKE_CAM(l_5069, "shake_cam_all@", "light", "", 1f);
```
Makes a camera shake with an animation.
freedy69 marked this conversation as resolved.
Show resolved Hide resolved
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.
* **unknown**: Scripts only 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* unknown, float amplitude);
freedy69 marked this conversation as resolved.
Show resolved Hide resolved
```

```
CAM::ANIMATED_SHAKE_SCRIPT_GLOBAL("SHAKE_CAM_medium", "medium", "", 0.5f);
```
Makes script created cameras shake with an animation.
freedy69 marked this conversation as resolved.
Show resolved Hide resolved
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.
* **unknown**: Scripts only use ""
* **amplitude**: Strength of the shake.

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

This file was deleted.

24 changes: 24 additions & 0 deletions CAM/SetTableGamesCameraThisUpdate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
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
freedy69 marked this conversation as resolved.
Show resolved Hide resolved

## Parameters
* **typeHash**: Which table game object to focus on
freedy69 marked this conversation as resolved.
Show resolved Hide resolved
23 changes: 5 additions & 18 deletions CAM/ShakeCam.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,13 @@ 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](https://github.com/DurtyFree/gta-v-data-dumps/blob/master/camShakeTypesCompact.json)
freedy69 marked this conversation as resolved.
Show resolved Hide resolved

## 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.
[Shake Types](https://github.com/DurtyFree/gta-v-data-dumps/blob/master/camShakeTypesCompact.json)

## 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.
[Shake Types](https://github.com/DurtyFree/gta-v-data-dumps/blob/master/camShakeTypesCompact.json)
freedy69 marked this conversation as resolved.
Show resolved Hide resolved

## 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.
[Shake Types](https://github.com/DurtyFree/gta-v-data-dumps/blob/master/camShakeTypesCompact.json)
freedy69 marked this conversation as resolved.
Show resolved Hide resolved

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

4 changes: 2 additions & 2 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 cam, BOOL instantly);
```


## Parameters
* **cam**:
freedy69 marked this conversation as resolved.
Show resolved Hide resolved
* **p1**:
* **instantly**: If true, the camera stops shaking instantly. If false, it transitions into normal state.

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 transitions into normal state.
freedy69 marked this conversation as resolved.
Show resolved Hide resolved

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 transitions into normal state.
freedy69 marked this conversation as resolved.
Show resolved Hide resolved

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 currently rendering scripted camera (If any) stops shaking instantly. If false, it transitions into normal state.
freedy69 marked this conversation as resolved.
Show resolved Hide resolved

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();
```

Sets a stunt camera every update.
freedy69 marked this conversation as resolved.
Show resolved Hide resolved
Call this native every frame.
16 changes: 16 additions & 0 deletions HUD/CodeWantsScriptToTakeControl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
ns: HUD
aliases: ["0x66E7CB63C97B7D20"]
---
## CODE_WANTS_SCRIPT_TO_TAKE_CONTROL

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


## Return value
Returns true if game code wants script to take control of a Pause Menu screen this frame.
Use [`GET_SCREEN_CODE_WANTS_SCRIPT_TO_CONTROL`](#_0x593FEAE1F73392D4) to get value of which screen should be controlled.
freedy69 marked this conversation as resolved.
Show resolved Hide resolved
Currently, there is no possible way to tell when the player has switched out of this screen.
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();
```


Pause menu ignores controls 199 and 200 per frame this native is called, which prevents it from opening or closing.
freedy69 marked this conversation as resolved.
Show resolved Hide resolved
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.

6 changes: 3 additions & 3 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();
```


32 changes: 32 additions & 0 deletions HUD/GetMenuLayoutChangedEventDetails.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
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 pausemenu is closed:
oldMenuState = -1
currentMenuState = -1
selectedItemUniqueId = 0
when the header gains focus:
oldMenuState updates as normal or 0 if the pausemenu was just opened
currentMenuState becomes a unique id for the pausemenu page that focus was taken from (?) or 0 if the pausemenu was just opened
selectedItemUniqueId = -1
when focus is moved from the header to a pausemenu page:
oldMenuState becomes a unique id for the pausemenu page that focus was moved to (?)
currentMenuState = -1
selectedItemUniqueId updates as normal
freedy69 marked this conversation as resolved.
Show resolved Hide resolved

## 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
17 changes: 17 additions & 0 deletions HUD/GetMenuTriggerEventDetails.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
ns: HUD
aliases: ["0x36C1451A88A09630", "_GET_PAUSE_MENU_SELECTION"]
---
## GET_MENU_TRIGGER_EVENT_DETAILS

```c
// 0x36C1451A88A09630 0x8543AAC8
void GET_MENU_TRIGGER_EVENT_DETAILS(cs_type(AnyPtr) int* lastItemMenuId, cs_type(AnyPtr) int* selectedItemUniqueId);
```

Returns details of the currently occurred trigger event.
See [`HAS_MENU_TRIGGER_EVENT_OCCURRED`](#_0xF284AC67940C6812).

## Parameters
* **lastItemMenuId**:
* **selectedItemUniqueId**:
Loading
Loading