Universal script to make any monsters have fall damage?

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
User avatar
Spaceman333
Posts: 650
Joined: Thu Oct 13, 2016 8:40 pm

Universal script to make any monsters have fall damage?

Post by Spaceman333 »

Some newer mods feature the ability to "push" monsters via weapons, abilities or items, so I'd love to have a universal addon script that would apply fall damage, so I could have monsters actually die or get hurt when pushed off a cliff. Only the monsters, not the player though.

I also want to know if applying floor damage - liquids or floors that usually hurt the player - can also be applied to monsters too.

I'm new to zScript, so I want to ask how to go about making this work, or if it even is possible?
Jarewill
 
 
Posts: 1853
Joined: Sun Jul 21, 2019 8:54 am

Re: Universal script to make any monsters have fall damage?

Post by Jarewill »

You can set up an event handler to automatically give all monsters a special item.
In that item you can override DoEffect() to create a custom function of dealing fall damage.
For example:
Spoiler:
User avatar
Spaceman333
Posts: 650
Joined: Thu Oct 13, 2016 8:40 pm

Re: Universal script to make any monsters have fall damage?

Post by Spaceman333 »

Thank you, this helps a ton! :D
Post Reply

Return to “Scripting”