I've been investigating the Event Manager plugin as it doesn't reflect true weapon damage during events (as well as bleeding and relative HP screen effects) and I've navigated around bleeding and screen effects, but i can't seem to see how Event Manager goes about scaling weapon damage?
From my understanding it may be something to do with bullets sent and received not accounting for Armour? I tried the line "info.useprotection = true;" after looking at the properties of the HitInfo class, but it didn't seem to change anything.
I also have a suspicion it might have to do with DamgeTypes.Total() not factoring armor and only the type of damage?
Would anyone be able to point me in the right direction to resale the HP values to vanilla?
Event Manger Damage Properties
Discussion in 'Rust Development' started by Colata, Dec 3, 2017.
-
Would you be able to give me an example of how to implement it? I've tried
Code:float damageAmount = info.damageTypes.Total(); if (attacker != null) { if (!GetUser(attacker)) { NullifyDamage(info); return; } } if (player.health - damageAmount < 1) { info.damageTypes.ScaleAll(0.5f); NullifyDamage(info); OnPlayerDeath(player, info); return; }
Code:void NullifyDamage(HitInfo info) { info.UseProtection = true; info.damageTypes = new DamageTypeList(); info.damageTypes.ScaleAll(0.5f); info.HitEntity = null; info.PointStart = Vector3.zero; }
-
info.ScaleAll(0);
-
Hasn't changed anything.
-
Works for me
-