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

Updated lots of natives #1221

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
6 changes: 4 additions & 2 deletions AUDIO/PlaySoundFrontend.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ ns: AUDIO

```c
// 0x67C540AA08E4A6F5 0x2E458F74
void PLAY_SOUND_FRONTEND(int soundId, char* audioName, char* audioRef, BOOL p3);
void PLAY_SOUND_FRONTEND(int soundId, char* audioName, char* audioRef, BOOL enableOnReplay);
```

Plays back a sound "frontend" - at full volume, panned centrally. Optionally can specify a sound set which contains the sound.

```
List: https://pastebin.com/DCeRiaLJ
All occurrences as of Cayo Perico Heist DLC (b2189), sorted alphabetically and identical lines removed: https://git.io/JtLxM
Expand All @@ -17,5 +19,5 @@ All occurrences as of Cayo Perico Heist DLC (b2189), sorted alphabetically and i
* **soundId**:
* **audioName**:
* **audioRef**:
* **p3**:
* **enableOnReplay**:

184 changes: 73 additions & 111 deletions AUDIO/SetAudioFlag.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,123 +5,85 @@ ns: AUDIO

```c
// 0xB9EFD5C25018725A 0x1C09C9E0
void SET_AUDIO_FLAG(char* flagName, BOOL toggle);
void SET_AUDIO_FLAG(char* flagName, BOOL enabled);
```

Generic interface to toggle audio functionality, with auto-reset on script termination and support for multiple script threads

Flags used in game scripts:
| Flag Name | Description of Usage |
| ----- | -------- |
| ActivateSwitchWheelAudio | |
| AllowAmbientSpeechInSlowMo | |
| AllowCutsceneOverScreenFade | |
| AllowForceRadioAfterRetune | |
| AllowPainAndAmbientSpeechToPlayDuringCutscene | |
| AllowPlayerAIOnMission | |
| AllowPoliceScannerWhenPlayerHasNoControl | |
| AllowRadioDuringSwitch | |
| AllowRadioOverScreenFade | |
| AllowScoreAndRadio | |
| AllowScriptedSpeechInSlowMo | |
| AvoidMissionCompleteDelay | |
| DisableAbortConversationForDeathAndInjury | |
| DisableAbortConversationForRagdoll | |
| DisableBarks | |
| DisableFlightMusic | |
| DisableNPCHeadsetSpeechAttenuation | |
| DisableReplayScriptStreamRecording | |
| EnableHeadsetBeep | |
| EnableMissileLockWarningForAllVehicles | |
| ForceConversationInterrupt | |
| ForceSeamlessRadioSwitch | |
| ForceSniperAudio | |
| FrontendRadioDisabled | |
| HoldMissionCompleteWhenPrepared | |
| IsDirectorModeActive | Allows you to play speech infinitely without any pauses like in Director Mode. |
| IsPlayerOnMissionForSpeech | |
| ListenerReverbDisabled | |
| LoadMPData | |
| MobileRadioInGame | |
| OnlyAllowScriptTriggerPoliceScanner | |
| PlayerOnDLCHeist4Island | |
| PlayMenuMusic | |
| PoliceScannerDisabled | |
| ScriptedConvListenerMaySpeak | |
| SpeechDucksScore | |
| SuppressPlayerScubaBreathing | |
| UseQuietSceneSoftVersion | |
| WantedMusicDisabled | |
| WantedMusicOnMission | |

```
All flag IDs and hashes:
ID: 01 | Hash: 0x20A7858F
ID: 02 | Hash: 0xA11C2259
ID: 03 | Hash: 0x08DE4700
ID: 04 | Hash: 0x989F652F
ID: 05 | Hash: 0x3C9E76BA
ID: 06 | Hash: 0xA805FEB0
ID: 07 | Hash: 0x4B94EA26
ID: 08 | Hash: 0x803ACD34
ID: 09 | Hash: 0x7C741226
ID: 10 | Hash: 0x31DB9EBD
ID: 11 | Hash: 0xDF386F18
ID: 12 | Hash: 0x669CED42
ID: 13 | Hash: 0x51F22743
ID: 14 | Hash: 0x2052B35C
ID: 15 | Hash: 0x071472DC
ID: 16 | Hash: 0xF9928BCC
ID: 17 | Hash: 0x7ADBDD48
ID: 18 | Hash: 0xA959BA1A
ID: 19 | Hash: 0xBBE89B60
ID: 20 | Hash: 0x87A08871
ID: 21 | Hash: 0xED1057CE
ID: 22 | Hash: 0x1584AD7A
ID: 23 | Hash: 0x8582CFCB
ID: 24 | Hash: 0x7E5E2FB0
ID: 25 | Hash: 0xAE4F72DB
ID: 26 | Hash: 0x5D16D1FA
ID: 27 | Hash: 0x06B2F4B8
ID: 28 | Hash: 0x5D4CDC96
ID: 29 | Hash: 0x8B5A48BA
ID: 30 | Hash: 0x98FBD539
ID: 31 | Hash: 0xD8CB0473
ID: 32 | Hash: 0x5CBB4874
ID: 33 | Hash: 0x2E9F93A9
ID: 34 | Hash: 0xD93BEA86
ID: 35 | Hash: 0x92109B7D
ID: 36 | Hash: 0xB7EC9E4D
ID: 37 | Hash: 0xCABDBB1D
ID: 38 | Hash: 0xB3FD4A52
ID: 39 | Hash: 0x370D94E5
ID: 40 | Hash: 0xA0F7938F
ID: 41 | Hash: 0xCBE1CE81
ID: 42 | Hash: 0xC27F1271
ID: 43 | Hash: 0x9E3258EB
ID: 44 | Hash: 0x551CDA5B
ID: 45 | Hash: 0xCB6D663C
ID: 46 | Hash: 0x7DACE87F
ID: 47 | Hash: 0xF9DE416F
ID: 48 | Hash: 0x882E6E9E
ID: 49 | Hash: 0x16B447E7
ID: 50 | Hash: 0xBD867739
ID: 51 | Hash: 0xA3A58604
ID: 52 | Hash: 0x7E046BBC
ID: 53 | Hash: 0xD95FDB98
ID: 54 | Hash: 0x5842C0ED
ID: 55 | Hash: 0x285FECC6
ID: 56 | Hash: 0x9351AC43
ID: 57 | Hash: 0x50032E75
ID: 58 | Hash: 0xAE6D0D59
ID: 59 | Hash: 0xD6351785
ID: 60 | Hash: 0xD25D71BC
ID: 61 | Hash: 0x1F7F6423
ID: 62 | Hash: 0xE24C3AA6
ID: 63 | Hash: 0xBFFDD2B7
All flag names and hashes:
Name: RadioOverlapDisabled | Hash: 0xFED7A7F
Name: AggressiveHorns | Hash: 0x20A7858F
Name: CarsStartFirstTime | Hash: 0xA11C2259
Name: BoostPlayerCarVolume | Hash: 0x8DE4700
Name: UserRadioControlDisabled | Hash: 0x989F652F
Name: FrontendRadioDisabled | Hash: 0x3C9E76BA
Name: MobileRadioInGame | Hash: 0xA805FEB0
Name: ForceSeamlessRadioSwitch | Hash: 0x4B94EA26
Name: AllowScoreAndRadio | Hash: 0x803ACD34
Name: PoliceScannerDisabled | Hash: 0x7C741226
Name: OnlyAllowScriptTriggerPoliceScanner | Hash: 0x31DB9EBD
Name: AllowPoliceScannerWhenPlayerHasNoControl | Hash: 0xDF386F18
Name: DisableAbortConversationForRagdoll | Hash: 0x669CED42
Name: DisableAbortConversationForOnFire | Hash: 0x51F22743
Name: DisableAbortConversationForDeathAndInjury | Hash: 0x2052B35C
Name: LimitAmbientRadioStations | Hash: 0x71472DC
Name: SpeechDucksScore | Hash: 0xF9928BCC
Name: ListenerReverbDisabled | Hash: 0x7ADBDD48
Name: ScriptedSpeechDuckingDisabled | Hash: 0xA959BA1A
Name: ScriptedConvListenerMaySpeak | Hash: 0xBBE89B60
Name: OnlyAllowCombatSay | Hash: 0x87A08871
Name: AllowPlayerAIOnMission | Hash: 0xED1057CE
Name: AllowBuddyAIOnMission | Hash: 0x1584AD7A
Name: GroupShootout | Hash: 0x8582cfcb
Name: TrevorRageIsOverriden | Hash: 0x7E5E2FB0
Name: UnderWaterStreamOverriden | Hash: 0xAE4F72DB
Name: WantedMusicDisabled | Hash: 0x5D16D1FA
Name: DisablePlayerBreathing | Hash: 0x6B2F4B8
Name: WantedMusicOnMission | Hash: 0x5D4CDC96
Name: DisableSniperAudio | Hash: 0x8B5A48BA
Name: ForceSniperAudio | Hash: 0x98FBD539
Name: OverridePlayerGroundMaterial | Hash: 0xD8CB0473
Name: ScriptForceMicPosition | Hash: 0x5CBB4874
Name: ScriptForceGunfightConductorIntensity | Hash: 0x2E9F93A9
Name: DisableFlightMusic | Hash: 0xD93BEA86
Name: DoNotBlipScriptedSpeech | Hash: 0x92109B7D
Name: DisableBarks | Hash: 0xB7EC9E4D
Name: RepeatLineForRagdolling | Hash: 0xCABDBB1D
Name: DontRepeatLineForPlayerRagdolling | Hash: 0xB3FD4A52
Name: OverrideElevationWind | Hash: 0x370D94E5
Name: HoldMissionCompleteWhenPrepared | Hash: 0xA0F7938F
Name: AvoidMissionCompleteDelay | Hash: 0xCBE1CE81
Name: AllowScriptedSpeechInSlowMo | Hash: 0xC27F1271
Name: ActivateSwitchWheelAudio | Hash: 0x9E3258EB
Name: AllowAmbientSpeechInSlowMo | Hash: 0x551CDA5B
Name: AllowRadioOverScreenFade | Hash: 0xCB6D663C
Name: ScriptPlayingDistantSiren | Hash: 0x7DACE87F
Name: AllowRadioDuringSwitch | Hash: 0xF9DE416F
Name: LoadMPData | Hash: 0x882E6E9E
Name: UseQuietSceneSoftVersion | Hash: 0x16B447E7
Name: PlayMenuMusic | Hash: 0xBD867739
Name: OverrideMicrophoneSettings | Hash: 0xA3A58604
Name: SuppressPlayerScubaBreathing | Hash: 0x7E046BBC
Name: IsPlayerOnMissionForSpeech | Hash: 0xD95FDB98
Name: AllowPainAndAmbientSpeechToPlayDuringCutscene | Hash: 0x5842C0ED
Name: ForceConversationInterrupt | Hash: 0x285FECC6
Name: DisableReplayScriptStreamRecording | Hash: 0x9351AC43
Name: DisableReplayScriptFrontendStreamRecording | Hash:0x50032E75
Name: AllowForceRadioAfterRetune | Hash: 0xAE6D0D59
Name: IsDirectorModeActive | Hash: 0xD6351785
Name: EnableHeadsetBeep | Hash: 0xD25D71BC
Name: DisableHeadsetOnBeep | Hash: 0x1F7F6423
Name: DisableHeadsetOffBeep | Hash: 0xE24C3AA6
Name: AllowCutsceneOverScreenFade | Hash: 0xBFFDD2B7
Name: SuppressRadioSwitchBeep | Hash: 0x3FCC2ABF
Name: EnableGameplayCriticalMusicEmitters | Hash: 0x2EB25AD0
Name: EnableMissileLockWarningForAllVehicles | Hash: 0x2B56D9D0
Name: PlayerOnDLCHeist4Island | Hash: 0xAE6A6DE9
Name: DisableNPCHeadsetSpeechAttenuation | Hash: 0x49D479E5
```

## Parameters
* **flagName**:
* **toggle**:
* **flagName**: name of the flag
* **enabled**: whether flag is enabler or not

13 changes: 6 additions & 7 deletions DECORATOR/DecorSetInt.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@ ns: DECORATOR

```c
// 0x0CE3AA5E1CA19E10 0xDB718B21
BOOL DECOR_SET_INT(Entity entity, char* propertyName, int value);
BOOL DECOR_SET_INT(Entity entity, char* decoratorName, int value);
```

```
Sets property to int.
```
Add or update a INT decorator on an object

## Parameters
* **entity**:
* **propertyName**:
* **value**:
* **entity**: entity to modify decorators on
* **decoratorName**: name of the decorator
* **value**: value of the decorator

## Return value
Returns `true` if completed successfully, `false` otherwise
66 changes: 47 additions & 19 deletions ENTITY/ApplyForceToEntity.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ns: ENTITY

```c
// 0xC5F68BE9613E2D18 0xC1C0855A
void APPLY_FORCE_TO_ENTITY(Entity entity, int forceType, float x, float y, float z, float offX, float offY, float offZ, int boneIndex, BOOL isDirectionRel, BOOL ignoreUpVec, BOOL isForceRel, BOOL p12, BOOL p13);
void APPLY_FORCE_TO_ENTITY(Entity entity, int forceType, float x, float y, float z, float offX, float offY, float offZ, int component, BOOL localForce, BOOL localOffset, BOOL scaleByMass, BOOL triggerAudio, BOOL scaleByTimeWarp);
```

Applies a force to the specified entity.
Expand All @@ -20,6 +20,33 @@ enum eForceType
ForceNoRot = 4,
ForceRotPlusForce = 5
}

enum eRagdollComponent
{
RAGDOLL_INVALID = -1, // Invalid
RAGDOLL_BUTTOCKS = 0, // Buttocks
RAGDOLL_THIGH_LEFT = 1, // Thigh_Left
RAGDOLL_SHIN_LEFT = 2, // Shin_Left
RAGDOLL_FOOT_LEFT = 3, // Foot_Left
RAGDOLL_THIGH_RIGHT = 4, // Thigh_Right
RAGDOLL_SHIN_RIGHT = 5, // Shin_Right
RAGDOLL_FOOT_RIGHT = 6, // Foot_Right
RAGDOLL_SPINE0 = 7, // Spine0
RAGDOLL_SPINE1 = 8, // Spine1
RAGDOLL_SPINE2 = 9, // Spine2
RAGDOLL_SPINE3 = 10, // Spine3
RAGDOLL_CLAVICLE_LEFT = 11, // Clavicle_Left
RAGDOLL_UPPER_ARM_LEFT = 12, // Upper_Arm_Left
RAGDOLL_LOWER_ARM_LEFT = 13, // Lower_Arm_Left
RAGDOLL_HAND_LEFT = 14, // Hand_Left
RAGDOLL_CLAVICLE_RIGHT = 15, // Clavicle_Right
RAGDOLL_UPPER_ARM_RIGHT = 16, // Upper_Arm_Right
RAGDOLL_LOWER_ARM_RIGHT = 17, // Lower_Arm_Right
RAGDOLL_HAND_RIGHT = 18, // Hand_Right
RAGDOLL_NECK = 19, // Neck
RAGDOLL_HEAD = 20 // Head
}

```

Research/documentation on the gtaforums can be found [here](https://gtaforums.com/topic/885669-precisely-define-object-physics/) and [here](https://gtaforums.com/topic/887362-apply-forces-and-momentums-to-entityobject/).
Expand All @@ -34,12 +61,13 @@ Research/documentation on the gtaforums can be found [here](https://gtaforums.co
* **offX**: Rotation/offset force (X)
* **offY**: Rotation/offset force (Y)
* **offZ**: Rotation/offset force (Z)
* **boneIndex**: (Often 0) Entity bone index
* **isDirectionRel**: (Usually false) Vector defined in local (body-fixed) coordinate frame
* **ignoreUpVec**: (Usually true)
* **isForceRel**: (Usually true) When true, force gets multiplied with the objects mass and different objects will have the same acceleration
* **p12**: (Usually false)
* **p13**: (Usually true)
* **component**: Component of the entity to apply the force too - only matters for breakable or articulated (ragdoll) physics. 0 means the root or parent component. Reger to `eRagdollComponent` enum
If the command is being called on a ped, the component passed in is one returned from GET_PED_RAGDOLL_BONE_INDEX, not GET_PED_BONE_INDEX
* **localForce**: Specifies whether the force vector passed in is in local or world coordinates. Local coordinates (TRUE) means the force will get automatically transformed into world space before being applied.
* **localOffset**: Specifies whether the offset passed in is in local or world coordinates.
* **scaleByMass**: When true, force gets multiplied with the objects mass and different objects will have the same acceleration
* **triggerAudio**: Specifies whether to play audio events related to the force being applied. The audio will depend on the entity type. Currently vehicles are the only entity types supported, and will play a suspension squeal depending on the magnitude of the force
* **scaleByTimeWarp**: (Usually true)


## Examples
Expand All @@ -58,23 +86,23 @@ local forceType = forceTypes.MaxForceRot2
-- sends the entity straight up into the sky:
local direction = vector3(0.0, 0.0, 15.0)
local rotation = vector3(0.0, 0.0, 0.0)
local boneIndex = 0
local isDirectionRel = false
local ignoreUpVec = true
local isForceRel = true
local p12 = false
local p13 = true
local component = 0
local localForce = false
local localOffset = true
local scaleByMass = true
local triggerAudio = false
local scaleByTimeWarp = true

ApplyForceToEntity(
entity,
forceType,
direction,
rotation,
boneIndex,
isDirectionRel,
ignoreUpVec,
isForceRel,
p12,
p13
component,
localForce,
localOffset,
scaleByMass,
triggerAudio,
scaleByTimeWarp
)
```
40 changes: 17 additions & 23 deletions ENTITY/AttachEntityToEntityPhysically.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,30 @@ ns: ENTITY

```c
// 0xC3675780C92F90F9 0x0547417F
void ATTACH_ENTITY_TO_ENTITY_PHYSICALLY(Entity entity1, Entity entity2, int boneIndex1, int boneIndex2, float xPos1, float yPos1, float zPos1, float xPos2, float yPos2, float zPos2, float xRot, float yRot, float zRot, float breakForce, BOOL fixedRot, BOOL p15, BOOL collision, BOOL teleport, int p18);
void ATTACH_ENTITY_TO_ENTITY_PHYSICALLY(Entity entity1, Entity entity2, int boneIndex1, int boneIndex2, float xPos1, float yPos1, float zPos1, float xPos2, float yPos2, float zPos2, float xRot, float yRot, float zRot, float physicalStrength, BOOL constrainRotation, BOOL doInitialWarp, BOOL collision, BOOL addInitialSeperation, int rotOrder);
```

```
breakForce is the amount of force required to break the bond.
p14 - is always 1 in scripts
p15 - is 1 or 0 in scripts - unknown what it does
p16 - controls collision between the two entities (FALSE disables collision).
p17 - do not teleport entity to be attached to the position of the bone Index of the target entity (if 1, entity will not be teleported to target bone)
p18 - is always 2 in scripts.
```
Attaches an entity to another entity using a physical attachment


## Parameters
* **entity1**:
* **entity2**:
* **boneIndex1**:
* **boneIndex2**:
* **xPos1**:
* **yPos1**:
* **zPos1**:
* **xPos2**:
* **yPos2**:
* **zPos2**:
* **boneIndex1**: refers to the bone on the first entity which is being attached
* **boneIndex2**: refers to the bone on the second entity that you're attaching the first entity to
* **xPos1**: the x offset from the root of the bone on the the first entity
* **yPos1**: the y offset from the root of the bone on the the first entity
* **zPos1**: the z offset from the root of the bone on the the first entity
* **xPos2**: the x offset from the root of the bone on the the second entity
* **yPos2**: the y offset from the root of the bone on the the second entity
* **zPos2**: the z offset from the root of the bone on the the second entity
* **xRot**:
* **yRot**:
* **zRot**:
* **breakForce**:
* **fixedRot**:
* **p15**:
* **collision**:
* **teleport**:
* **p18**:
* **physicalStrength**:
* **constrainRotation**: specifies whether you wish to constrain rotation as well as position. usually yes, unless you want to have a hanging/swinging thing.
* **doInitialWarp**: specifies whether to warp the object to the specified attach point. If not, then the initial seperation will be used as an allowed give in the attachment (e.g. a rope length)
* **collision**: if set the two entities will collide with each other once attached
* **addInitialSeperation**:
* **rotOrder**: euler order of rotation angles
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* **rotOrder**: euler order of rotation angles
* **rotOrder**: The order in which the rotation is applied. See [`GET_ENTITY_ROTATION`](#_0xAFBD61CC738D9EB9)

To go alongside my suggestion for the enum in this file.


Loading
Loading