Game Development Community

Run_xx_Animation not being regonized

by Stephen Howe · in TGB Platformer Kit · 04/07/2008 (7:57 pm) · 4 replies

In making my own character I wanted to try doing non-stock anim types (ones not included in the tutorial). My prefix in my datablock is "Bob". I made a "BobRunJumpAnimation" & "BobRunFallAnimation". If I use the prefix it doesn't automatically load up & use those animation.

If I don't use a spawner & datablock & do everything "manually" via the Behaviors & specify the animations, it works. If I set the prefix in the animation behavior it doesn't auto-detect the animation, I still need to manually specify it.

I've triple checked my spelling (even copied/pasted from the idle animation, which works fine), took a look in the actoranimationbehavior.cs behavior to see if there were any errors on those lines, but they look good.

Adding it to the datablock doesn't work either. I have this line in my datablock:
_Behavior2			= "ActorAnimationBehavior	DatablockPrefix	Bob	ScaleVolume	0	RunJumpAnim BobRunJumpAnimation";
but it doesn't load up that animation. I STILL need to manually specify it via a behavior.

Ideas?

#1
04/08/2008 (12:45 pm)
This is really strange, I don't have time to look at it this morning, but I can dig around the code tonight. For the timebeing, can you throw in a few echoes in the registerState function inside the animation manager? Just see what strings are being produced and if they are considered as objects at that stage of loading. It could be that the behavior is being initiated before the datablocks are loaded?

Cheers mate
#2
04/08/2008 (9:48 pm)
Found where it's going wrong. Even though I have the secondary animations it's always falling back to the fallback anim.

// Check if we have a fallback and an animation for this state
	if (%fallback !$= "" && !isObject(%animationDatablock))
		%animationDatablock = %this.getFieldValue(%fallback @ "Anim");

Disable the fallback & it works fine (none of the main anim's have fallbacks, they ARE the fallback). So it's ALWAYS saying we need the fallback anim here.

However, then the fallback doesn't seem to work, it keeps playing the current anim until a new state would be called.

what might be a better (or not, I'm not 100% sure how TGB works) is to give all anim's a fallback (IE idle) & check to see if a specific anim is available. If not, fallback to idle.

FYI, all the echo's look fine. it is looking for runjumpanimation.
#3
06/23/2009 (9:20 pm)
Bumping this thread since it looks like it fits my problem. I think in the latest version of PSK, Stephen's solution does not apply since all of the "state" functions are not in script? In any event, anything I change in ActorAnimationBehavior has no effect. My understanding is those functions are not used in script.

I have an animation called heroRunFallAnimation, but it isn't being when I run the game.
#4
06/26/2009 (1:45 am)
Jacob, I think that some of the secondary animation like RunFall and RunJump haven't been hooked up correctly. It is definitely something on my list of things to do.