Check if a monster is awake in ACS

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!)
Bauul
Posts: 78
Joined: Mon Aug 29, 2016 4:23 pm

Check if a monster is awake in ACS

Post by Bauul »

Is there anyway in ACS to check if a monster is awake?

I'm trying to write a script that removes a monster if its dormant, but leaves it alone if it's been woken up. But for the life of me I can't find any way to return whether the monster is awake or not!

Anyone any ideas?
User avatar
m8f
 
 
Posts: 1446
Joined: Fri Dec 29, 2017 4:15 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Manjaro Linux
Location: Siberia (UTC+7)

Re: Check if a monster is awake in ACS

Post by m8f »

Are you targeting Zandronum?
Because if not, this thing can be done in ZScript, and ZScript can be called from ACS.
Gez
 
 
Posts: 17934
Joined: Fri Jul 06, 2007 3:22 pm

Re: Check if a monster is awake in ACS

Post by Gez »

For pure ACS, as I said on Doomworld, I suggest putting a TID on the player and then using APROP_TargetTID to find out if they target the player.
User avatar
m8f
 
 
Posts: 1446
Joined: Fri Dec 29, 2017 4:15 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Manjaro Linux
Location: Siberia (UTC+7)

Re: Check if a monster is awake in ACS

Post by m8f »

Monsters can target other monsters, too.
Also, I didn't check APROP_TargetTID, but actor's Target is non-null for dead monsters, so health check is needed.

Return to “Scripting”