Request: Zscript SetDamageFactor()

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Request: Zscript SetDamageFactor()

Re: Request: Zscript SetDamageFactor()

by 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.

Re: Request: Zscript SetDamageFactor()

by 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...

Re: Request: Zscript SetDamageFactor()

by 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.

Request: Zscript SetDamageFactor()

by 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

Top