Skip to content
View in the app

A better way to browse. Learn more.

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

[SOLVED] How to make a ped flee or cower properly?

You're viewing a summary of the most helpful posts in this topic — about 2 minutes of reading instead of 7 minutes for all 21 posts.

Featured Replies

I cant get the fleeing to work.

I have tried

AI::TASK_SMART_FLEE_PED(peds, playerPed, 100.0f, 100, false, false, 0);

AI::TASK_SMART_FLEE_PED(peds, playerPed, 100.0f, 100, true, false, 0);

AI::TASK_SMART_FLEE_PED(peds, playerPed, 100.0f, 100, false, true, 0);

AI::TASK_SMART_FLEE_PED(peds, playerPed, 100.0f, 100, true, true, 0);

 

But the NPCs only turn their back on me but keep standing still.

When using the cowering task, it looks like NPCs are doing squats (they cower, get up, cower, get up,..):

AI::TASK_COWER(peds, 50, 0, 0);

AI::TASK_COWER(peds, 50, 1, 0);

 

I have also tried this method, but it makes NPCs run in one direction, crashing into trees, stones, objects, etc.:

AI::_0xE86A537B5A3C297C(peds, playerPed);

 

Does anyone know how to make a ped flee or cower properly?

Edited by HughJanus

I've used this one successfully (_TASK_SMART_FLEE_STYLE_PED):

 

0xFD45175A6DFD7CE9(ped, pedToFleeFrom, 3, 0, -1.0f, -1, 0);

 

It is also important to note that fleeing behavior can be altered using flags, but I don't think those are documented yet.

  • 1 year later...
  • Author
2 hours ago, SAC said:

 

So, which native?

 

 

Oh, I thought you were already trying stuff, sorry.

 

 

I have not used these functions, so I cant give any instructions on how to use them, unfortunately 😕

TASK::TASK_GO_TO_COORD_ANY_MEANS(ped, coords.x, coord.y, coord.z, 1.0f, 0, 0, 786603, 0xbf800000);

TASK::TASK_FOLLOW_NAV_MESH_TO_COORD(ped, coords.x, coord.y, coord.z, 1.0f, -1, 0.5f, 1048580, 40000.0f);

These are the ones I'm using. The params are: ped, coordinates, speed, timeout I think but not use, don't know the rest...

1.0 is walk speed, 2.0 should be jog and 3.0 is sprint.

edit: oh the parameter after the timeout I think is how close they're supposed to stop to the given coords. 0 is exactly the coords. 

Edited by crossed99

Yes, I guess something like checking if he's moving with TASK::IS_PED_STILL and waiting until he stopped should work but you can also do a sequence of actions like this:

 

int changePosSeq;
TASK::OPEN_SEQUENCE_TASK(&changePosSeq);
TASK::CLEAR_PED_TASKS(0, 1, 1);
TASK::TASK_FOLLOW_NAV_MESH_TO_COORD(0, guardPos.x, guardPos.y, guardPos.z, 0.8f, -1, 0.05f, 1048580, 40000.0f);
TASK::TASK_ACHIEVE_HEADING(0, guardPos.h, 1500);
TASK::TASK_START_SCENARIO_IN_PLACE_HASH(0, MICS::GET_HASH_KEY(scenario), -1, true, true, 0.0f, true);
TASK::CLOSE_SEQUENCE_TASK(changePosSeq);
TASK::TASK_PERFORM_SEQUENCE(ped, changePosSeq);
TASK::CLEAR_SEQUENCE_TASK(&changePosSeq);

I use this in my gang hideouts to make them move around and do stuff. Put zeros in the sequence in place of the ped handles, only use the actual ped in the perform sequence line.

Edited by crossed99

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

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.