Monsters Checking For Corpses

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
Drake Raider
Posts: 474
Joined: Fri Jul 18, 2008 12:27 pm

Monsters Checking For Corpses

Post by Drake Raider »

How does the AI prevent monsters from seeing the corpses of friendly monsters? Does it check for the "Corpse" flag?

If so, would removing that flag and setting the "Friendly" flag on monsters when they die allow the AI to be alerted when coming across another dead monster? Or is there an easier way to do this?
Jarewill
 
 
Posts: 1853
Joined: Sun Jul 21, 2019 8:54 am

Re: Monsters Checking For Corpses

Post by Jarewill »

I am pretty sure monsters don't detect friendly monsters at all for performance reasons.
If you want to make monsters see dead monsters, here's how I did it in my mod:
Spoiler:
Put this Tick override within your monster's class in ZScript.
Or rather this is modified code that I'm not 100% sure will work, but it still might be a good start.
Drake Raider
Posts: 474
Joined: Fri Jul 18, 2008 12:27 pm

Re: Monsters Checking For Corpses

Post by Drake Raider »

I was curious what mod you were referring to, and just found Lost Frontier, is that a separate campaign for Strife or is it a gameplay mod? Because Strife is where I was planning to use it.

(Though this code is probably still good as a modder's resource, thank you!)
Post Reply

Return to “Scripting”