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.

TaskInvoker.ParkVehicle issues

Featured Replies

Hello fellow officers!

 

I am back hoping to get some help with a new problem that I need help solving. When invoking a Ped to park a vehicle, I noticed that the Ped will get almost right on top of the point, then drive around in circles for a few minutes before straitening out and parking the vehicle correctly. No matter how far away from the Vector3 that I call the "ParkVehicle" method, the Ped always drives like an idiot in circles before parking. Is anyone willing to share with me a work around?

 

My relevant code:

// Run checks while officer is enroute to the callout
while (drivingTask.IsActive)
{
	// Check for assignment changes
	if (NextTask != TaskSignal.None)
		return; // Return

	// Distance check
	if (parkingNicely && !isParking)
	{
      		// Getting close to location
		if (Officer.Position.TravelDistanceTo(CurrentCall.Location.Position) < 100)
		{
			Officer.Tasks.Clear(); // Clears the DriveToPosition task
			isParking = true;
			drivingTask = Officer.Tasks.ParkVehicle(CurrentCall.Location.Position, CurrentCall.Location.Heading);
		}
	}

	// Allow other threads to do something
	GameFiber.Yield();
}

 

Edited by Brexin212

  • Management Team

Parking AI (or driving AI in general) in V is not great, so I am not sure if there is a real fix for this. You could try checking their distance to the target position and also compared desired heading and current heading and perhaps just mark them as parked yourself.

Please do not PM me unless really necessary (knowing you helps). If you think you need my attention in a topic, tag me.

If u cant solve the problem try to use the driver.Tasks.DriveToPosition() command, and when the ped task ended just align the car with the parking spot*, or make the driver.Tasks.ParkVehicle() after the DriveToPosition() task ends. Maybe, with that, the AI will be more "intelectual".

Edited by playervooob
i missed the spot*

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.