[No] Request: Zscript SetDamageFactor()

Moderator: GZDoom Developers

Request: Zscript SetDamageFactor()

Postby malon3 » Tue Mar 15, 2022 4:34 pm

Case:
setting a monsters damage factor from an event

ApplyDamageFactor() and ApplyDamageFactors() do not alter the current damagefactors, but simply perform calculations based on it.


myactor.damagetype = "whatever";
myactor.damagefactor = 0.0;

This does not make an actor immune to that specific damagetype, it simply makes them immune to everything because the correlation between the damagetype and damagefactor isnt set
malon3
 
Joined: 26 Dec 2008

Re: Request: Zscript SetDamageFactor()

Postby Graf Zahl » Wed Mar 16, 2022 1:15 am

The DamageType variable you set is not for receiving damage but for inflicting damage. The data you are looking for is stored elsewhere, but due to the complexity this is per-class data so it cannot be changed for a single actor. Changing this would add major complications to the damage system so it won't be done.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Request: Zscript SetDamageFactor()

Postby Gez » Wed Mar 16, 2022 10:59 am

Can non-players make use of powerups? If you use a script to give a PowerProtection item to a monster...
Gez
 
 
 
Joined: 06 Jul 2007

Re: Request: Zscript SetDamageFactor()

Postby phantombeta » Wed Mar 16, 2022 1:01 pm

Gez wrote:Can non-players make use of powerups? If you use a script to give a PowerProtection item to a monster...

You can, indeed. And with ZScript, you can just use the Inventory::ModifyDamage virtual to do this directly, and be able to set the damage factors programmatically.
User avatar
phantombeta
Tired of being treated like trash by control freaks
 
Joined: 02 May 2013


Return to Closed Feature Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest