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
Request: Zscript SetDamageFactor()
Moderator: GZDoom Developers
-
- Lead GZDoom+Raze Developer
- Posts: 49117
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Request: Zscript SetDamageFactor()
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.
-
-
- Posts: 17900
- Joined: Fri Jul 06, 2007 3:22 pm
Re: Request: Zscript SetDamageFactor()
Can non-players make use of powerups? If you use a script to give a PowerProtection item to a monster...
-
- 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()
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.Gez wrote:Can non-players make use of powerups? If you use a script to give a PowerProtection item to a monster...