SetDamageFunction
Moderator: GZDoom Developers
SetDamageFunction
Currently there is no way no change the damage of an already spawned actor to a fixed, non-random damage amount, since SetDamage randomizes the damage.
Re: SetDamageFunction
In the exact form suggested by the topic title this basically wouldn't be possible since ZScript has no way to pass a function to a function - DamageFunction is a compile time mechanism. This seems quite hard to solve in the general case but in the case that you actually programmed the actors that need this done, keep in mind that DamageFunction is an actual ZScript expression and can do anything they can - including calling a defined function with much more complicated internals, via just DamageFunction DefinedFunctionName();. Then that function can contain if statements, read member variables, etc. This way you can effectively do arbitrary DamageFunction behaviours including just reading your own damage value.
Re: SetDamageFunction
Ah, I understand. Actually, I wanted it for one complicated use of altering an existing vanilla projectile, even if it is replaced, but I'll have to do it some other way then (WorldThingDamaged, probably). Thanks for the explanation.
