From 4f8a602018c9b563741ac6ba61a1a6ee28f6786e Mon Sep 17 00:00:00 2001 From: MonsieurBibo Date: Mon, 22 Apr 2024 04:04:42 +0200 Subject: [PATCH 1/9] =?UTF-8?q?=F0=9F=93=9D=20Update=20TaskGoToCoordAnyMea?= =?UTF-8?q?nsExtraParams=20and=20TaskGoToCoordAnyMeansExtraParamsWithCruis?= =?UTF-8?q?eSpeed=20following=20the=20update=20on=20TaskGoToCoordAnyMeans?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TASK/TaskGoToCoordAnyMeansExtraParams.md | 110 ++++++++++++++--- ...CoordAnyMeansExtraParamsWithCruiseSpeed.md | 112 +++++++++++++++--- 2 files changed, 191 insertions(+), 31 deletions(-) diff --git a/TASK/TaskGoToCoordAnyMeansExtraParams.md b/TASK/TaskGoToCoordAnyMeansExtraParams.md index 67962f0fc..8f9f53c77 100644 --- a/TASK/TaskGoToCoordAnyMeansExtraParams.md +++ b/TASK/TaskGoToCoordAnyMeansExtraParams.md @@ -5,24 +5,104 @@ ns: TASK ```c // 0x1DD45F9ECFDB1BC9 0x094B75EF -void TASK_GO_TO_COORD_ANY_MEANS_EXTRA_PARAMS(Ped ped, float x, float y, float z, float speed, Any p5, BOOL p6, int walkingStyle, float p8, Any p9, Any p10, Any p11); +void TASK_GO_TO_COORD_ANY_MEANS_EXTRA_PARAMS(Ped ped, float x, float y, float z, float fMoveBlendRatio, cs_type(Any) Vehicle vehicle, BOOL bUseLongRangeVehiclePathing, int drivingFlags, float fMaxRangeToShootTargets, cs_type(Any) float fExtraVehToTargetDistToPreferVeh, cs_type(Any) float fDriveStraightLineDistance, cs_type(Any) int iExtraFlags, float fWarpTimerMS); ``` -``` -NativeDB Added Parameter 13: Any p12 +Same as `TASK_GO_TO_COORD_ANY_MEANS` but with extra parameters. + +```c +enum eDrivingMode { + DF_StopForCars = 1, + DF_StopForPeds = 2, + DF_SwerveAroundAllCars = 4, + DF_SteerAroundStationaryCars = 8, + DF_SteerAroundPeds = 16, + DF_SteerAroundObjects = 32, + DF_DontSteerAroundPlayerPed = 64, + DF_StopAtLights = 128, + DF_GoOffRoadWhenAvoiding = 256, + DF_DriveIntoOncomingTraffic = 512, + DF_DriveInReverse = 1024, + + // If pathfinding fails, cruise randomly instead of going on a straight line + DF_UseWanderFallbackInsteadOfStraightLine = 2048, + + DF_AvoidRestrictedAreas = 4096, + + // These only work on MISSION_CRUISE + DF_PreventBackgroundPathfinding = 8192, + DF_AdjustCruiseSpeedBasedOnRoadSpeed = 16384, + + DF_UseShortCutLinks = 262144, + DF_ChangeLanesAroundObstructions = 524288, + DF_UseSwitchedOffNodes = 2097152, // cruise tasks ignore this anyway--only used for goto's + DF_PreferNavmeshRoute = 4194304, // if you're going to be primarily driving off road + + // Only works for planes using MISSION_GOTO, will cause them to drive along the ground instead of fly + DF_PlaneTaxiMode = 8388608, + + DF_ForceStraightLine = 16777216, + DF_UseStringPullingAtJunctions = 33554432, + + DF_AvoidHighways = 536870912, + DF_ForceJoinInRoadDirection = 1073741824, + + // Standard driving mode. stops for cars, peds, and lights, goes around stationary obstructions + DRIVINGMODE_STOPFORCARS = 786603, // DF_StopForCars|DF_StopForPeds|DF_SteerAroundObjects|DF_SteerAroundStationaryCars|DF_StopAtLights|DF_UseShortCutLinks|DF_ChangeLanesAroundObstructions, // Obey lights too + + // Like the above, but doesn't steer around anything in its way - will only wait instead. + DRIVINGMODE_STOPFORCARS_STRICT = 262275, // DF_StopForCars|DF_StopForPeds|DF_StopAtLights|DF_UseShortCutLinks, // Doesn't deviate an inch. + + // Default "alerted" driving mode. drives around everything, doesn't obey lights + DRIVINGMODE_AVOIDCARS = 786469, // DF_SwerveAroundAllCars|DF_SteerAroundObjects|DF_UseShortCutLinks|DF_ChangeLanesAroundObstructions|DF_StopForCars, + + // Very erratic driving. difference between this and AvoidCars is that it doesn't use the brakes at ALL to help with steering + DRIVINGMODE_AVOIDCARS_RECKLESS = 786468, // DF_SwerveAroundAllCars|DF_SteerAroundObjects|DF_UseShortCutLinks|DF_ChangeLanesAroundObstructions, + + // Smashes through everything + DRIVINGMODE_PLOUGHTHROUGH = 262144, // DF_UseShortCutLinks + + // Drives normally except for the fact that it ignores lights + DRIVINGMODE_STOPFORCARS_IGNORELIGHTS = 786475, // DF_StopForCars|DF_SteerAroundStationaryCars|DF_StopForPeds|DF_SteerAroundObjects|DF_UseShortCutLinks|DF_ChangeLanesAroundObstructions + + // Try to swerve around everything, but stop for lights if necessary + DRIVINGMODE_AVOIDCARS_OBEYLIGHTS = 786597, // DF_SwerveAroundAllCars|DF_StopAtLights|DF_SteerAroundObjects|DF_UseShortCutLinks|DF_ChangeLanesAroundObstructions|DF_StopForCars + + // Swerve around cars, be careful around peds, and stop for lights + DRIVINGMODE_AVOIDCARS_STOPFORPEDS_OBEYLIGHTS = 786599 // DF_SwerveAroundAllCars|DF_StopAtLights|DF_StopForPeds|DF_SteerAroundObjects|DF_UseShortCutLinks|DF_ChangeLanesAroundObstructions|DF_StopForCars +}; + +enum TaskGoToCoordsAnyMeansFlags { + TGCAM_DEFAULT = 0, + // Ignore the health of the vehicle (default behaviour is to not use any vehicle with less than 600 health) + TGCAM_IGNORE_VEHICLE_HEALTH = 1, + // Considers all nearby vehicles for suitability (default behaviour is to consider only the vehicle closest to the ped) + TGCAM_CONSIDER_ALL_NEARBY_VEHICLES = 2, + // Performs the same tests as is done in IS_VEHICLE_DRIVEABLE (default behaviour is to just check the vehicle's health) + TGCAM_PROPER_IS_DRIVEABLE_CHECK = 4, + // Instructs the ped to remain in the vehicle at the end, so that multiple tasks can be chained together (see url:bugstar:1778387) + TGCAM_REMAIN_IN_VEHICLE_AT_DESTINATION = 8, + // Ped will never abandon the vehicle it is in (see url:bugstar:2196034) + TGCAM_NEVER_ABANDON_VEHICLE = 16, + // Ped will never abandon the vehicle it is in if vehicle is moving (see url:bugstar:2225456) + TGCAM_NEVER_ABANDON_VEHICLE_IF_MOVING = 32, + // Peds will use the targeting system for threats and register any threats they can attack (rather than just using the closest targetable ped) + TGCAM_USE_AI_TARGETING_FOR_THREATS = 64 +}; ``` ## Parameters -* **ped**: -* **x**: -* **y**: -* **z**: -* **speed**: -* **p5**: -* **p6**: -* **walkingStyle**: -* **p8**: -* **p9**: -* **p10**: -* **p11**: +* **ped**: The `Ped` Handle. +* **x**: The goto target coordinate. +* **y**: The goto target coordinate. +* **z**: The goto target coordinate. +* **fMoveBlendRatio**: 0.0 = still, 1.0 = walk, 2.0 = run, 3.0 = sprint. +* **vehicle**: If defined, the pedestrian will only move if said vehicle exists. If you don't want any sort of association, just set it to `0`. +* **bUseLongRangeVehiclePathing**: Setting to `true` tells the vehicle to use longrange vehicle pathing. +* **drivingFlags**: See `eDrivingMode` enum. +* **fMaxRangeToShootTargets**: Determines the maximum distance at which the `Ped` will engage in combat with threatening targets. +* **fExtraVehToTargetDistToPreferVeh**: +* **fDriveStraightLineDistance**: +* **iExtraFlags**: See `TaskGoToCoordAnyMeansFlags` enum. +* **fWarpTimerMS**: If the ped is stuck for that amount of milliseconds, it gets warped to the targeted position. Doesn't work if the ped is in a aircraft nor a boat. diff --git a/TASK/TaskGoToCoordAnyMeansExtraParamsWithCruiseSpeed.md b/TASK/TaskGoToCoordAnyMeansExtraParamsWithCruiseSpeed.md index bb3fb45fd..f4b24fddb 100644 --- a/TASK/TaskGoToCoordAnyMeansExtraParamsWithCruiseSpeed.md +++ b/TASK/TaskGoToCoordAnyMeansExtraParamsWithCruiseSpeed.md @@ -5,25 +5,105 @@ ns: TASK ```c // 0xB8ECD61F531A7B02 0x86DC03F9 -void TASK_GO_TO_COORD_ANY_MEANS_EXTRA_PARAMS_WITH_CRUISE_SPEED(Ped ped, float x, float y, float z, float speed, Any p5, BOOL p6, int walkingStyle, float p8, Any p9, Any p10, Any p11, Any p12); +void TASK_GO_TO_COORD_ANY_MEANS_EXTRA_PARAMS_WITH_CRUISE_SPEED(Ped ped, float x, float y, float z, float fMoveBlendRatio, cs_type(Any) Vehicle vehicle, BOOL bUseLongRangeVehiclePathing, int drivingFlags, float fMaxRangeToShootTargets, cs_type(Any) float fExtraVehToTargetDistToPreferVeh, cs_type(Any) float fDriveStraightLineDistance, cs_type(Any) int iExtraFlags, float fCruiseSpeed, float fTargetArriveDist); ``` -``` -NativeDB Added Parameter 14: Any p13 +Same as `TASK_GO_TO_COORD_ANY_MEANS` but with cruise speed control and other parameters. + +```c +enum eDrivingMode { + DF_StopForCars = 1, + DF_StopForPeds = 2, + DF_SwerveAroundAllCars = 4, + DF_SteerAroundStationaryCars = 8, + DF_SteerAroundPeds = 16, + DF_SteerAroundObjects = 32, + DF_DontSteerAroundPlayerPed = 64, + DF_StopAtLights = 128, + DF_GoOffRoadWhenAvoiding = 256, + DF_DriveIntoOncomingTraffic = 512, + DF_DriveInReverse = 1024, + + // If pathfinding fails, cruise randomly instead of going on a straight line + DF_UseWanderFallbackInsteadOfStraightLine = 2048, + + DF_AvoidRestrictedAreas = 4096, + + // These only work on MISSION_CRUISE + DF_PreventBackgroundPathfinding = 8192, + DF_AdjustCruiseSpeedBasedOnRoadSpeed = 16384, + + DF_UseShortCutLinks = 262144, + DF_ChangeLanesAroundObstructions = 524288, + DF_UseSwitchedOffNodes = 2097152, // cruise tasks ignore this anyway--only used for goto's + DF_PreferNavmeshRoute = 4194304, // if you're going to be primarily driving off road + + // Only works for planes using MISSION_GOTO, will cause them to drive along the ground instead of fly + DF_PlaneTaxiMode = 8388608, + + DF_ForceStraightLine = 16777216, + DF_UseStringPullingAtJunctions = 33554432, + + DF_AvoidHighways = 536870912, + DF_ForceJoinInRoadDirection = 1073741824, + + // Standard driving mode. stops for cars, peds, and lights, goes around stationary obstructions + DRIVINGMODE_STOPFORCARS = 786603, // DF_StopForCars|DF_StopForPeds|DF_SteerAroundObjects|DF_SteerAroundStationaryCars|DF_StopAtLights|DF_UseShortCutLinks|DF_ChangeLanesAroundObstructions, // Obey lights too + + // Like the above, but doesn't steer around anything in its way - will only wait instead. + DRIVINGMODE_STOPFORCARS_STRICT = 262275, // DF_StopForCars|DF_StopForPeds|DF_StopAtLights|DF_UseShortCutLinks, // Doesn't deviate an inch. + + // Default "alerted" driving mode. drives around everything, doesn't obey lights + DRIVINGMODE_AVOIDCARS = 786469, // DF_SwerveAroundAllCars|DF_SteerAroundObjects|DF_UseShortCutLinks|DF_ChangeLanesAroundObstructions|DF_StopForCars, + + // Very erratic driving. difference between this and AvoidCars is that it doesn't use the brakes at ALL to help with steering + DRIVINGMODE_AVOIDCARS_RECKLESS = 786468, // DF_SwerveAroundAllCars|DF_SteerAroundObjects|DF_UseShortCutLinks|DF_ChangeLanesAroundObstructions, + + // Smashes through everything + DRIVINGMODE_PLOUGHTHROUGH = 262144, // DF_UseShortCutLinks + + // Drives normally except for the fact that it ignores lights + DRIVINGMODE_STOPFORCARS_IGNORELIGHTS = 786475, // DF_StopForCars|DF_SteerAroundStationaryCars|DF_StopForPeds|DF_SteerAroundObjects|DF_UseShortCutLinks|DF_ChangeLanesAroundObstructions + + // Try to swerve around everything, but stop for lights if necessary + DRIVINGMODE_AVOIDCARS_OBEYLIGHTS = 786597, // DF_SwerveAroundAllCars|DF_StopAtLights|DF_SteerAroundObjects|DF_UseShortCutLinks|DF_ChangeLanesAroundObstructions|DF_StopForCars + + // Swerve around cars, be careful around peds, and stop for lights + DRIVINGMODE_AVOIDCARS_STOPFORPEDS_OBEYLIGHTS = 786599 // DF_SwerveAroundAllCars|DF_StopAtLights|DF_StopForPeds|DF_SteerAroundObjects|DF_UseShortCutLinks|DF_ChangeLanesAroundObstructions|DF_StopForCars +}; + +enum TaskGoToCoordsAnyMeansFlags { + TGCAM_DEFAULT = 0, + // Ignore the health of the vehicle (default behaviour is to not use any vehicle with less than 600 health) + TGCAM_IGNORE_VEHICLE_HEALTH = 1, + // Considers all nearby vehicles for suitability (default behaviour is to consider only the vehicle closest to the ped) + TGCAM_CONSIDER_ALL_NEARBY_VEHICLES = 2, + // Performs the same tests as is done in IS_VEHICLE_DRIVEABLE (default behaviour is to just check the vehicle's health) + TGCAM_PROPER_IS_DRIVEABLE_CHECK = 4, + // Instructs the ped to remain in the vehicle at the end, so that multiple tasks can be chained together (see url:bugstar:1778387) + TGCAM_REMAIN_IN_VEHICLE_AT_DESTINATION = 8, + // Ped will never abandon the vehicle it is in (see url:bugstar:2196034) + TGCAM_NEVER_ABANDON_VEHICLE = 16, + // Ped will never abandon the vehicle it is in if vehicle is moving (see url:bugstar:2225456) + TGCAM_NEVER_ABANDON_VEHICLE_IF_MOVING = 32, + // Peds will use the targeting system for threats and register any threats they can attack (rather than just using the closest targetable ped) + TGCAM_USE_AI_TARGETING_FOR_THREATS = 64 +}; ``` ## Parameters -* **ped**: -* **x**: -* **y**: -* **z**: -* **speed**: -* **p5**: -* **p6**: -* **walkingStyle**: -* **p8**: -* **p9**: -* **p10**: -* **p11**: -* **p12**: +* **ped**: The `Ped` Handle. +* **x**: The goto target coordinate. +* **y**: The goto target coordinate. +* **z**: The goto target coordinate. +* **fMoveBlendRatio**: 0.0 = still, 1.0 = walk, 2.0 = run, 3.0 = sprint. +* **vehicle**: If defined, the pedestrian will only move if said vehicle exists. If you don't want any sort of association, just set it to `0`. +* **bUseLongRangeVehiclePathing**: Setting to `true` tells the vehicle to use longrange vehicle pathing. +* **drivingFlags**: See `eDrivingMode` enum. +* **fMaxRangeToShootTargets**: Determines the maximum distance at which the `Ped` will engage in combat with threatening targets. +* **fExtraVehToTargetDistToPreferVeh**: +* **fDriveStraightLineDistance**: +* **iExtraFlags**: See `TaskGoToCoordAnyMeansFlags` enum. +* **fCruiseSpeed**: The initial cruise speed of the vehicle +* **fTargetArriveDist**: The distance at which the pedestrian will quit the vehicle (by default 4 meters). From dd512891d64119605010589708a85bcf9f9e7b04 Mon Sep 17 00:00:00 2001 From: MonsieurBibo Date: Mon, 22 Apr 2024 18:07:25 +0200 Subject: [PATCH 2/9] =?UTF-8?q?=F0=9F=93=9D=20Fix=20the=20docs=20according?= =?UTF-8?q?=20to=20the=20review?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TASK/TaskGoToCoordAnyMeansExtraParams.md | 84 +------------------ ...CoordAnyMeansExtraParamsWithCruiseSpeed.md | 62 +------------- 2 files changed, 3 insertions(+), 143 deletions(-) diff --git a/TASK/TaskGoToCoordAnyMeansExtraParams.md b/TASK/TaskGoToCoordAnyMeansExtraParams.md index 8f9f53c77..b08513670 100644 --- a/TASK/TaskGoToCoordAnyMeansExtraParams.md +++ b/TASK/TaskGoToCoordAnyMeansExtraParams.md @@ -10,86 +10,6 @@ void TASK_GO_TO_COORD_ANY_MEANS_EXTRA_PARAMS(Ped ped, float x, float y, float z, Same as `TASK_GO_TO_COORD_ANY_MEANS` but with extra parameters. -```c -enum eDrivingMode { - DF_StopForCars = 1, - DF_StopForPeds = 2, - DF_SwerveAroundAllCars = 4, - DF_SteerAroundStationaryCars = 8, - DF_SteerAroundPeds = 16, - DF_SteerAroundObjects = 32, - DF_DontSteerAroundPlayerPed = 64, - DF_StopAtLights = 128, - DF_GoOffRoadWhenAvoiding = 256, - DF_DriveIntoOncomingTraffic = 512, - DF_DriveInReverse = 1024, - - // If pathfinding fails, cruise randomly instead of going on a straight line - DF_UseWanderFallbackInsteadOfStraightLine = 2048, - - DF_AvoidRestrictedAreas = 4096, - - // These only work on MISSION_CRUISE - DF_PreventBackgroundPathfinding = 8192, - DF_AdjustCruiseSpeedBasedOnRoadSpeed = 16384, - - DF_UseShortCutLinks = 262144, - DF_ChangeLanesAroundObstructions = 524288, - DF_UseSwitchedOffNodes = 2097152, // cruise tasks ignore this anyway--only used for goto's - DF_PreferNavmeshRoute = 4194304, // if you're going to be primarily driving off road - - // Only works for planes using MISSION_GOTO, will cause them to drive along the ground instead of fly - DF_PlaneTaxiMode = 8388608, - - DF_ForceStraightLine = 16777216, - DF_UseStringPullingAtJunctions = 33554432, - - DF_AvoidHighways = 536870912, - DF_ForceJoinInRoadDirection = 1073741824, - - // Standard driving mode. stops for cars, peds, and lights, goes around stationary obstructions - DRIVINGMODE_STOPFORCARS = 786603, // DF_StopForCars|DF_StopForPeds|DF_SteerAroundObjects|DF_SteerAroundStationaryCars|DF_StopAtLights|DF_UseShortCutLinks|DF_ChangeLanesAroundObstructions, // Obey lights too - - // Like the above, but doesn't steer around anything in its way - will only wait instead. - DRIVINGMODE_STOPFORCARS_STRICT = 262275, // DF_StopForCars|DF_StopForPeds|DF_StopAtLights|DF_UseShortCutLinks, // Doesn't deviate an inch. - - // Default "alerted" driving mode. drives around everything, doesn't obey lights - DRIVINGMODE_AVOIDCARS = 786469, // DF_SwerveAroundAllCars|DF_SteerAroundObjects|DF_UseShortCutLinks|DF_ChangeLanesAroundObstructions|DF_StopForCars, - - // Very erratic driving. difference between this and AvoidCars is that it doesn't use the brakes at ALL to help with steering - DRIVINGMODE_AVOIDCARS_RECKLESS = 786468, // DF_SwerveAroundAllCars|DF_SteerAroundObjects|DF_UseShortCutLinks|DF_ChangeLanesAroundObstructions, - - // Smashes through everything - DRIVINGMODE_PLOUGHTHROUGH = 262144, // DF_UseShortCutLinks - - // Drives normally except for the fact that it ignores lights - DRIVINGMODE_STOPFORCARS_IGNORELIGHTS = 786475, // DF_StopForCars|DF_SteerAroundStationaryCars|DF_StopForPeds|DF_SteerAroundObjects|DF_UseShortCutLinks|DF_ChangeLanesAroundObstructions - - // Try to swerve around everything, but stop for lights if necessary - DRIVINGMODE_AVOIDCARS_OBEYLIGHTS = 786597, // DF_SwerveAroundAllCars|DF_StopAtLights|DF_SteerAroundObjects|DF_UseShortCutLinks|DF_ChangeLanesAroundObstructions|DF_StopForCars - - // Swerve around cars, be careful around peds, and stop for lights - DRIVINGMODE_AVOIDCARS_STOPFORPEDS_OBEYLIGHTS = 786599 // DF_SwerveAroundAllCars|DF_StopAtLights|DF_StopForPeds|DF_SteerAroundObjects|DF_UseShortCutLinks|DF_ChangeLanesAroundObstructions|DF_StopForCars -}; - -enum TaskGoToCoordsAnyMeansFlags { - TGCAM_DEFAULT = 0, - // Ignore the health of the vehicle (default behaviour is to not use any vehicle with less than 600 health) - TGCAM_IGNORE_VEHICLE_HEALTH = 1, - // Considers all nearby vehicles for suitability (default behaviour is to consider only the vehicle closest to the ped) - TGCAM_CONSIDER_ALL_NEARBY_VEHICLES = 2, - // Performs the same tests as is done in IS_VEHICLE_DRIVEABLE (default behaviour is to just check the vehicle's health) - TGCAM_PROPER_IS_DRIVEABLE_CHECK = 4, - // Instructs the ped to remain in the vehicle at the end, so that multiple tasks can be chained together (see url:bugstar:1778387) - TGCAM_REMAIN_IN_VEHICLE_AT_DESTINATION = 8, - // Ped will never abandon the vehicle it is in (see url:bugstar:2196034) - TGCAM_NEVER_ABANDON_VEHICLE = 16, - // Ped will never abandon the vehicle it is in if vehicle is moving (see url:bugstar:2225456) - TGCAM_NEVER_ABANDON_VEHICLE_IF_MOVING = 32, - // Peds will use the targeting system for threats and register any threats they can attack (rather than just using the closest targetable ped) - TGCAM_USE_AI_TARGETING_FOR_THREATS = 64 -}; -``` ## Parameters * **ped**: The `Ped` Handle. @@ -99,10 +19,10 @@ enum TaskGoToCoordsAnyMeansFlags { * **fMoveBlendRatio**: 0.0 = still, 1.0 = walk, 2.0 = run, 3.0 = sprint. * **vehicle**: If defined, the pedestrian will only move if said vehicle exists. If you don't want any sort of association, just set it to `0`. * **bUseLongRangeVehiclePathing**: Setting to `true` tells the vehicle to use longrange vehicle pathing. -* **drivingFlags**: See `eDrivingMode` enum. +* **drivingFlags**: See `eDrivingMode` enum in the following native [`TASK_GO_TO_COORD_ANY_MEANS`](#_0x5BC448CB78FA3E88). * **fMaxRangeToShootTargets**: Determines the maximum distance at which the `Ped` will engage in combat with threatening targets. * **fExtraVehToTargetDistToPreferVeh**: * **fDriveStraightLineDistance**: -* **iExtraFlags**: See `TaskGoToCoordAnyMeansFlags` enum. +* **iExtraFlags**: See `TaskGoToCoordAnyMeansFlags` enum located at [`TASK_GO_TO_COORD_ANY_MEANS_EXTRA_PARAMS_WITH_CRUISE_SPEED`](#_0xB8ECD61F531A7B02). * **fWarpTimerMS**: If the ped is stuck for that amount of milliseconds, it gets warped to the targeted position. Doesn't work if the ped is in a aircraft nor a boat. diff --git a/TASK/TaskGoToCoordAnyMeansExtraParamsWithCruiseSpeed.md b/TASK/TaskGoToCoordAnyMeansExtraParamsWithCruiseSpeed.md index f4b24fddb..1feee087e 100644 --- a/TASK/TaskGoToCoordAnyMeansExtraParamsWithCruiseSpeed.md +++ b/TASK/TaskGoToCoordAnyMeansExtraParamsWithCruiseSpeed.md @@ -11,66 +11,6 @@ void TASK_GO_TO_COORD_ANY_MEANS_EXTRA_PARAMS_WITH_CRUISE_SPEED(Ped ped, float x, Same as `TASK_GO_TO_COORD_ANY_MEANS` but with cruise speed control and other parameters. ```c -enum eDrivingMode { - DF_StopForCars = 1, - DF_StopForPeds = 2, - DF_SwerveAroundAllCars = 4, - DF_SteerAroundStationaryCars = 8, - DF_SteerAroundPeds = 16, - DF_SteerAroundObjects = 32, - DF_DontSteerAroundPlayerPed = 64, - DF_StopAtLights = 128, - DF_GoOffRoadWhenAvoiding = 256, - DF_DriveIntoOncomingTraffic = 512, - DF_DriveInReverse = 1024, - - // If pathfinding fails, cruise randomly instead of going on a straight line - DF_UseWanderFallbackInsteadOfStraightLine = 2048, - - DF_AvoidRestrictedAreas = 4096, - - // These only work on MISSION_CRUISE - DF_PreventBackgroundPathfinding = 8192, - DF_AdjustCruiseSpeedBasedOnRoadSpeed = 16384, - - DF_UseShortCutLinks = 262144, - DF_ChangeLanesAroundObstructions = 524288, - DF_UseSwitchedOffNodes = 2097152, // cruise tasks ignore this anyway--only used for goto's - DF_PreferNavmeshRoute = 4194304, // if you're going to be primarily driving off road - - // Only works for planes using MISSION_GOTO, will cause them to drive along the ground instead of fly - DF_PlaneTaxiMode = 8388608, - - DF_ForceStraightLine = 16777216, - DF_UseStringPullingAtJunctions = 33554432, - - DF_AvoidHighways = 536870912, - DF_ForceJoinInRoadDirection = 1073741824, - - // Standard driving mode. stops for cars, peds, and lights, goes around stationary obstructions - DRIVINGMODE_STOPFORCARS = 786603, // DF_StopForCars|DF_StopForPeds|DF_SteerAroundObjects|DF_SteerAroundStationaryCars|DF_StopAtLights|DF_UseShortCutLinks|DF_ChangeLanesAroundObstructions, // Obey lights too - - // Like the above, but doesn't steer around anything in its way - will only wait instead. - DRIVINGMODE_STOPFORCARS_STRICT = 262275, // DF_StopForCars|DF_StopForPeds|DF_StopAtLights|DF_UseShortCutLinks, // Doesn't deviate an inch. - - // Default "alerted" driving mode. drives around everything, doesn't obey lights - DRIVINGMODE_AVOIDCARS = 786469, // DF_SwerveAroundAllCars|DF_SteerAroundObjects|DF_UseShortCutLinks|DF_ChangeLanesAroundObstructions|DF_StopForCars, - - // Very erratic driving. difference between this and AvoidCars is that it doesn't use the brakes at ALL to help with steering - DRIVINGMODE_AVOIDCARS_RECKLESS = 786468, // DF_SwerveAroundAllCars|DF_SteerAroundObjects|DF_UseShortCutLinks|DF_ChangeLanesAroundObstructions, - - // Smashes through everything - DRIVINGMODE_PLOUGHTHROUGH = 262144, // DF_UseShortCutLinks - - // Drives normally except for the fact that it ignores lights - DRIVINGMODE_STOPFORCARS_IGNORELIGHTS = 786475, // DF_StopForCars|DF_SteerAroundStationaryCars|DF_StopForPeds|DF_SteerAroundObjects|DF_UseShortCutLinks|DF_ChangeLanesAroundObstructions - - // Try to swerve around everything, but stop for lights if necessary - DRIVINGMODE_AVOIDCARS_OBEYLIGHTS = 786597, // DF_SwerveAroundAllCars|DF_StopAtLights|DF_SteerAroundObjects|DF_UseShortCutLinks|DF_ChangeLanesAroundObstructions|DF_StopForCars - - // Swerve around cars, be careful around peds, and stop for lights - DRIVINGMODE_AVOIDCARS_STOPFORPEDS_OBEYLIGHTS = 786599 // DF_SwerveAroundAllCars|DF_StopAtLights|DF_StopForPeds|DF_SteerAroundObjects|DF_UseShortCutLinks|DF_ChangeLanesAroundObstructions|DF_StopForCars -}; enum TaskGoToCoordsAnyMeansFlags { TGCAM_DEFAULT = 0, @@ -99,7 +39,7 @@ enum TaskGoToCoordsAnyMeansFlags { * **fMoveBlendRatio**: 0.0 = still, 1.0 = walk, 2.0 = run, 3.0 = sprint. * **vehicle**: If defined, the pedestrian will only move if said vehicle exists. If you don't want any sort of association, just set it to `0`. * **bUseLongRangeVehiclePathing**: Setting to `true` tells the vehicle to use longrange vehicle pathing. -* **drivingFlags**: See `eDrivingMode` enum. +* **drivingFlags**: See `eDrivingMode` enum in the following native [`TASK_GO_TO_COORD_ANY_MEANS`](#_0x5BC448CB78FA3E88). * **fMaxRangeToShootTargets**: Determines the maximum distance at which the `Ped` will engage in combat with threatening targets. * **fExtraVehToTargetDistToPreferVeh**: * **fDriveStraightLineDistance**: From 716c54c08a9ed2ce9503810a183abb851b716f17 Mon Sep 17 00:00:00 2001 From: ammonia-cfx <38232208+4mmonium@users.noreply.github.com> Date: Tue, 23 Apr 2024 13:47:45 +0300 Subject: [PATCH 3/9] Update TaskGoToCoordAnyMeansExtraParamsWithCruiseSpeed.md Correct parameter cs typing. --- TASK/TaskGoToCoordAnyMeansExtraParamsWithCruiseSpeed.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TASK/TaskGoToCoordAnyMeansExtraParamsWithCruiseSpeed.md b/TASK/TaskGoToCoordAnyMeansExtraParamsWithCruiseSpeed.md index 1feee087e..666bac0ce 100644 --- a/TASK/TaskGoToCoordAnyMeansExtraParamsWithCruiseSpeed.md +++ b/TASK/TaskGoToCoordAnyMeansExtraParamsWithCruiseSpeed.md @@ -5,7 +5,7 @@ ns: TASK ```c // 0xB8ECD61F531A7B02 0x86DC03F9 -void TASK_GO_TO_COORD_ANY_MEANS_EXTRA_PARAMS_WITH_CRUISE_SPEED(Ped ped, float x, float y, float z, float fMoveBlendRatio, cs_type(Any) Vehicle vehicle, BOOL bUseLongRangeVehiclePathing, int drivingFlags, float fMaxRangeToShootTargets, cs_type(Any) float fExtraVehToTargetDistToPreferVeh, cs_type(Any) float fDriveStraightLineDistance, cs_type(Any) int iExtraFlags, float fCruiseSpeed, float fTargetArriveDist); +void TASK_GO_TO_COORD_ANY_MEANS_EXTRA_PARAMS_WITH_CRUISE_SPEED(Ped ped, float x, float y, float z, float fMoveBlendRatio, Vehicle vehicle, BOOL bUseLongRangeVehiclePathing, int drivingFlags, float fMaxRangeToShootTargets, cs_type(Any) float fExtraVehToTargetDistToPreferVeh, cs_type(Any) float fDriveStraightLineDistance, int iExtraFlags, cs_type(Any) float fCruiseSpeed, cs_type(Any) float fTargetArriveDist); ``` Same as `TASK_GO_TO_COORD_ANY_MEANS` but with cruise speed control and other parameters. From 44a4b3f198120f8867439340e8653f70769ae562 Mon Sep 17 00:00:00 2001 From: ammonia-cfx <38232208+4mmonium@users.noreply.github.com> Date: Tue, 23 Apr 2024 13:50:52 +0300 Subject: [PATCH 4/9] Update TaskGoToCoordAnyMeansExtraParams.md Correct parameter cs typing for `TASK_GO_TO_COORD_ANY_MEANS_EXTRA_PARAMS`. `Any` isn't needed for `int` derived types. --- TASK/TaskGoToCoordAnyMeansExtraParams.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TASK/TaskGoToCoordAnyMeansExtraParams.md b/TASK/TaskGoToCoordAnyMeansExtraParams.md index b08513670..b171be555 100644 --- a/TASK/TaskGoToCoordAnyMeansExtraParams.md +++ b/TASK/TaskGoToCoordAnyMeansExtraParams.md @@ -5,7 +5,7 @@ ns: TASK ```c // 0x1DD45F9ECFDB1BC9 0x094B75EF -void TASK_GO_TO_COORD_ANY_MEANS_EXTRA_PARAMS(Ped ped, float x, float y, float z, float fMoveBlendRatio, cs_type(Any) Vehicle vehicle, BOOL bUseLongRangeVehiclePathing, int drivingFlags, float fMaxRangeToShootTargets, cs_type(Any) float fExtraVehToTargetDistToPreferVeh, cs_type(Any) float fDriveStraightLineDistance, cs_type(Any) int iExtraFlags, float fWarpTimerMS); +void TASK_GO_TO_COORD_ANY_MEANS_EXTRA_PARAMS(Ped ped, float x, float y, float z, float fMoveBlendRatio, Vehicle vehicle, BOOL bUseLongRangeVehiclePathing, int drivingFlags, float fMaxRangeToShootTargets, cs_type(Any) float fExtraVehToTargetDistToPreferVeh, cs_type(Any) float fDriveStraightLineDistance, int iExtraFlags, cs_type(Any) float fWarpTimerMS); ``` Same as `TASK_GO_TO_COORD_ANY_MEANS` but with extra parameters. From 2a81638aa25a1c1162facf970c1ead778d3807ef Mon Sep 17 00:00:00 2001 From: ammonia-cfx <38232208+4mmonium@users.noreply.github.com> Date: Tue, 23 Apr 2024 13:51:59 +0300 Subject: [PATCH 5/9] Update TaskGoToCoordAnyMeansExtraParamsWithCruiseSpeed.md Indent the enum. --- ...CoordAnyMeansExtraParamsWithCruiseSpeed.md | 33 +++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/TASK/TaskGoToCoordAnyMeansExtraParamsWithCruiseSpeed.md b/TASK/TaskGoToCoordAnyMeansExtraParamsWithCruiseSpeed.md index 666bac0ce..dc5d79c24 100644 --- a/TASK/TaskGoToCoordAnyMeansExtraParamsWithCruiseSpeed.md +++ b/TASK/TaskGoToCoordAnyMeansExtraParamsWithCruiseSpeed.md @@ -11,23 +11,22 @@ void TASK_GO_TO_COORD_ANY_MEANS_EXTRA_PARAMS_WITH_CRUISE_SPEED(Ped ped, float x, Same as `TASK_GO_TO_COORD_ANY_MEANS` but with cruise speed control and other parameters. ```c - -enum TaskGoToCoordsAnyMeansFlags { - TGCAM_DEFAULT = 0, - // Ignore the health of the vehicle (default behaviour is to not use any vehicle with less than 600 health) - TGCAM_IGNORE_VEHICLE_HEALTH = 1, - // Considers all nearby vehicles for suitability (default behaviour is to consider only the vehicle closest to the ped) - TGCAM_CONSIDER_ALL_NEARBY_VEHICLES = 2, - // Performs the same tests as is done in IS_VEHICLE_DRIVEABLE (default behaviour is to just check the vehicle's health) - TGCAM_PROPER_IS_DRIVEABLE_CHECK = 4, - // Instructs the ped to remain in the vehicle at the end, so that multiple tasks can be chained together (see url:bugstar:1778387) - TGCAM_REMAIN_IN_VEHICLE_AT_DESTINATION = 8, - // Ped will never abandon the vehicle it is in (see url:bugstar:2196034) - TGCAM_NEVER_ABANDON_VEHICLE = 16, - // Ped will never abandon the vehicle it is in if vehicle is moving (see url:bugstar:2225456) - TGCAM_NEVER_ABANDON_VEHICLE_IF_MOVING = 32, - // Peds will use the targeting system for threats and register any threats they can attack (rather than just using the closest targetable ped) - TGCAM_USE_AI_TARGETING_FOR_THREATS = 64 +enum eTaskGoToCoordAnyMeansFlags { + TGCAM_DEFAULT = 0, + // Ignore the health of the vehicle (default behaviour is to not use any vehicle with less than 600 health) + TGCAM_IGNORE_VEHICLE_HEALTH = 1, + // Considers all nearby vehicles for suitability (default behaviour is to consider only the vehicle closest to the ped) + TGCAM_CONSIDER_ALL_NEARBY_VEHICLES = 2, + // Performs the same tests as is done in IS_VEHICLE_DRIVEABLE (default behaviour is to just check the vehicle's health) + TGCAM_PROPER_IS_DRIVEABLE_CHECK = 4, + // Instructs the ped to remain in the vehicle at the end, so that multiple tasks can be chained together. + TGCAM_REMAIN_IN_VEHICLE_AT_DESTINATION = 8, + // Ped will never abandon the vehicle it is in. + TGCAM_NEVER_ABANDON_VEHICLE = 16, + // Ped will never abandon the vehicle it is in if vehicle is moving. + TGCAM_NEVER_ABANDON_VEHICLE_IF_MOVING = 32, + // Peds will use the targeting system for threats and register any threats they can attack (rather than just using the closest targetable ped) + TGCAM_USE_AI_TARGETING_FOR_THREATS = 64 }; ``` From 925bca97d667f99e95196fb9bc72463e963a0cd8 Mon Sep 17 00:00:00 2001 From: ammonia-cfx <38232208+4mmonium@users.noreply.github.com> Date: Tue, 23 Apr 2024 13:52:54 +0300 Subject: [PATCH 6/9] Update TaskGoToCoordAnyMeansExtraParams.md --- TASK/TaskGoToCoordAnyMeansExtraParams.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TASK/TaskGoToCoordAnyMeansExtraParams.md b/TASK/TaskGoToCoordAnyMeansExtraParams.md index b171be555..ece21328a 100644 --- a/TASK/TaskGoToCoordAnyMeansExtraParams.md +++ b/TASK/TaskGoToCoordAnyMeansExtraParams.md @@ -23,6 +23,6 @@ Same as `TASK_GO_TO_COORD_ANY_MEANS` but with extra parameters. * **fMaxRangeToShootTargets**: Determines the maximum distance at which the `Ped` will engage in combat with threatening targets. * **fExtraVehToTargetDistToPreferVeh**: * **fDriveStraightLineDistance**: -* **iExtraFlags**: See `TaskGoToCoordAnyMeansFlags` enum located at [`TASK_GO_TO_COORD_ANY_MEANS_EXTRA_PARAMS_WITH_CRUISE_SPEED`](#_0xB8ECD61F531A7B02). +* **iExtraFlags**: See `eTaskGoToCoordAnyMeansFlags` enum located at [`TASK_GO_TO_COORD_ANY_MEANS_EXTRA_PARAMS_WITH_CRUISE_SPEED`](#_0xB8ECD61F531A7B02). * **fWarpTimerMS**: If the ped is stuck for that amount of milliseconds, it gets warped to the targeted position. Doesn't work if the ped is in a aircraft nor a boat. From 6b08a0f7fe317a0f205b0e295c92d2d57c8aef67 Mon Sep 17 00:00:00 2001 From: ammonia-cfx <38232208+4mmonium@users.noreply.github.com> Date: Tue, 23 Apr 2024 13:53:34 +0300 Subject: [PATCH 7/9] Update TaskGoToCoordAnyMeansExtraParamsWithCruiseSpeed.md --- TASK/TaskGoToCoordAnyMeansExtraParamsWithCruiseSpeed.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TASK/TaskGoToCoordAnyMeansExtraParamsWithCruiseSpeed.md b/TASK/TaskGoToCoordAnyMeansExtraParamsWithCruiseSpeed.md index dc5d79c24..fd2610dd9 100644 --- a/TASK/TaskGoToCoordAnyMeansExtraParamsWithCruiseSpeed.md +++ b/TASK/TaskGoToCoordAnyMeansExtraParamsWithCruiseSpeed.md @@ -42,7 +42,7 @@ enum eTaskGoToCoordAnyMeansFlags { * **fMaxRangeToShootTargets**: Determines the maximum distance at which the `Ped` will engage in combat with threatening targets. * **fExtraVehToTargetDistToPreferVeh**: * **fDriveStraightLineDistance**: -* **iExtraFlags**: See `TaskGoToCoordAnyMeansFlags` enum. +* **iExtraFlags**: See `eTaskGoToCoordAnyMeansFlags` enum. * **fCruiseSpeed**: The initial cruise speed of the vehicle * **fTargetArriveDist**: The distance at which the pedestrian will quit the vehicle (by default 4 meters). From 9441c7423d5410d6a30158342ab7f857aa219ca6 Mon Sep 17 00:00:00 2001 From: ammonia-cfx <38232208+4mmonium@users.noreply.github.com> Date: Tue, 23 Apr 2024 13:59:49 +0300 Subject: [PATCH 8/9] Update TaskGoToCoordAnyMeansExtraParams.md Correct parameter count. --- TASK/TaskGoToCoordAnyMeansExtraParams.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/TASK/TaskGoToCoordAnyMeansExtraParams.md b/TASK/TaskGoToCoordAnyMeansExtraParams.md index ece21328a..bd2b029bd 100644 --- a/TASK/TaskGoToCoordAnyMeansExtraParams.md +++ b/TASK/TaskGoToCoordAnyMeansExtraParams.md @@ -5,11 +5,13 @@ ns: TASK ```c // 0x1DD45F9ECFDB1BC9 0x094B75EF -void TASK_GO_TO_COORD_ANY_MEANS_EXTRA_PARAMS(Ped ped, float x, float y, float z, float fMoveBlendRatio, Vehicle vehicle, BOOL bUseLongRangeVehiclePathing, int drivingFlags, float fMaxRangeToShootTargets, cs_type(Any) float fExtraVehToTargetDistToPreferVeh, cs_type(Any) float fDriveStraightLineDistance, int iExtraFlags, cs_type(Any) float fWarpTimerMS); +void TASK_GO_TO_COORD_ANY_MEANS_EXTRA_PARAMS(Ped ped, float x, float y, float z, float fMoveBlendRatio, Vehicle vehicle, BOOL bUseLongRangeVehiclePathing, int drivingFlags, float fMaxRangeToShootTargets, cs_type(Any) float fExtraVehToTargetDistToPreferVeh, cs_type(Any) float fDriveStraightLineDistance, int iExtraFlags); ``` Same as `TASK_GO_TO_COORD_ANY_MEANS` but with extra parameters. +### Added parameters +* **fWarpTimerMS**: If the ped is stuck for that amount of milliseconds, it gets warped to the targeted position. Doesn't work if the ped is in a aircraft nor a boat. ## Parameters * **ped**: The `Ped` Handle. @@ -24,5 +26,3 @@ Same as `TASK_GO_TO_COORD_ANY_MEANS` but with extra parameters. * **fExtraVehToTargetDistToPreferVeh**: * **fDriveStraightLineDistance**: * **iExtraFlags**: See `eTaskGoToCoordAnyMeansFlags` enum located at [`TASK_GO_TO_COORD_ANY_MEANS_EXTRA_PARAMS_WITH_CRUISE_SPEED`](#_0xB8ECD61F531A7B02). -* **fWarpTimerMS**: If the ped is stuck for that amount of milliseconds, it gets warped to the targeted position. Doesn't work if the ped is in a aircraft nor a boat. - From 562f0c8cac9fc532d49db792cd57a8bed9f926cf Mon Sep 17 00:00:00 2001 From: ammonia-cfx <38232208+4mmonium@users.noreply.github.com> Date: Tue, 23 Apr 2024 14:02:23 +0300 Subject: [PATCH 9/9] Update TaskGoToCoordAnyMeansExtraParamsWithCruiseSpeed.md Correct parameter count so it doesn't break the ABI. --- TASK/TaskGoToCoordAnyMeansExtraParamsWithCruiseSpeed.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/TASK/TaskGoToCoordAnyMeansExtraParamsWithCruiseSpeed.md b/TASK/TaskGoToCoordAnyMeansExtraParamsWithCruiseSpeed.md index fd2610dd9..f73c5a244 100644 --- a/TASK/TaskGoToCoordAnyMeansExtraParamsWithCruiseSpeed.md +++ b/TASK/TaskGoToCoordAnyMeansExtraParamsWithCruiseSpeed.md @@ -5,7 +5,7 @@ ns: TASK ```c // 0xB8ECD61F531A7B02 0x86DC03F9 -void TASK_GO_TO_COORD_ANY_MEANS_EXTRA_PARAMS_WITH_CRUISE_SPEED(Ped ped, float x, float y, float z, float fMoveBlendRatio, Vehicle vehicle, BOOL bUseLongRangeVehiclePathing, int drivingFlags, float fMaxRangeToShootTargets, cs_type(Any) float fExtraVehToTargetDistToPreferVeh, cs_type(Any) float fDriveStraightLineDistance, int iExtraFlags, cs_type(Any) float fCruiseSpeed, cs_type(Any) float fTargetArriveDist); +void TASK_GO_TO_COORD_ANY_MEANS_EXTRA_PARAMS_WITH_CRUISE_SPEED(Ped ped, float x, float y, float z, float fMoveBlendRatio, Vehicle vehicle, BOOL bUseLongRangeVehiclePathing, int drivingFlags, float fMaxRangeToShootTargets, cs_type(Any) float fExtraVehToTargetDistToPreferVeh, cs_type(Any) float fDriveStraightLineDistance, int iExtraFlags, cs_type(Any) float fCruiseSpeed); ``` Same as `TASK_GO_TO_COORD_ANY_MEANS` but with cruise speed control and other parameters. @@ -30,6 +30,9 @@ enum eTaskGoToCoordAnyMeansFlags { }; ``` +### Added parameters +* **fTargetArriveDist**: The distance at which the pedestrian will quit the vehicle (by default 4 meters). + ## Parameters * **ped**: The `Ped` Handle. * **x**: The goto target coordinate. @@ -44,5 +47,3 @@ enum eTaskGoToCoordAnyMeansFlags { * **fDriveStraightLineDistance**: * **iExtraFlags**: See `eTaskGoToCoordAnyMeansFlags` enum. * **fCruiseSpeed**: The initial cruise speed of the vehicle -* **fTargetArriveDist**: The distance at which the pedestrian will quit the vehicle (by default 4 meters). -