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

tweak(docs/native): Update Task Native Enums & Params #1130

Merged
merged 20 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
789e703
tweak(docs/native): Update Other Mission Flags
DonHulieo Jun 12, 2024
48247ea
fix(docs/native): Fix Typos & Add `None` Flag
DonHulieo Jun 12, 2024
d5fec3d
tweak(docs/native): Add Driving Flag Values
DonHulieo Jun 12, 2024
cbfbd48
fix(docs/native): Fix Incorrect Param Name
DonHulieo Jun 12, 2024
d86b73f
tweak(docs/native): Remove Native Doc & Add Lua Ex
DonHulieo Jun 13, 2024
c4429d5
tweak(docs/native): Add Lua Ex & Remove Old Doc
DonHulieo Jun 13, 2024
f2fda71
tweak(docs/native): Comment Consistency
DonHulieo Jun 13, 2024
6d516f1
tweak(docs/native): Remove `cs_type`
DonHulieo Jun 13, 2024
65ef628
tweak(docs/native): Fix `cs_type` Name
DonHulieo Jun 13, 2024
397044e
tweak(docs/native): Add Lua Ex & Remove Old Docs
DonHulieo Jun 13, 2024
a08c6fa
tweak(docs/native): Change Comment Layout
DonHulieo Jun 13, 2024
beef14a
tweak(docs/native): Add Lua Ex & Remove Old Docs
DonHulieo Jun 13, 2024
bf0fb2c
tweak(docs/native): Change Styling to Match PR
DonHulieo Jun 13, 2024
beaec6a
fix(docs/native): Fix Wording for Non-Optional Param
DonHulieo Jun 13, 2024
9bcbced
tweak(docs/native): Update Refs to Driving Style
DonHulieo Jun 13, 2024
fe8b6d8
tweak(docs/native): Update Other Vehicle Missions
DonHulieo Jun 13, 2024
b9a88a3
tweak(docs/native): Change Local Names in Ex
DonHulieo Jun 13, 2024
875c7ff
fix(docs/native): Release Model & Fix Ex Spacing
DonHulieo Jun 13, 2024
462a459
Keep enum names consistent
AvarianKnight Aug 7, 2024
65b9708
Keep enum names consistent
AvarianKnight Aug 7, 2024
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
53 changes: 50 additions & 3 deletions TASK/SetDriveTaskDrivingStyle.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ ns: TASK
void SET_DRIVE_TASK_DRIVING_STYLE(Ped ped, int drivingStyle);
```

Sets the driving style for a ped currently performing a driving task.

```
This native is used to set the driving style for specific ped.
DonHulieo marked this conversation as resolved.
Show resolved Hide resolved
Driving styles id seems to be:
Expand All @@ -17,7 +19,52 @@ Driving styles id seems to be:
http://gtaforums.com/topic/822314-guide-driving-styles/
```

## Parameters
* **ped**:
* **drivingStyle**:
```c
enum VehicleDrivingFlags
AvarianKnight marked this conversation as resolved.
Show resolved Hide resolved
{
None = 0,
StopForVehicles = 1,
StopForPeds = 2,
SwerveAroundAllVehicles = 4,
SteerAroundStationaryVehicles = 8,
SteerAroundPeds = 16,
SteerAroundObjects = 32,
DontSteerAroundPlayerPed = 64,
StopAtTrafficLights = 128,
GoOffRoadWhenAvoiding = 256,
AllowGoingWrongWay = 512,
Reverse = 1024,
UseWanderFallbackInsteadOfStraightLine = 2048,
AvoidRestrictedAreas = 4096,
PreventBackgroundPathfinding = 8192,
AdjustCruiseSpeedBasedOnRoadSpeed = 16384,
UseShortCutLinks = 262144,
ChangeLanesAroundObstructions = 524288,
UseSwitchedOffNodes = 2097152,
PreferNavmeshRoute = 4194304,
PlaneTaxiMode = 8388608,
ForceStraightLine = 16777216,
UseStringPullingAtJunctions = 33554432,
TryToAvoidHighways = 536870912,
ForceJoinInRoadDirection = 1073741824,
StopAtDestination = 2147483648,
// StopForVehicles | StopForPeds | SteerAroundObjects | SteerAroundStationaryVehicles | StopAtTrafficLights | UseShortCutLinks | ChangeLanesAroundObstructions
DrivingModeStopForVehicles = 786603,
// StopForVehicles | StopForPeds | StopAtTrafficLights | UseShortCutLinks
DrivingModeStopForVehiclesStrict = 262275,
// SwerveAroundAllVehicles | SteerAroundObjects | UseShortCutLinks | ChangeLanesAroundObstructions | StopForVehicles
DrivingModeAvoidVehicles = 786469,
// SwerveAroundAllVehicles | SteerAroundObjects | UseShortCutLinks | ChangeLanesAroundObstructions
DrivingModeAvoidVehiclesReckless = 786468,
// StopForVehicles | SteerAroundStationaryVehicles | StopForPeds | SteerAroundObjects | UseShortCutLinks | ChangeLanesAroundObstructions
DrivingModeStopForVehiclesIgnoreLights = 786475,
// SwerveAroundAllVehicles | StopAtTrafficLights | SteerAroundObjects | UseShortCutLinks | ChangeLanesAroundObstructions | StopForVehicles
DrivingModeAvoidVehiclesObeyLights = 786597,
// SwerveAroundAllVehicles | StopAtTrafficLights | StopForPeds | SteerAroundObjects | UseShortCutLinks | ChangeLanesAroundObstructions | StopForVehicles
DrivingModeAvoidVehiclesStopForPedsObeyLights = 786599,
}
```

## Parameters
* **ped**: The ped have their driving style set.
* **drivingStyle**: The driving style to set (see `VehicleDrivingFlags`).
23 changes: 12 additions & 11 deletions TASK/TaskBoatMission.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ns: TASK
void TASK_BOAT_MISSION(Ped ped, Vehicle boat, Vehicle vehicleTarget, Ped pedTarget, float x, float y, float z, int missionType, float speed, int drivingStyle, float radius, int missionFlags);
```

All parameters except driver and boat are optional, with `pedTarget`, `vehicleTarget`, `x`, `y`, `z` being dependent on `missionType` (ie. Attack/Flee mission types require a target ped/vehicle, whereas GoTo mission types require either `x`, `y`, `z` or a target ped/vehicle).
All parameters except ped and boat are optional, with `pedTarget`, `vehicleTarget`, `x`, `y`, `z` being dependent on `missionType` (ie. Attack/Flee mission types require a target ped/vehicle, whereas GoTo mission types require either `x`, `y`, `z` or a target ped/vehicle).

If you don't want to use a parameter; pass `0.0f` for `x`, `y` and `z`, `0` for `pedTarget`, `vehicleTarget` and other int parameters, and `-1.0f` for the remaining float parameters.

Expand All @@ -24,6 +24,7 @@ P8 appears to be driving style flag - see gtaforums.com/topic/822314-guide-drivi
```c
enum BoatMissionFlags
AvarianKnight marked this conversation as resolved.
Show resolved Hide resolved
{
None = 0,
StopAtEnd = 1,
StopAtShore = 2,
AvoidShore = 4,
Expand All @@ -47,13 +48,13 @@ enum BoatMissionFlags
## Parameters
* **ped**: The ped to be tasked.
* **boat**: The boats' entity handle.
* **vehicleTarget**: The target vehicle (default is 0)
* **pedTarget**: The target ped (default is 0)
* **x**: The x coordinate of the target (default is 0.0f)
* **y**: The y coordinate of the target (default is 0.0f)
* **z**: The z coordinate of the target (default is 0.0f)
* **missionType**: The mission type (default is 0)
* **speed**: The speed in m/s (default is -1.0f)
* **drivingStyle**: The driving style (default is 0)
* **radius**: The radius of when the task will be completed (default is -1.0f)
* **missionFlags**: The mission flags (default is 0) (see `BoatMissionFlags`)
* **vehicleTarget**: The target vehicle (default is 0).
* **pedTarget**: The target ped (default is 0).
* **x**: The x coordinate of the target (default is 0.0f).
* **y**: The y coordinate of the target (default is 0.0f).
* **z**: The z coordinate of the target (default is 0.0f).
* **missionType**: The mission type (default is 0).
* **speed**: The speed in m/s (default is -1.0f).
* **drivingStyle**: The driving style (default is 0).
* **radius**: The radius of when the task will be completed (default is -1.0f).
* **missionFlags**: The mission flags (default is 0) (see `BoatMissionFlags`).
AvarianKnight marked this conversation as resolved.
Show resolved Hide resolved
61 changes: 44 additions & 17 deletions TASK/TaskHeliMission.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ ns: TASK

```c
// 0xDAD029E187A2BEB4 0x0C143E97
void TASK_HELI_MISSION(Ped pilot, Vehicle aircraft, Vehicle targetVehicle, Ped targetPed, float destinationX, float destinationY, float destinationZ, int missionFlag, float maxSpeed, float landingRadius, float targetHeading, int unk1, int unk2, cs_type(Hash) float unk3, int landingFlags);
void TASK_HELI_MISSION(Ped ped, Vehicle heli, Vehicle vehicleTarget, Ped pedTarget, float x, float y, float z, int missionType, float speed, float radius, float heading, cs_type(Int) float height, float minHeight, cs_type(Hash) float slowDist, int missionFlags);
DonHulieo marked this conversation as resolved.
Show resolved Hide resolved
```

All parameters except ped and heli are optional, with `pedTarget`, `vehicleTarget`, `x`, `y`, `z` being dependent on `missionType` (ie. Attack/Flee mission types require a target ped/vehicle, whereas GoTo mission types require either `x`, `y`, `z` or a target ped/vehicle).

If you don't want to use a parameter; pass `0.0f` for `x`, `y` and `z`, `0` for `pedTarget`, `vehicleTarget` and other int parameters, and `-1.0f` for the remaining float parameters.

```
DonHulieo marked this conversation as resolved.
Show resolved Hide resolved
Needs more research.
Default value of p13 is -1.0 or 0xBF800000.
Expand All @@ -28,20 +32,43 @@ mode 4 or 7 forces heli to snap to the heading set
I change p2 to 'vehicleToFollow' as it seems to work like the task natives to set targets. In the heli_taxi script where as the merryweather heli takes you to your waypoint it has no need to follow a vehicle or a ped, so of course both have 0 set.
```

## Parameters
* **pilot**:
* **aircraft**:
* **targetVehicle**:
* **targetPed**:
* **destinationX**:
* **destinationY**:
* **destinationZ**:
* **missionFlag**:
* **maxSpeed**:
* **landingRadius**:
* **targetHeading**:
* **unk1**:
* **unk2**:
* **unk3**:
* **landingFlags**:
```c
enum HeliMissionFlags
AvarianKnight marked this conversation as resolved.
Show resolved Hide resolved
{
None = 0,
AttainRequestedOrientation = 1,
DontModifyOrientation = 2,
DontModifyPitch = 4,
DontModifyThrottle = 8,
DontModifyRoll = 16,
LandOnArrival = 32,
DontDoAvoidance = 64,
StartEngineImmediately = 128,
ForceHeightMapAvoidance = 256,
DontClampProbesToDestination = 512,
EnableTimeslicingWhenPossible = 1024,
CircleOppositeDirection = 2048,
MaintainHeightAboveTerrain = 4096,
IgnoreHiddenEntitiesDuringLand = 8192,
DisableAllHeightMapAvoidance = 16384,
// ForceHeightMapAvoidance | DontDoAvoidance
HeightMapOnlyAvoidance = 320,
}
```

## Parameters
* **ped**: The ped to be tasked.
* **heli**: The helicopters' entity handle.
* **vehicleTarget**: The target vehicle (default is 0).
* **pedTarget**: The target ped (default is 0).
* **x**: The x coordinate of the target (default is 0.0f).
* **y**: The y coordinate of the target (default is 0.0f).
* **z**: The z coordinate of the target (default is 0.0f).
* **missionType**: The mission type (default is 0).
* **speed**: The speed in m/s (default is -1.0f).
* **radius**: The radius of when the task will be completed (default is -1.0f).
* **heading**: The heading the helicopter will face at task completion (default is -1.0f).
* **height**: The height the helicopter will fly at (default is -1.0f).
* **minHeight**: The height the helicopter will not fly below (default is -1.0f).
* **slowDist**: The distance to the target at which the helicopter will slow down (default is -1.0f).
* **missionFlags**: The mission flags (default is 0) (see `HeliMissionFlags`).
AvarianKnight marked this conversation as resolved.
Show resolved Hide resolved
50 changes: 39 additions & 11 deletions TASK/TaskVehicleMission.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,49 @@ ns: TASK

```c
// 0x659427E0EF36BCDE 0x20609E56
void TASK_VEHICLE_MISSION(Ped driver, Vehicle vehicle, Vehicle vehicleTarget, int missionType, float p4, Any p5, float p6, float p7, BOOL DriveAgainstTraffic);
void TASK_VEHICLE_MISSION(Ped ped, Vehicle vehicle, Vehicle vehicleTarget, int missionType, float speed, cs_type(Any) int drivingStyle, float radius, float straightLineDist, BOOL DriveAgainstTraffic);
DonHulieo marked this conversation as resolved.
Show resolved Hide resolved
```

All parameters except ped and vehicle are optional, with `vehicleTarget` being dependent on `missionType` (ie. Attack/Flee mission types require a target vehicle, whereas GoTo mission types require a target vehicle).

If you don't want to use a parameter; pass `0` for `vehicleTarget` and other int parameters, and `-1.0f` for the remaining float parameters.

```
missionType: https://alloc8or.re/gta5/doc/enums/eVehicleMissionType.txt
```
DonHulieo marked this conversation as resolved.
Show resolved Hide resolved

## Parameters
* **driver**:
* **vehicle**:
* **vehicleTarget**:
* **missionType**:
* **p4**:
* **p5**:
* **p6**:
* **p7**:
* **DriveAgainstTraffic**:
```c
enum VehicleMissionType
AvarianKnight marked this conversation as resolved.
Show resolved Hide resolved
{
None = 0,
Cruise = 1,
Ram = 2,
Block = 3,
GoTo = 4,
Stop = 5,
Attack = 6,
Follow = 7,
Flee = 8,
Circle = 9,
Escort = 12,
GoToRacing = 14,
FollowRecording = 15,
PoliceBehaviour = 16,
Land = 19,
LandAndWait = 20,
Crash = 21,
PullOver = 22,
HeliProtect = 23
}
```

## Parameters
* **ped**: The ped to be tasked.
* **vehicle**: The vehicles' entity handle.
* **vehicleTarget**: The target vehicle (default is 0).
* **missionType**: The mission type (default is 0) (see `VehicleMissionType`).
AvarianKnight marked this conversation as resolved.
Show resolved Hide resolved
* **speed**: The speed in m/s (default is -1.0f).
* **drivingStyle**: The driving style (default is 0).
* **radius**: The radius of when the task will be completed (default is -1.0f).
* **straightLineDist**: The distance before the vehicle will drive straight to the target (default is -1.0f).
* **DriveAgainstTraffic**: Whether the vehicle should drive against traffic (default is false).
Loading