How much Damage taken?

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
Elias79
Posts: 50
Joined: Mon Jan 30, 2017 6:09 am

How much Damage taken?

Post by Elias79 »

Is there a built in function to to get information on how much damage taken from last attack, in this case the player, i have seen something like this in the mod "damnums" but that is for how much you did to other actors and not how much the player took from last attacks.

1. Is there a way to how much damage you took (the player) from last attack / attacks (max 1 tic)
2. If so can that value be accessed from ACS?
3. Is it it possible to calculate "Damage taken per second" (on the player)
4. When taking Damage and you want a "retribution" type "spell" to damage only the actor that attacked you, is that possible using ACS?
5. What internal information like this is exposed to the 3 scripting systems? Decorate, ACS, ZScript (never coded zscript yet)

Extra info: i am trying to recreate some mmorpg classes using scripted enchantments using ACS in doom.
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Re: How much Damage taken?

Post by Matt »

ZScript: An actor's DamageMobj() function, called whenever an actor takes damage, returns the amount of damage taken.

There's also the ThingDamaged() event, which would have the advantage of not needing to replace anything, but I've never used it so I can't really say how it works.

Anything else, I'd go into the thing that's causing the damage and retrieve the value from that - which is of course only the input value not the net damage done.
Post Reply

Return to “Scripting”