Calculating damage dealt to mob via acs

Discuss all aspects related to modding Zandronum here.
Post Reply
BROS_ETT_311
New User
Posts: 14
Joined: Fri Mar 27, 2020 6:10 am

Calculating damage dealt to mob via acs

#1

Post by BROS_ETT_311 » Wed Mar 23, 2022 11:31 am

Not sure how feasible this is, or if it's even possible for that matter, but I'm trying to figure out how to calculate damage dealt to an enemy through acs.

What I'm aiming to do is get a return value to use as a jump state for different enemy deaths (e.g. if damage >= 25, "randomdeathstate"). Why? To see if I can trigger enemy deaths without replacing weapons or the use of spacial puff types...so vanilla weaponry. Hopefully the end result is better compatibility with weapon mods while maintainingg unique death states.

My guess is that the best way to do so would be calling the acs script through an enemy's pain state, with the use of GetActorProperty(0, APROP_Health); to store their current health somehow, then subtract their health property the next time damage is dealt in order to get the return value for said jump.

Hoping to get some insight here (and maybe some pointers if I'm lucky)!

Thanks!!

User avatar
Kaminsky
Developer
Posts: 193
Joined: Sun Apr 14, 2013 7:17 pm
Location: Canada

Re: Calculating damage dealt to mob via acs

#2

Post by Kaminsky » Thu Mar 24, 2022 2:23 am

Zandronum has an EVENT script type that triggers when an actor is just about to take damage. Have a look at this page: https://wiki.zandronum.com/EVENT_scripts because there's lots of information on how GAMEEVENT_ACTOR_DAMAGED works.

BROS_ETT_311
New User
Posts: 14
Joined: Fri Mar 27, 2020 6:10 am

Re: Calculating damage dealt to mob via acs

#3

Post by BROS_ETT_311 » Thu Mar 24, 2022 2:55 am

Kaminsky wrote:
Thu Mar 24, 2022 2:23 am
Zandronum has an EVENT script type that triggers when an actor is just about to take damage. Have a look at this page: https://wiki.zandronum.com/EVENT_scripts because there's lots of information on how GAMEEVENT_ACTOR_DAMAGED works.
OMG...wow that's literally what I'm looking for and even has an example of how to do it. Thanks!!

BROS_ETT_311
New User
Posts: 14
Joined: Fri Mar 27, 2020 6:10 am

Re: Calculating damage dealt to mob via acs

#4

Post by BROS_ETT_311 » Thu Mar 24, 2022 4:00 am

̶H̶o̶w̶ ̶e̶x̶a̶c̶t̶l̶y̶ ̶d̶o̶ ̶I̶ ̶g̶e̶t̶ ̶t̶h̶e̶s̶e̶ ̶s̶c̶r̶i̶p̶t̶s̶ ̶t̶o̶ ̶c̶o̶m̶p̶i̶l̶e̶?̶ ̶I̶'̶m̶ ̶f̶a̶i̶r̶l̶y̶ ̶c̶e̶r̶t̶a̶i̶n̶ ̶m̶y̶ ̶a̶c̶c̶ ̶i̶s̶ ̶u̶p̶ ̶t̶o̶ ̶d̶a̶t̶e̶ ̶(̶v̶.̶1̶.̶5̶8̶)̶,̶ ̶t̶h̶o̶u̶g̶h̶ ̶S̶l̶a̶d̶e̶ ̶d̶o̶e̶s̶n̶'̶t̶ ̶s̶e̶e̶m̶ ̶t̶o̶ ̶r̶e̶c̶o̶g̶n̶i̶z̶e̶ ̶t̶h̶e̶s̶e̶ ̶s̶c̶r̶i̶p̶t̶ ̶t̶y̶p̶e̶s̶.̶
Nvm, found the acc tools needed.

Post Reply