What on earth is the intended behavior of this thing? It seems to me that like half of the state's code can be removed without any negative consequences. Even then it still wouldn't work without a few modification but I assume that they didn't add half this stuff just for the lulz.
Original code:
Code: Select all
state() TriggerPound
{
function Timer ()
{
if (poundTime >= RemainOnTime)
Disable ('Timer');
poundTime += ChangeTime;
Direction *= -1;
SetTimer (ChangeTime, false);
}
function Trigger( actor Other, pawn EventInstigator )
{
if ( SavedTrigger!=None )
SavedTrigger.EndEvent();
SavedTrigger = Other;
SavedTrigger.BeginEvent();
Direction = 1;
poundTime = ChangeTime; // how much time will pass till reversal
SetTimer (ChangeTime, false); // wake up when it's time to reverse
Enable ('Timer');
bStopTick=False;
}
function Reset()
{
SetTimer(0,false);
Enable('Timer');
Global.Reset();
}
}Code: Select all
state() TriggerPound
{
function Timer ()
{
Direction *= -1;
bStopTick=False;
}
function Trigger( actor Other, pawn EventInstigator )
{
if ( SavedTrigger!=None )
SavedTrigger.EndEvent();
SavedTrigger = Other;
SavedTrigger.BeginEvent();
if ( bInitiallyOn ) Direction = -1.0;
else Direction = 1.0;
SetTimer (RemainOnTime, false); // wake up when it's time to reverse
Enable ('Timer');
bStopTick=False;
}
function Reset()
{
SetTimer(0,false);
Enable('Timer');
Global.Reset();
}
}Also, Why is Direction set in BeginPlay when every state already sets this by itself?
I hope My questions here aren't too stupid (they probably are though
