Something I'm not understanding regarding animation calls in a playerpawn. I have overridden state PlayerWalking(), function TweenToRun(), and function PlayRunning(). I have replaced several calls of:
Code: Select all
native(259) final function PlayAnim( name Sequence, optional float Rate, optional float TweenTime );
native(260) final function LoopAnim( name Sequence, optional float Rate, optional float TweenTime, optional float MinRate );
native(294) final function TweenAnim( name Sequence, float Time );
native(293) final function name GetAnimGroup( name Sequence );
Problem is my function call to a separate actor that I've inserted into PlayRunning ("AnimManager.PlayAnimation(...);")
or
("UpdateAnim(PawnSpriteAnim);")
isn't going through.
I've assigned texture sets through some if statements in TweenToRunning
(ex: "if ( SpriteIndex == 0 ^^ SpriteIndex == 8 ){Sprites[0].CurrentSet = Sprites[0].RunForward;}") but I can't test if this is working without my animation playing.
Code: Select all
state PlayerWalking
{
ignores SeePlayer, HearNoise, Bump;
[...]//=========================//[...]
function AnimEnd()
{
local name MyAnimGroup;
bAnimTransition = false;
if ( Physics == PHYS_Spider )
{
if ( VSize(Velocity) line 452
AnimSequence = MyAnimGroup;
}
[...]//=========================//[...]
function BeginState()
{
WalkBob = vect(0,0,0);
DodgeDir = DODGE_None;
bIsCrouching = false;
bIsTurning = false;
bPressedJump = false;
if (Physics != PHYS_Falling)
SetPhysics(PHYS_Walking);
TweenToWaiting(1.0);
PlayWaiting();
UpdateAnim(PawnSpriteAnim);
/*if ( !IsAnimating() ) // AnimCode
{
}*/
}
function EndState()
{
WalkBob = vect(0,0,0);
bIsCrouching = false;
SetCrouch(false);
}
}
Code: Select all
function TweenToRunning(float tweentime)
{
BaseEyeHeight = Default.BaseEyeHeight;
if ( SpriteIndex == 0 ^^ SpriteIndex == 8 ){Sprites[0].CurrentSet = Sprites[0].RunForward;}
else if ( SpriteIndex == 1){Sprites[0].CurrentSet = Sprites[0].RunForwardRight;}
else if ( SpriteIndex == 2){Sprites[0].CurrentSet = Sprites[0].RunRight;}
else if ( SpriteIndex == 3){Sprites[0].CurrentSet = Sprites[0].RunBackRight;}
else if ( SpriteIndex == 4){Sprites[0].CurrentSet = Sprites[0].RunBack;}
else if ( SpriteIndex == 5){Sprites[0].CurrentSet = Sprites[0].RunBackRight;}
else if ( SpriteIndex == 6){Sprites[0].CurrentSet = Sprites[0].RunRight;}
else if ( SpriteIndex == 7){Sprites[0].CurrentSet = Sprites[0].RunForwardRight;}
if (bIsWalking)
{
TweenToWalking(0.2);
return;
}
}
Code: Select all
function PlayRunning()
{
BaseEyeHeight = Default.BaseEyeHeight;
PawnSpriteAnim.AnimFrames = Sprites[0].CurrentSet;
UpdateAnim(PawnSpriteAnim);
}
Code: Select all
function UpdateAnim(SpriteAnimation PawnSpriteAnim)
{
log("UpdateAnimDing!!");
AnimManager.PlayAnimation( self, PawnSpriteAnim, PawnSpriteAnim.DefaultAnimTime, -1, '', false );
}