Time for action – Non-state functions from inside a state
Before we start this experiment, another cleanup job.
Delete the
LogMe
,LogTimer
, andPostBeginPlay
functions.Make sure the
LogMe
functions in all three states are deleted as well.We're going to write a new version of
TakeDamage
inside theSeeking
function. This will stop the non-state function from being called:event TakeDamage(int DamageAmount, Controller EventInstigator, vector HitLocation, vector Momentum, class<DamageType> DamageType, optional TraceHitInfo HitInfo, optional Actor DamageCauser) { `log("Seeking TakeDamage"); }
Let's also add a log to the non-state
TakeDamage
function:event TakeDamage(int DamageAmount, Controller EventInstigator, vector HitLocation, vector Momentum, class<DamageType> DamageType, optional TraceHitInfo HitInfo, optional Actor DamageCauser) { `log("Global TakeDamage"); if(EventInstigator != none && EventInstigator.PlayerReplicationInfo != none) WorldInfo.Game.ScoreObjective...