Skip to content

Commit

Permalink
Code consistency, fixes, etc (#1194)
Browse files Browse the repository at this point in the history
* tweak: list every enum value

- these are meant to be easily copy/pastable, given that Lua doesn't have an `enum` type we should include every enum value so that all they have to do is convert it to a table

* tweak: keep enum naming consistent, make sure language type is set, put comments on line before

- this improves readability when scrolling through the docs, some enums need to scroll horizontal this will hopefully make this less common

* tweak(entity): cleanup some of the APPLY_FORCE native docs

* tweak(entity): convert rotation order to an enum

* tweak(fire): update explosion eExplosionTag to known names

* tweak(misc): cleanup native docs, point to ENABLE_DISPATCH_SERVICE for dispatch types

* tweak(ped): refer APPLY_PED_DAMAGE_DECAL to GET_PED_DECORATION_ZONE_FROM_HASHES for the zones

* tweak(shapetest): change 'flags' to 'traceFlags'

* tweak(vehicle): update enum with known types

* fix(ped): fix oversight with enums not being properly formatted

- fixes wrong enum formatting that was introduced in 8e5c126 and was missed in review
  • Loading branch information
AvarianKnight authored Sep 22, 2024
1 parent 5d90f60 commit 9690545
Show file tree
Hide file tree
Showing 48 changed files with 945 additions and 887 deletions.
12 changes: 6 additions & 6 deletions AUDIO/PlayAnimalVocalization.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ void PLAY_ANIMAL_VOCALIZATION(Ped pedHandle, int animalType, char* speechName);
```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
AUD_ANIMAL_BOAR = 0,
AUD_ANIMAL_CHICKEN = 1,
AUD_ANIMAL_DOG = 2,
AUD_ANIMAL_DOG_ROTTWEILER = 3,
AUD_ANIMAL_HORSE = 4,
AUD_NUM_ANIMALS = 5
}
```

Expand Down
8 changes: 4 additions & 4 deletions AUDIO/SetAnimalMood.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ void SET_ANIMAL_MOOD(Ped animal, int mood);
```c
enum eAudAnimalMood {
AUD_ANIMAL_MOOD_ANGRY,
AUD_ANIMAL_MOOD_PLAYFUL,
AUD_ANIMAL_MOOD_ANGRY = 0,
AUD_ANIMAL_MOOD_PLAYFUL = 1,
AUD_ANIMAL_MOOD_NUM_MOODS
AUD_ANIMAL_MOOD_NUM_MOODS = 2
}
```


## Parameters
* **animal**:
* **mood**: Refer to eAudAnimalMood
* **mood**: Refer to `eAudAnimalMood`

2 changes: 1 addition & 1 deletion AUDIO/SetAudioSpecialEffectMode.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ void SET_AUDIO_SPECIAL_EFFECT_MODE(int mode);
Needs to be called every frame.
```c
enum audSpecialEffectMode
enum eAudSpecialEffectMode
{
kSpecialEffectModeNormal = 0,
kSpecialEffectModeUnderwater = 1,
Expand Down
2 changes: 1 addition & 1 deletion CAM/GetCamActiveViewModeContext.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ int _GET_CAM_ACTIVE_VIEW_MODE_CONTEXT();
Enumerated type defined in camControlHelperMetadataViewModes:

```c
enum Context {
enum eContext {
ON_FOOT = 0, // [G|S]ET_FOLLOW_PED_CAM_*
IN_VEHICLE = 1, // [G|S]ET_FOLLOW_VEHICLE_CAM_*
ON_BIKE = 2,
Expand Down
2 changes: 1 addition & 1 deletion CAM/GetFollowPedCamViewMode.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ int GET_FOLLOW_PED_CAM_VIEW_MODE();

```c
// view mode enumeration
enum _0xA11D7CA8
enum eCamViewMode
{
THIRD_PERSON_NEAR = 0,
THIRD_PERSON_MEDIUM = 1,
Expand Down
56 changes: 30 additions & 26 deletions CAM/StopRenderingScriptCamsUsingCatchUp.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,36 @@ enum eRenderingOptionFlags {

```c
enum eCamSplineSmoothingFlags {
CAM_SPLINE_NO_SMOOTH = 0, // No smoothing just moves at a constant rate
CAM_SPLINE_SLOW_IN_SMOOTH = 1, // Decelerates when approaching a node
CAM_SPLINE_SLOW_OUT_SMOOTH = 2, // Accelerates slowly when leaving a node
CAM_SPLINE_SLOW_IN_OUT_SMOOTH = 3, // Decelerates when approaching a node and accelerates slowly when leaving a node
CAM_SPLINE_VERY_SLOW_IN = 4,
CAM_SPLINE_VERY_SLOW_OUT = 5,
CAM_SPLINE_VERY_SLOW_IN_SLOW_OUT = 6,
CAM_SPLINE_SLOW_IN_VERY_SLOW_OUT = 7,
CAM_SPLINE_VERY_SLOW_IN_VERY_SLOW_OUT = 8,
CAM_SPLINE_EASE_IN = 9,
CAM_SPLINE_EASE_OUT = 10,
CAM_SPLINE_QUADRATIC_EASE_IN = 11,
CAM_SPLINE_QUADRATIC_EASE_OUT = 12,
CAM_SPLINE_QUADRATIC_EASE_IN_OUT = 13,
CAM_SPLINE_CUBIC_EASE_IN = 14,
CAM_SPLINE_CUBIC_EASE_OUT = 15,
CAM_SPLINE_CUBIC_EASE_IN_OUT = 16,
CAM_SPLINE_QUARTIC_EASE_IN = 17,
CAM_SPLINE_QUARTIC_EASE_OUT = 18,
CAM_SPLINE_QUARTIC_EASE_IN_OUT = 19,
CAM_SPLINE_QUINTIC_EASE_IN = 20,
CAM_SPLINE_QUINTIC_EASE_OUT = 21,
CAM_SPLINE_QUINTIC_EASE_IN_OUT = 22,
CAM_SPLINE_CIRCULAR_EASE_IN = 23,
CAM_SPLINE_CIRCULAR_EASE_OUT = 24,
CAM_SPLINE_CIRCULAR_EASE_IN_OUT = 25
// No smoothing just moves at a constant rate
CAM_SPLINE_NO_SMOOTH = 0,
// Decelerates when approaching a node
CAM_SPLINE_SLOW_IN_SMOOTH = 1,
// Accelerates slowly when leaving a node
CAM_SPLINE_SLOW_OUT_SMOOTH = 2,
// Decelerates when approaching a node and accelerates slowly when leaving a node
CAM_SPLINE_SLOW_IN_OUT_SMOOTH = 3,
CAM_SPLINE_VERY_SLOW_IN = 4,
CAM_SPLINE_VERY_SLOW_OUT = 5,
CAM_SPLINE_VERY_SLOW_IN_SLOW_OUT = 6,
CAM_SPLINE_SLOW_IN_VERY_SLOW_OUT = 7,
CAM_SPLINE_VERY_SLOW_IN_VERY_SLOW_OUT = 8,
CAM_SPLINE_EASE_IN = 9,
CAM_SPLINE_EASE_OUT = 10,
CAM_SPLINE_QUADRATIC_EASE_IN = 11,
CAM_SPLINE_QUADRATIC_EASE_OUT = 12,
CAM_SPLINE_QUADRATIC_EASE_IN_OUT = 13,
CAM_SPLINE_CUBIC_EASE_IN = 14,
CAM_SPLINE_CUBIC_EASE_OUT = 15,
CAM_SPLINE_CUBIC_EASE_IN_OUT = 16,
CAM_SPLINE_QUARTIC_EASE_IN = 17,
CAM_SPLINE_QUARTIC_EASE_OUT = 18,
CAM_SPLINE_QUARTIC_EASE_IN_OUT = 19,
CAM_SPLINE_QUINTIC_EASE_IN = 20,
CAM_SPLINE_QUINTIC_EASE_OUT = 21,
CAM_SPLINE_QUINTIC_EASE_IN_OUT = 22,
CAM_SPLINE_CIRCULAR_EASE_IN = 23,
CAM_SPLINE_CIRCULAR_EASE_OUT = 24,
CAM_SPLINE_CIRCULAR_EASE_IN_OUT = 25
};
```

Expand Down
6 changes: 2 additions & 4 deletions DECORATOR/DecorRegister.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@ ns: DECORATOR
void DECOR_REGISTER(char* propertyName, int type);
```
Decor types:
```
```c
enum eDecorType
{
DECOR_TYPE_FLOAT = 1,
DECOR_TYPE_BOOL = 2,
DECOR_TYPE_INT = 3,
DECOR_TYPE_UNK = 4,
DECOR_TYPE_STRING = 4,
DECOR_TYPE_TIME = 5
};
```
Expand Down
8 changes: 3 additions & 5 deletions ENTITY/ApplyForceToEntity.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ void APPLY_FORCE_TO_ENTITY(Entity entity, int forceType, float x, float y, float
Applies a force to the specified entity.
**List of force types (p1)**:
```
public enum ForceType
```c
enum eForceType
{
MinForce = 0,
MaxForceRot = 1,
Expand All @@ -29,7 +27,7 @@ Research/documentation on the gtaforums can be found [here](https://gtaforums.co

## Parameters
* **entity**: The entity you want to apply a force on
* **forceType**: See native description above for a list of commonly used values
* **forceType**: Refer to `eForceType`
* **x**: Force amount (X)
* **y**: Force amount (Y)
* **z**: Force amount (Z)
Expand Down
19 changes: 1 addition & 18 deletions ENTITY/ApplyForceToEntityCenterOfMass.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,9 @@ ns: ENTITY
void APPLY_FORCE_TO_ENTITY_CENTER_OF_MASS(Entity entity, int forceType, float x, float y, float z, BOOL p5, BOOL isDirectionRel, BOOL isForceRel, BOOL p8);
```
```
Applies a force to the specified entity.
**List of force types (p1)**:
public enum ForceType
{
MinForce = 0,
MaxForceRot = 1,
MinForce2 = 2,
MaxForceRot2 = 3,
ForceNoRot = 4,
ForceRotPlusForce = 5
}
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/.
p6/relative - makes the xyz force not relative to world coords, but to something else
p7/highForce - setting false will make the force really low
```
## Parameters
* **entity**:
* **forceType**:
* **forceType**: Refer to [APPLY_FORCE_TO_ENTITY](#_0xC5F68BE9613E2D18)
* **x**:
* **y**:
* **z**:
Expand Down
30 changes: 16 additions & 14 deletions ENTITY/GetEntityRotation.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,31 @@ ns: ENTITY
Vector3 GET_ENTITY_ROTATION(Entity entity, int rotationOrder);
```
```
rotationOrder refers to the order yaw pitch roll is applied; value ranges from 0 to 5 and is usually *2* in scripts.
**NOTE**: What you use for rotationOrder when getting must be the same as rotationOrder when setting the rotation.
What you use for rotationOrder when getting must be the same as rotationOrder when setting the rotation.
What it returns is the yaw on the z part of the vector, which makes sense considering R* considers z as vertical. Here's a picture for those of you who don't understand pitch, yaw, and roll:
www.allstar.fiu.edu/aero/images/pic5-1.gif
```c
enum eRotationOrder {
// Rotate around the z-axis, then the y-axis and finally the x-axis.
ROT_ZYX = 0,
// Rotate around the y-axis, then the z-axis and finally the x-axis.
ROT_YZX = 1,
// Rotate around the z-axis, then the x-axis and finally the y-axis.
ROT_ZXY = 2,
// Rotate around the x-axis, then the z-axis and finally the y-axis.
ROT_XZY = 3,
// Rotate around the y-axis, then the x-axis and finally the z-axis.
ROT_YXZ = 4,
// Rotate around the x-axis, then the y-axis and finally the z-axis.
ROT_XYZ = 5,
}
```

### Rotation Orders
* **0**: ZYX - Rotate around the z-axis, then the y-axis and finally the x-axis.
* **1**: YZX - Rotate around the y-axis, then the z-axis and finally the x-axis.
* **2**: ZXY - Rotate around the z-axis, then the x-axis and finally the y-axis.
* **3**: XZY - Rotate around the x-axis, then the z-axis and finally the y-axis.
* **4**: YXZ - Rotate around the y-axis, then the x-axis and finally the z-axis.
* **5**: XYZ - Rotate around the x-axis, then the y-axis and finally the z-axis.
## Parameters
* **entity**: The entity to get the rotation for.
* **rotationOrder**: The order yaw, pitch and roll is applied. Usually 2.

## Return value
A vector where the Z coordinate is the yaw.

## Examples
Expand Down
Loading

0 comments on commit 9690545

Please sign in to comment.