josiewales Posted June 10, 2021 Share Posted June 10, 2021 I would like to have a vehicle going from A-B at a pre-defined speed so that the player car can race against it. I know how to spawn the vehicle and change its driving style and speed but I do not know how to get it to follow a route or course. I know that you can add code to get a vehicle to go to a coordinate but is it possible to get it to move to that coordinate via several other coordinates such as the GTAV routes shown here:https://github.com/gtbikev/courses#grand-theft-bike-v---courses Link to comment Share on other sites More sharing options...
DuncanMac Posted June 10, 2021 Share Posted June 10, 2021 (edited) Not exactly sure what you're trying to do, but have you considered a task sequence? For example, in this simple script i defined 4 destinations (think rectangle) to get the peds to go around a track. The other option is you run a DriveTo task and when completed you run another...etc. https://www.youtube.com/watch?v=9zscThwsh1w For a simpler route, why not just: CurrentPed.Task.DriveTo(LastVehicle, new Vector3(-1278, -3099, 14), 3.0F, 45); or void TASK_VEHICLE_DRIVE_TO_COORD(Ped ped, Vehicle vehicle, float x, float y, float z, float speed, Any p6, Hash vehicleModel, int drivingMode, float stopRange, float p10) // 0xE2A2AA2F659D77A7 0xE4AC0387 b323 Edited June 11, 2021 by DuncanMac Link to comment Share on other sites More sharing options...
DuncanMac Posted June 11, 2021 Share Posted June 11, 2021 Here is a simple drive to. Ped is told to drive to the airport from the current location. https://www.youtube.com/watch?v=H0qjPiKLKrM Link to comment Share on other sites More sharing options...
josiewales Posted June 11, 2021 Author Share Posted June 11, 2021 excellent - thanks for this info... Link to comment Share on other sites More sharing options...
josiewales Posted June 15, 2021 Author Share Posted June 15, 2021 @DuncanMac Hi. I'm using this code to get a vehicle to go from point A to point B. Function.Call(Hash.TASK_VEHICLE_DRIVE_TO_COORD_LONGRANGE, Globals.competition_ped, Globals.competition_car, 1739f, 6338f, 35f, 10f, 4 | 16 | 32 | 262144, 10f); Assuming that 10f relates to the speed and that my GTAV settings are set to metric, does this actually mean that the car is traveling at 10kph ? The reason I ask is that I am following this car with the player car, the player car is controlled by a real bike and I am doing roughly 35-40km to keep up. Any ideas ?! Link to comment Share on other sites More sharing options...
josiewales Posted June 15, 2021 Author Share Posted June 15, 2021 I figured this out - for some reason the ant+ signal from the bike needs to be multiplied by 4 in order to mimic real world speed within GTAV..... Link to comment Share on other sites More sharing options...
DuncanMac Posted June 15, 2021 Share Posted June 15, 2021 Good. Enjoy! Link to comment Share on other sites More sharing options...
Jitnaught Posted June 17, 2021 Share Posted June 17, 2021 On 6/15/2021 at 4:17 PM, josiewales said: does this actually mean that the car is traveling at 10kph Speed returned by GTA V is in meters per second. Multiply by 3.6 to get KPH. If you want to be very specific on the route the car goes, you could probably copy some code from Eddlm's Autosport Racing System mod, which manually controls the vehicle to go the specific route instead of just tasking the ped to drive. Link to comment Share on other sites More sharing options...
DuncanMac Posted June 17, 2021 Share Posted June 17, 2021 1 hour ago, Jitnaught said: If you want to be very specific on the route the car goes, you could probably copy some code from Eddlm's Autosport Racing System mod, which manually controls the vehicle to go the specific route instead of just tasking the ped to drive. What's wrong with just breaking up the route into pieces and then using a task sequence. Simpler, no? Link to comment Share on other sites More sharing options...
Jitnaught Posted June 21, 2021 Share Posted June 21, 2021 Nothing wrong with that, ARS is just another option. If he's wanting to race against this AI vehicle, Eddlm's ARS mod is specifically made for that. DuncanMac 1 Link to comment Share on other sites More sharing options...
DuncanMac Posted June 21, 2021 Share Posted June 21, 2021 6 hours ago, Jitnaught said: Nothing wrong with that, ARS is just another option. If he's wanting to race against this AI vehicle, Eddlm's ARS mod is specifically made for that. Got it. Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now