Jump to content

Making PEDs ignore dead bodies


crossed99
 Share

Recommended Posts

Anyone know how to make PEDs ignore dead bodies?

Normally they walk up to the body then walk away, like they're fleeing (but only walking, not running) and they will do this instead of what I'm telling them to do.

Thanks!

Link to comment
Share on other sites

I think it's task 532. I tried something like:

if (TASK::GET_IS_TASK_ACTIVE(ped, 532))
	TASK::CLEAR_PED_TASKS(ped, 1, 1);

and it prevents them from randomly walking away, but sometimes they get locked up just staring at the corpse, I guess because task 532 is only thing they want to do and I'm keep cancelling it, so it doesn't work very well. Or is there a better way to do this?

Link to comment
Share on other sites

11 hours ago, LMS said:

It might be a shocking event that causes them to walk up to the body. Try removing/suppressing those.

I tried, but I couldn't make it work.. I also tried this: IS_SHOCKING_EVENT_IN_SPHERE looping through all the events from here: https://alloc8or.re/rdr3/doc/enums/eEventType.txt , but none of those seem to exist near the corpse somehow..

 

Enabling this works though: SET_BLOCKING_OF_NON_TEMPORARY_EVENTS, which would suggest it's some sort of event after all I guess, so idk, but this one also makes the ped ignore a lot of other things.

 

Also, making the ped a sanctioned shooter (?) seem to prevent them from freaking out:

PED::SET_PED_CONFIG_FLAG(ped, 347, true);

Not sure what else this does to them though.

 

Anyway, I can probably work with these, thanks both of you! If anyone else has ideas they'd be still welcome!

 

Link to comment
Share on other sites

On 10/31/2021 at 10:13 PM, crossed99 said:

I think it's task 532. I tried something like:

if (TASK::GET_IS_TASK_ACTIVE(ped, 532))
	TASK::CLEAR_PED_TASKS(ped, 1, 1);

and it prevents them from randomly walking away, but sometimes they get locked up just staring at the corpse, I guess because task 532 is only thing they want to do and I'm keep cancelling it, so it doesn't work very well. Or is there a better way to do this?

 

There are also functions for cancelling tasks "immediately" and cancelling "secondary" tasks.

In PDO I use the "immediately" function for some purposes - after cancelling one task, I give NPCs another one (this way the old one does not get triggered again).

But I guess you have already tried that :/

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.

 Share

×
×
  • Create New...