Letylove49 wrote: ↑Sat Mar 08, 2025 9:42 pm
hi, i'm looking for deathtype to exclud it for follow weapons :
You cannot determinate the damaging weapon in a TakeDamage() event, only the weapon the instigator currently holds. (If instigator's weapon has changed between shot and projectile impact, instigator's weapon is not the one which has caused damage and for example so the kill message mentions the "wrong" weapon.)
But each weapon has a property
MyDamageType
, for example
Code: Select all
class'ChainSaw'.MyDamageType=slashed
class'Enforcer'.MyDamageType=shot
class'ShockRifle'.MyDamageType=jolted (inherited to class'SuperShockRifle')
and if weapon's
ProjectileClass
is set, weapon's MyDamageType is changed to
ProjectileClass.Default.MyDamageType
in weapon's event PostBeginPlay. So for example MyDamageType is set to class'WarShell's MyDamageType ("RedeemerDeath") for the WarheadLauncher.
Mutator code:
Collect all wanted DamageTypes in a (configurable) array and check its entries against current DamageType in a Mutator's MutatorTakeDamage() event .
Stumbling blocks:
- you cannot distinguish ShockRifle and SuperShockRifle
- custom weapons may have the same DamageType as stock UT weapons
- maybe check instigator's weapon also but keep in mind weapon may have changed or instigator is dead or has left game