TickFX seems to handle the update of some effects.
Process%HitEffects seems to be what creates the gibs when the pawn gets hit. This would mean that:
Code:
SimHitFxTicker != HitFxTicker
means the pawn the got hit.
Code:
HitFxTicker = HitFxTicker + 1;
if (HitFxTicker > ArrayCount(HitFX) - 1)
HitFxTicker = 0;
Interesting...
DoDamageFX (xPawn line 672), this is what causes the value change of HitFxTicker in line 759.
DoDamageFX is called in PlayHit (xPawn line 959) which gets called by TakeDamage (Pawn line 2029) on line 2075:
Code:
PlayHit(actualDamage,InstigatedBy, hitLocation, damageType, Momentum);
DoDamageFX is also called on line 2358 of the function TakeDamage in the state Dying of Pawn (state Dying on line 2196).
SO basically if you want to prevent Process%HitFX from being called, then you should block the change of HitFxTicker.
You could either do this by overriding the function TakeDamage and after calling super.TakeDamage setting HitFxTicker to a constant value or by overriding the Tick from xPawn and make it look like this:
Code:
simulated function Tick(float DeltaTime)
{
if (Level.NetMode == NM_DedicatedServer)
return;
if (Controller != None)
OldController = Controller;
HitFxTicker = 0;
TickFX(DeltaTime);
if (bDeRes)
TickDeRes(DeltaTime);
}
If you want to gib, then you could do something like:
Code:
if (!bGib)
HitFxTicker = Buffer; // Buffer would be a global variable to store the constant value for HitFxTicker
TickFX(DeltaTime);
if (bGib) Buffer = HitFxTicker; // Since HitFxTicker increases in DoDamageFX, I think we might need it to increase.
Hope this works out, good luck.
Bookmarks