Is there a "common denominator" for all damageable actors?

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!
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
Kzer-Za
Posts: 522
Joined: Sat Aug 19, 2017 11:52 pm
Graphics Processor: nVidia (Modern GZDoom)

Is there a "common denominator" for all damageable actors?

Post by Kzer-Za »

I thought about checking for "health > 0", but I'm not sure this is the right way.

I wanna give all actors that can reasonably expected to be damaged a certain item when they are spawned. I could check

Code: Select all

		if (event.thing is "PlayerPawn" || event.thing.bISMONSTER)
but that would leave out explosive pods, which also can be damaged and destroyed, and later I could add more destructible environment objects. Of course, I could just add all their classes to that condition, but before doing that I thought I should ask. Maybe there is a cover-all solution for all damageable actors.
Jarewill
 
 
Posts: 1855
Joined: Sun Jul 21, 2019 8:54 am

Re: Is there a "common denominator" for all damageable actor

Post by Jarewill »

How about checking the bSHOOTABLE flag?
You could also check if the actor doesn't have the bNODAMAGE flag if you want to leave actors like merchants from Strife out.
Kzer-Za
Posts: 522
Joined: Sat Aug 19, 2017 11:52 pm
Graphics Processor: nVidia (Modern GZDoom)

Re: Is there a "common denominator" for all damageable actor

Post by Kzer-Za »

Thanks, a combination of bSHOOTABLE and absence of bNODAMAGE sounds like a great idea!
User avatar
Arctangent
Posts: 1235
Joined: Thu Nov 06, 2014 1:53 pm
Contact:

Re: Is there a "common denominator" for all damageable actor

Post by Arctangent »

You might also want to check for bVULNERABLE. It's a pretty infrequent flag, but it nonetheless allows an non-SHOOTABLE actor to be damaged by splash damage.
Kzer-Za
Posts: 522
Joined: Sat Aug 19, 2017 11:52 pm
Graphics Processor: nVidia (Modern GZDoom)

Re: Is there a "common denominator" for all damageable actor

Post by Kzer-Za »

Thanks!
Post Reply

Return to “Scripting”