Additional jump animation
by genomegames · in Torque 3D Professional · 04/24/2011 (9:07 am) · 11 replies
Hello everybody!
I had to add additional jump animation. Standard two jump animations (JumpAnim and StandJumpAnim) finish correctly and to the end they call "animationDone" callback, but my new animations don't call. Why can it be?
I had to add additional jump animation. Standard two jump animations (JumpAnim and StandJumpAnim) finish correctly and to the end they call "animationDone" callback, but my new animations don't call. Why can it be?
About the author
#2
I know in updateActionThread there are conditions to call animationDone callback:
if (mActionAnimation.action == playerWomanData::NullAnimation ||
((!mActionAnimation.waitForEnd || mActionAnimation.atEnd)) &&
!mActionAnimation.holdAtEnd && (mActionAnimation.delayTicks -= !mMountPending) <= 0)
{
//The scripting language will get a call back when a script animation has finished...
// example: When the chat menu animations are done playing...
if ( isServerObject() && mActionAnimation.action >= playerWomanData::NumTableActionAnims )
{
Con::executef(mDataBlock, "animationDone",scriptThis());
}//if
If I define animation in the engine then animation sequence number is smaller then NumTableActionAnims, and animationDone will not called, and if I call my animation from the script it's sequence numberis bigger than NumTableActionAnims, and animationDone will called. My additional question: why do standard jump animations have the begger number if they defined in the engine? My added jump animations have smaller sequence numbers.
04/24/2011 (10:12 am)
I added two constants in the constant list in player.h, then added two filenames in the list in player.cpp, then modified updateMove: in my game the kind of jumping is depend of player mode (StadePose, CrouchPose, etc.), I added code to call different animations in different modes.I know in updateActionThread there are conditions to call animationDone callback:
if (mActionAnimation.action == playerWomanData::NullAnimation ||
((!mActionAnimation.waitForEnd || mActionAnimation.atEnd)) &&
!mActionAnimation.holdAtEnd && (mActionAnimation.delayTicks -= !mMountPending) <= 0)
{
//The scripting language will get a call back when a script animation has finished...
// example: When the chat menu animations are done playing...
if ( isServerObject() && mActionAnimation.action >= playerWomanData::NumTableActionAnims )
{
Con::executef(mDataBlock, "animationDone",scriptThis());
}//if
If I define animation in the engine then animation sequence number is smaller then NumTableActionAnims, and animationDone will not called, and if I call my animation from the script it's sequence numberis bigger than NumTableActionAnims, and animationDone will called. My additional question: why do standard jump animations have the begger number if they defined in the engine? My added jump animations have smaller sequence numbers.
#3
Your call is a result of a null animation call.
"animationDone" is executed on external animations only,called with from a script.
Implicit animations (like run,fall,jump,..) don't do it.
04/24/2011 (10:46 am)
No, they don't call "animationDone".Your call is a result of a null animation call.
"animationDone" is executed on external animations only,called with from a script.
Implicit animations (like run,fall,jump,..) don't do it.
#4
If an animation doesn't finish correctly than my animations triggers aren't called until one of the animations finish well.
04/24/2011 (11:06 am)
But standard jump animation (JumpAnim and StandJumpAnim) call animationDone. I tried on a clean project. In this case mActionAnimation.action is bigger than 511, I inserted output: Con::printf("%d", mActionAnimation.action);If an animation doesn't finish correctly than my animations triggers aren't called until one of the animations finish well.
#8
04/25/2011 (5:06 am)
Animation triggers call everytime until my character jumps using new jump animation, this animation isn't over and next animation trigger will not call, if next animation will play correctly, all will be normal.
#9
What is NullAnimation? How can I add others animations to NullAnimation?
04/25/2011 (9:13 am)
@Ivan What is NullAnimation? How can I add others animations to NullAnimation?
#10
This is a specific sequence number with atEnd = false all the time.
This animation has also several applications, for example you can bypass animation flags.
04/25/2011 (12:33 pm)
Treat NullAnimation as a sequence 511.This is a specific sequence number with atEnd = false all the time.
This animation has also several applications, for example you can bypass animation flags.
Associate Michael Hall
Distracted...