Skip to content

Commit

Permalink
feat(audio): batch 9 of native updates (#1005)
Browse files Browse the repository at this point in the history
* feat(audio): batch 9 of native updates

* Update OverrideMicrophoneSettings.md

Re-add old native name as alias.

---------

Co-authored-by: ammonia-cfx <[email protected]>
  • Loading branch information
AvarianKnight and 4mmonium authored Mar 12, 2024
1 parent 2c8cf42 commit b34658b
Show file tree
Hide file tree
Showing 10 changed files with 91 additions and 92 deletions.
12 changes: 7 additions & 5 deletions AUDIO/OverrideMicrophoneSettings.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
---
ns: AUDIO
aliases: ["0x75773E11BA459E90"]
aliases: ["0x75773E11BA459E90", "_OVERRIDE_MICROPHONE_SETTINGS"]
---
## _OVERRIDE_MICROPHONE_SETTINGS
## OVERRIDE_MICROPHONE_SETTINGS

```c
// 0x75773E11BA459E90
void _OVERRIDE_MICROPHONE_SETTINGS(cs_type(Any) Hash hash, BOOL toggle);
void OVERRIDE_MICROPHONE_SETTINGS(cs_type(Any) Hash hash, BOOL toggle);
```
Sets audio flag "OverrideMicrophoneSettings"
Allows the script to ovverride the current microphone settings
## Parameters
* **hash**:
* **toggle**:
* **hash**:
* **toggle**:
7 changes: 4 additions & 3 deletions AUDIO/OverridePlayerGroundMaterial.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ aliases: ["0xD2CC78CD3D0B50F9"]

```c
// 0xD2CC78CD3D0B50F9 0xC307D531
void OVERRIDE_PLAYER_GROUND_MATERIAL(cs_type(Any) Hash hash, BOOL toggle);
void OVERRIDE_PLAYER_GROUND_MATERIAL(cs_type(Any) Hash overriddenMaterialHash, BOOL scriptOverrides);
```
Sets the footstep tuning modes
## Parameters
* **hash**:
* **toggle**:
* **overriddenMaterialHash**:
* **scriptOverrides**: True to override with the given overridenMaterialHash, false to stop overriding
4 changes: 3 additions & 1 deletion AUDIO/OverrideTrevorRage.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ void OVERRIDE_TREVOR_RAGE(char* voiceEffect);
This native enables the audio flag "TrevorRageIsOverridden" and sets the voice effect to `voiceEffect`
To clear the override use [RESET_TREVOR_RAGE](#_0xE78503B10C4314E0)
## Parameters
* **voiceEffect**:
* **voiceEffect**:
10 changes: 7 additions & 3 deletions AUDIO/OverrideUnderwaterStream.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ ns: AUDIO

```c
// 0xF2A9CDABCEA04BD6 0x9A083B7E
void OVERRIDE_UNDERWATER_STREAM(Any* p0, BOOL p1);
void OVERRIDE_UNDERWATER_STREAM(cs_type(AnyPtr) char* streamName, BOOL override);
```
This native allows a scripter to override the current underwater stream.
It needs to be called before going into the water
It needs to also be called with OVERRIDE_UNDERWATER_STREAM("", false) in order to stop overriding.
## Parameters
* **p0**:
* **p1**:
* **streamName**:
* **override**:
5 changes: 3 additions & 2 deletions AUDIO/PauseScriptedConversation.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ ns: AUDIO

```c
// 0x8530AD776CD72B12 0xE2C9C6F8
void PAUSE_SCRIPTED_CONVERSATION(BOOL p0);
void PAUSE_SCRIPTED_CONVERSATION(BOOL finishCurrentLine);
```
To resume the conversation use [RESTART_SCRIPTED_CONVERSATION](#_0x9AEB285D1818C9AC)
## Parameters
* **p0**:
* **finishCurrentLine**:
14 changes: 6 additions & 8 deletions AUDIO/PlayAmbientSpeechFromPositionNative.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ aliases: ["0xED640017ED337E45","_PLAY_AMBIENT_SPEECH_AT_COORDS"]
void PLAY_AMBIENT_SPEECH_FROM_POSITION_NATIVE(char* speechName, char* voiceName, float x, float y, float z, char* speechParam);
```
## Parameters
* **speechName**:
* **voiceName**:
* **x**:
* **y**:
* **z**:
* **speechParam**:
* **speechName**:
* **voiceName**:
* **x**:
* **y**:
* **z**:
* **speechParam**: See [`PLAY_PED_AMBIENT_SPEECH_NATIVE`](#_0x8E04FEDD28D42462) for params
22 changes: 14 additions & 8 deletions AUDIO/PlayAnimalVocalization.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,23 @@ aliases: ["0xEE066C7006C49C0A"]

```c
// 0xEE066C7006C49C0A 0x498849F3
void PLAY_ANIMAL_VOCALIZATION(Ped pedHandle, int p1, char* speechName);
void PLAY_ANIMAL_VOCALIZATION(Ped pedHandle, int animalType, char* speechName);
```
```
Plays sounds from a ped with chop model. For example it used to play bark or sniff sounds. p1 is always 3 or 4294967295 in decompiled scripts. By a quick disassembling I can assume that this arg is unused.
This native is works only when you call it on the ped with right model (ac_chop only ?)
Speech Name can be: CHOP_SNIFF_SEQ CHOP_WHINE CHOP_LICKS_MOUTH CHOP_PANT bark GROWL SNARL BARK_SEQ
```c
enum eAudAnimalType {
AUD_ANIMAL_NONE = -1,
AUD_ANIMAL_BOAR,
AUD_ANIMAL_CHICKEN,
AUD_ANIMAL_DOG,
AUD_ANIMAL_DOG_ROTTWEILER,
AUD_ANIMAL_HORSE,
AUD_NUM_ANIMALS
}
```

## Parameters
* **pedHandle**:
* **p1**:
* **speechName**:
* **pedHandle**:
* **animalType**:
* **speechName**:

9 changes: 2 additions & 7 deletions AUDIO/PlayDeferredSoundFrontend.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@ aliases: ["0xCADA5A0D0702381E"]
void PLAY_DEFERRED_SOUND_FRONTEND(char* soundName, char* soundsetName);
```
```
Only call found in the b617d scripts:
AUDIO::PLAY_DEFERRED_SOUND_FRONTEND("BACK", "HUD_FREEMODE_SOUNDSET");
```
## Parameters
* **soundName**:
* **soundsetName**:
* **soundName**:
* **soundsetName**:
4 changes: 2 additions & 2 deletions AUDIO/PlayEndCreditsMusic.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ ns: AUDIO

```c
// 0xCD536C4D33DCC900 0x8E88B3CC
void PLAY_END_CREDITS_MUSIC(BOOL play);
void PLAY_END_CREDITS_MUSIC(BOOL bActive);
```
## Parameters
* **play**:
* **bActive**:
96 changes: 43 additions & 53 deletions AUDIO/PlayPain.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,65 +5,55 @@ ns: AUDIO

```c
// 0xBC9AE166038A5CEC 0x874BD6CB
void PLAY_PAIN(Ped ped, int painID, int p1);
void PLAY_PAIN(Ped ped, int damageReason, cs_type(int) float rawDamage);
```
**Warning**:
This native had a 4th parameter added in newer game builds
`syncOverNetwork` creates a `CPedPlayPainEvent` when set to true, by default this variable is false.
Parameters are wrong after painID. To preserve C-Sharp backwards compatibility, we can't add or remove parameters.
Correct parameters should be:
`PLAY_PAIN(Ped ped, int painID, float p3, bool createNetEvent)`
Check the *examples* section for the correct usage of this native.
**Description:**
Plays a pain sound. A maximum of 33 pain IDs are allowed.
`createNetEvent` creates a `CPedPlayPainEvent` when set to true.
Below is a list of all the pain IDs (Asterisks indicate that sounds can play in a Low, Medium or High fashion), for example: `PAIN_LOW_GENERIC`. The corresponding pain strings belong to the game exe.
**Pain IDs:**
- 0: PAIN_*_GENERIC (Low, Medium, High)
- 1: UNUSED
- 2: UNUSED
- 3: SCREAM_PANIC (Nothing can be heard)
- 4: SCREAM_PANIC_SHORT
- 5: SCREAM_SCARED
- 6: SCREAM_SHOCKED
- 7: SCREAM_TERROR
- 8: ON_FIRE
- 9: UNUSED
- 10: UNUSED
- 11: INHALE (Nothing can be heard)
- 12: EXHALE (Nothing can be heard)
- 13: DEATH_HIGH_SHORT
- 14: UNUSED
- 15: PAIN_HIGH_GENERIC
- 16: PAIN_*_GENERIC (Low, Medium, High)
- 17: PAIN_SHOVE
- 18: PAIN_WHEEZE
- 19: COUGH
- 20: PAIN_TAZER
- 21: UNUSED
- 22: CLIMB_LARGE (Nothing can be heard)
- 23: CLIMB_SMALL (Nothing can be heard)
- 24: JUMP (Nothing can be heard)
- 25: COWER
- 26: WHIMPER
- 27: DYING_MOAN
- 28: EXHALE_CYCLING (Nothing can be heard)
- 29: PAIN_RAPIDS (Nothing can be heard)
- 30: SNEEZE
- 31: MELEE_SMALL_GRUNT (Nothing can be heard)
- 32: MELEE_LARGE_GRUNT (Nothing can be heard)
- 33: PAIN_*_GENERIC (Low, Medium, High)
```c
enum eAudDamageReason {
AUD_DAMAGE_REASON_DEFAULT = 0,
AUD_DAMAGE_REASON_FALLING = 1,
AUD_DAMAGE_REASON_SUPER_FALLING = 2,
AUD_DAMAGE_REASON_SCREAM_PANIC = 3,
AUD_DAMAGE_REASON_SCREAM_PANIC_SHORT = 4,
AUD_DAMAGE_REASON_SCREAM_SCARED = 5,
AUD_DAMAGE_REASON_SCREAM_SHOCKED = 6,
AUD_DAMAGE_REASON_SCREAM_TERROR = 7,
AUD_DAMAGE_REASON_ON_FIRE = 8,
AUD_DAMAGE_REASON_DROWNING = 9,
AUD_DAMAGE_REASON_SURFACE_DROWNING = 10, // drowning on the surface of water, after we time out
AUD_DAMAGE_REASON_INHALE = 11,
AUD_DAMAGE_REASON_EXHALE = 12,
AUD_DAMAGE_REASON_POST_FALL_GRUNT = 13,
AUD_DAMAGE_REASON_ENTERING_RAGDOLL_DEATH = 14,
AUD_DAMAGE_REASON_EXPLOSION = 15,
AUD_DAMAGE_REASON_MELEE = 16,
AUD_DAMAGE_REASON_SHOVE = 17,
AUD_DAMAGE_REASON_WHEEZE = 18,
AUD_DAMAGE_REASON_COUGH = 19,
AUD_DAMAGE_REASON_TAZER = 20,
AUD_DAMAGE_REASON_EXHAUSTION = 21,
AUD_DAMAGE_REASON_CLIMB_LARGE = 22,
AUD_DAMAGE_REASON_CLIMB_SMALL = 23,
AUD_DAMAGE_REASON_JUMP = 24,
AUD_DAMAGE_REASON_COWER = 25,
AUD_DAMAGE_REASON_WHIMPER = 26,
AUD_DAMAGE_REASON_DYING_MOAN = 27,
AUD_DAMAGE_REASON_CYCLING_EXHALE = 28,
AUD_DAMAGE_REASON_PAIN_RAPIDS = 29,
AUD_DAMAGE_REASON_SNEEZE = 30,
AUD_DAMAGE_REASON_MELEE_SMALL_GRUNT = 31,
AUD_DAMAGE_REASON_MELEE_LARGE_GRUNT = 32,
AUD_DAMAGE_REASON_POST_FALL_GRUNT_LOW = 33
}
```

## Parameters
* **ped**: The ped entity.
* **painID**: The pain id, max allowed id is 33.
* **damageReason**: The damage reason/type, refer to eAudDamageReason
* **rawDamage**: Damage value, defaults to 0.0

## Examples
```lua
Expand Down

0 comments on commit b34658b

Please sign in to comment.