Skip to content
View in the app

A better way to browse. Learn more.

LCPDFR.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Make Vehicles Follow Each Other

Featured Replies

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

  • Author
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

while(true)

{ Gamefiber.yield();

Ped1.tasks.follownavigationmesh(ped2.position, heading, speed)

}

Typed on my phone so don't mind the syntax 

That's what worked for me, should check at home 

  • Author

@khorio Yeah, what I had is very similar from what I remember (I'm starting to redevelop the callout after a bit of time away from it). I'm probably going to write that section from the start again. Thank you.

ScottyTooHotty

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.

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.

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.

  • Author
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

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.

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.

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.

  • Author
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

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...

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.