Request: Zscript SetDamageFactor()

Moderator: GZDoom Developers

malon3
Posts: 103
Joined: Fri Dec 26, 2008 4:41 pm

Request: Zscript SetDamageFactor()

Post by malon3 »

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
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49117
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Request: Zscript SetDamageFactor()

Post by Graf Zahl »

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.
Gez
 
 
Posts: 17900
Joined: Fri Jul 06, 2007 3:22 pm

Re: Request: Zscript SetDamageFactor()

Post by Gez »

Can non-players make use of powerups? If you use a script to give a PowerProtection item to a monster...
User avatar
phantombeta
Posts: 2110
Joined: Thu May 02, 2013 1:27 am
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: Brazil

Re: Request: Zscript SetDamageFactor()

Post by phantombeta »

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.

Return to “Closed Feature Suggestions [GZDoom]”