Jump to content

Move ped out of building


Shinhwa

Recommended Posts

I can't figure out how to get a Ped to move from inside the Blaine County Savings Bank in Paleto to the car waiting outside. The Peds I have outside the bank move to the car just fine. But the guy in the bank just stays there. I decided maybe he can't open the door on his own (despite being a cold blooded killer), so I tried to open both doors, but that doesn't seem to work. The doors don't actually open. Can someone point out my glaring mistake so I can move on with my life? 

 

Callout Initialization:

private Vector3 InsideMan3SpawnPoint = new Vector3(-109.9275f, 6464.298f, 31.62672f);
private Ped InsideMan3;


InsideMan3 = new Ped(InsideMan3SpawnPoint);
InsideMan3.Heading = 129f;
InsideMan3.IsPersistent = true;
InsideMan3.BlockPermanentEvents = true;
InsideMan3.Inventory.GiveNewWeapon("WEAPON_ASSAULTSHOTGUN", 120, true);
InsideMan3Blip = InsideMan1.AttachBlip();
InsideMan3Blip.IsFriendly = false;

 

public override void Process():

 

NativeFunction.CallByName<uint>("SET_STATE_OF_CLOSEST_DOOR_OF_TYPE", 0xa9f8b6b, -111.0f, 6464.0f, 32.0f, false, 1f, false);
NativeFunction.CallByName<uint>("SET_STATE_OF_CLOSEST_DOOR_OF_TYPE", 0x6e67d2fa, -110.0f, 6462.0f, 32.0f, false, 1f, false);
InsideMan3.Tasks.FollowNavigationMeshToPosition(GetawayCar.Position, 129f, 2.0f);
InsideMan3.Tasks.EnterVehicle(GetawayCar, 0);
     

Bonus question: All 3 murderous Peds use the same "FollowNavigationMeshToPostion" call, and the two that actually do it take their sweet time walking there. I thought the "2.0f" in the call was for "run". How do I get them to the car fast?

Link to comment
Share on other sites

5 hours ago, Shinhwa said:

I can't figure out how to get a Ped to move from inside the Blaine County Savings Bank in Paleto to the car waiting outside.

doesn't

Suspect.Tasks.EnterVehicle();

work?

Link to comment
Share on other sites

I suppose it is possible that there isn't a navigation mesh inside the bank to outside, so the ped won't be able to follow it outside. You may have to gather some coordinates to guide them from inside to outside, using a series of `GoStraightToPosition` tasks.

 

Once outside, you can probably then have them FollowNavigationMeshToPosition to a position nearby the vehicle. (Note that a ped needs to be quite close to a vehicle already before EnterVehicle will work).

 

Bonus question: the speed argument is in metres/second. 2 m/s is about 4.5 mph, so will only be a brisk walk! I find using MathHelper.ConvertMilesPerHourToMetersPerSecond helpful when setting speeds. In GTA terms, 9-12 mph should invoke running.

As you might guess, I make PeterUCallouts. I love working to bring LSPDFR players the kind of callouts that strike a good balance between realism and fun and are stable & varied!

Unfortunately I cannot offer support via PM -- please use the forums, so that others may benefit from your solutions!

Link to comment
Share on other sites

@PeterU I actually have a question, I am setting a ped to pick up a player in a vehicle. The ped arrives, the player walks to the car but for some reason the player gets stuck a few inches infront of the door trying to open it.

Link to comment
Share on other sites

I guess the documentation I saw for FollowNavigationMeshToPosition wasn't correct. I'll try upping the speed to 4.5. 

I'll try the GoStraightToPosition task. He starts out just inside the door and is pointed towards it, so should be easy peasy. I was just trying to do it the "right" way :).

 

Thank you for the reply.

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