Jump to content

Make Vehicles Follow Each Other


Recommended Posts

Trying to make a convoy of 4 vehicles for one of my WIP callouts but cannot for the life of me get them to follow each other other. I've tried a magnitude of things but nothing is working. So if anyone can help with how to make a vehicle follow me it would be greatly appreciated. Thanks in advance.

ScottyTooHotty

Link to comment
Share on other sites

13 minutes ago, khorio said:

There are escort and follow vehicle functions in the natives, but I've always used a while loop that keeps giving new coordinates.

I've tried that loop with the updating coords but the vehicles don't move :/

ScottyTooHotty

Link to comment
Share on other sites

I'm using ped.Tasks.ChaseWithGroundVehicle() but in the context of a 'pursuit', probably wouldn't suit a convoy situation.

My YouTube Channel: Darkmyre Gaming (Australian LSPDFR patrols, plugins in development, and other games)

My Discord Server | AusGamer Network

 

Please do not PM me for technical support or bug reports, use the appropriate forum or plugin's comments instead.

Link to comment
Share on other sites

My Roadblock callout, to make the police vehicle chase the suspect towards the player. 

Another idea that might work, is assign all the vehicles an identical DriveToPosition task, with a WaitForCompletion() on the last task. You could probably even work out relative positions for the follow vehicles to make them keep formation a bit better.

My YouTube Channel: Darkmyre Gaming (Australian LSPDFR patrols, plugins in development, and other games)

My Discord Server | AusGamer Network

 

Please do not PM me for technical support or bug reports, use the appropriate forum or plugin's comments instead.

Link to comment
Share on other sites

6 minutes ago, ScottehBoyy said:

@alexguirre What is it referring to when saying p7? Thanks.

That it's the parameter number 7, basically the usage of it is unknown so nobody has renamed it, I'm not in my computer right so I can't check how I used it or how it's used in the game scripts, for now just pass 0.

Link to comment
Share on other sites

10 minutes ago, alexguirre said:

That it's the parameter number 7, basically the usage of it is unknown so nobody has renamed it, I'm not in my computer right so I can't check how I used it or how it's used in the game scripts, for now just pass 0.

Alright sweet, thanks buddy. Also, the driving styles, I'm looking for one similar to the VehicleDrivingFlags.Emergency but I don't know which to choose. Will it matter as if they're following the players vehicle then if they go through a red then so will the following vehicle?

Edited by ScottehBoyy

ScottyTooHotty

Link to comment
Share on other sites

13 minutes ago, ScottehBoyy said:

Alright sweet, thanks buddy. Also, the driving styles, I'm looking for one similar to the VehicleDrivingFlags.Emergency but I don't know which to choose. Will it matter as if they're following the players vehicle then if they go through a red then so will the following vehicle?

The driving styles in RPH are the VehicleDrivingFlags, if you need to pass it to a native, cast it to uint, e.g. (uint)VehicleDrivingFlags.Emergency.

Link to comment
Share on other sites

11 hours ago, ScottehBoyy said:

@alexguirre Works pretty well man, only thing is that they seem to get a little confused sometimes haha. Especially in the middle of intersections. 

Welcome to GTAV's AI :biggrin:

My YouTube: Click here. 

My Discord Server - https://discord.gg/0taiZvBSiw5qGAXU

Useful post? Let me and others know by clicking the Like button.
Check out my many script modifications! 
Having issues? LSPDFR Troubleshooter by Albo1125.

Link to comment
Share on other sites

12 hours ago, ScottehBoyy said:

@alexguirre Works pretty well man, only thing is that they seem to get a little confused sometimes haha. Especially in the middle of intersections. 

The only thing I can recommend you if to tweak the parameters until you find something that works better, i.e the minDistance, driving flags, noRoadsDistance,...

Btw the the values used for the parameter p7 in the game scripts are -1, 20 and 0, try those maybe you notice a difference.

Link to comment
Share on other sites

26 minutes ago, alexguirre said:

The only thing I can recommend you if to tweak the parameters until you find something that works better, i.e the minDistance, driving flags, noRoadsDistance,...

Btw the the values used for the parameter p7 in the game scripts are -1, 20 and 0, try those maybe you notice a difference.

I'll give each of the 3 vehicles a different p7 and see the difference. Thanks.

ScottyTooHotty

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...