Game Development Community

Problem with Multiple Move Animation

by Adrian Bowden · in Technical Issues · 07/25/2008 (12:47 am) · 0 replies

Hi guys
Apologies if this is a simple question (or in the wrong forum even!) - newbie here & this will be my first post to the GG community :)

Firstly I have followed the swim / add animations tutorial & managed to get my guy to walk / run & sprint blah, blah - all based on his velocity etc. Works perfectly.

All went swimmingly well (...ugh) until I decided on using armThreads to get some sort of realistic 3rd person aiming action.

So I thought to get around the problem, I'd use full body animations when a weapon is not loaded & switch to a blend when a weapon is loaded (blend being split of top & bottom using .cfg etc.).

Problem I have is that if on launch the weapon is loaded, the player blend plays. However If on launch no weapon is loaded, the full body animation is used. Working exactly as expected - until I try to change the status mid game.

For example, the player loads without a weapon & when I then run over a new weapon, I'd like the animation to change to the "blend" so that the armThread works a bit better.

At first I tried in the weapon script but as you know, any move animations will pretty much kill script called anims, so it (I assume) needs to be done in code... Here is what I have so far...


Player::pickActionAnimation()...


...for (U32 i = 1; i < PlayerData::NumMoveActionAnims; i++)
{
PlayerData::ActionAnimation &anim = mDataBlock->actionList[i];
if (anim.sequence != -1 && anim.speed) {
F32 d = mDot(vel, anim.dir);
if (d > curMax)
{
curMax = d;
action = i;
forward = true;

if((i==PlayerData::RunForwardAnim)&&(d<=(mDataBlock->maxForwardSpeed/3)))
{
if(ShapeBase::getMountedImage(1) == NULL)
{
action = PlayerData::RunForwardAnim;
}
else
{
action = PlayerData::RunForwardAimAnim;
}

} else if((i==PlayerData::RunForwardAnim)&&(d>(mDataBlock->maxForwardSpeed/3)))

{
action = PlayerData::SprintAnim;
}


Sorry this is a bit of a ramble but hopefully you get the idea of what I am trying to achieve?

Problem is I can't use the blends all the time as the timing seems to go out from time to time when walking etc. & his arms tend to swing as and how they like (looks nuts)... also the setArmThread does not completely overwrite a full body animation & when aiming, his arm keeps bending at the shoulder & elbow making for a rather dangerous aiming technique?

Any help, direction here would be greatly appreciated!

Thanks for your time.

About the author

Recent Threads