Okay Mr. Evil I have gotten it refreshing health within all states except for if I kill myself (by accident like damage from a rocket shot too close) and on suicide. I cannot find where UTPawn Handles this sort of damage in order to update it. I am wanting to write a tutorial on what all I have learned but I do not want to do it until I have it working 100%
Here is my Pawn Class so far.
Code:
class DeceitPawn extends UTPawn;
function TakeDamage(int Damage, Controller EventInstigator, vector HitLocation, vector Momentum, class<DamageType> DamageType, optional TraceHitInfo HitInfo, optional Actor DamageCauser)
{
super.TakeDamage(Damage, EventInstigator, HitLocation, Momentum, DamageType, HitInfo, DamageCauser);
SPlayerReplicationInfo(PlayerReplicationInfo).SetHealth(Health);
}
function PossessedBy(Controller C, bool bVehicleTransition)
{
Super.PossessedBy(C, bVehicleTransition);
SPlayerReplicationInfo(PlayerReplicationInfo).SetHealth(Health);
}
simulated function EndState(name NextStateName)
{
if (NextStateName != 'Dying')
{
SPlayerReplicationInfo(PlayerReplicationInfo).SetHealth(0);
}
}
defaultproperties
{
}
Bookmarks