Game Development Community

how can i devide walking animation when magic casting

by Enel · in Torque 3D Professional · 09/16/2009 (8:30 am) · 13 replies

during magic casting animation is playing how can i avoid walk blend animation?

anyone know how to avoid blend animation ?

#1
09/16/2009 (11:49 am)
You must:

1) Define your casting animation with a priority higher than the walking one (can be done via script in the TSShapeConstructor using setSequencePriority()).

2) Remove all keyframes for the lower body joings (hips, legs, etc) from your casting animation, so only the upper body animates.

3) Play your animation using playThread() instead of setActionThread()

You might need some extra work because playThread() makes non-looking animations get stuck when they end.
#2
09/16/2009 (1:25 pm)
@Manoel Neto

Thx! Manoel
#3
09/16/2009 (3:00 pm)
Yes, playthread can be used to add an additional thread.
But you will lose the transition.
#4
09/16/2009 (4:35 pm)
With a few changes it is possible to add transition support to playThread. In ShapeBase::setThreadSequence() use transitionToSequence() instead of setSequence(). I did so in a past TGEA project ant it went fine. You might need to check if there is an active thread or not before transitioning... but I'm not sure.
#5
09/16/2009 (4:48 pm)
I found it:
www.garagegames.com/community/blogs/view/14629

I believe this should be integrated in stock T3D.
It will give the artists a better control over staticshapes and items.
#6
09/16/2009 (4:59 pm)
Yeah, the shapebase animation thread stuff should be a lot more flexible. It's counterproductive, specially for new users, to have to change the source code for such trivial animation setups.
#7
09/17/2009 (10:24 am)
//--- OBJECT WRITE BEGIN ---
function Warrior_Dts::onLoad(%this)
{
   %this.addSequence("art/shapes/players/Warrior/animations/Human_male_root.dsq", "root");
   %this.addSequence("art/shapes/players/Warrior/animations/Human_male_forward.dsq", "run");
   %this.addSequence("art/shapes/players/Warrior/animations/Human_male_back.dsq", "back");
   %this.addSequence("art/shapes/players/Warrior/animations/Human_male_leftside.dsq", "leftside");
   %this.addSequence("art/shapes/players/Warrior/animations/Human_male_rightside.dsq", "rightside");
   %this.addSequence("art/shapes/players/Warrior/animations/Human_male_jump.dsq", "jump");
   %this.addSequence("art/shapes/players/Warrior/animations/Human_male_standjump.dsq", "standjump");
   %this.addSequence("art/shapes/players/Warrior/animations/Human_male_att1.dsq", "h1thrust");
   %this.addSequence("art/shapes/players/Warrior/animations/Human_male_att2.dsq", "h1slice");
   %this.addSequence("art/shapes/players/Warrior/animations/Human_male_att3.dsq", "h1swing");
   %this.addSequence("art/shapes/players/Warrior/animations/Human_male_Spear_Attack.dsq", "SpearSwing");
   %this.addSequence("art/shapes/players/Warrior/animations/Human_male_Spear_Attack1.dsq", "SpearSlice");
   %this.addSequence("art/shapes/players/Warrior/animations/Human_male_Spear_Attack2.dsq", "SpearThrust");
   %this.addSequence("art/shapes/players/Warrior/animations/human_male_swimroot.dsq", "Swim_Root");
   %this.addSequence("art/shapes/players/Warrior/animations/human_male_swimforward.dsq", "Swim_Forward");
   %this.addSequence("art/shapes/players/Warrior/animations/human_male_swimback.dsq", "Swim_Backward");
   %this.addSequence("art/shapes/players/Warrior/animations/human_male_swimleft.dsq", "Swim_Left");
   %this.addSequence("art/shapes/players/Warrior/animations/human_male_swimright.dsq", "Swim_Right");
   %this.addSequence("art/shapes/players/Warrior/animations/human_male_fall.dsq", "fall");
   %this.addSequence("art/shapes/players/Warrior/animations/human_male_casting.dsq", "Magic_cast");   
   %this.setSequencePriority("Magic_cast", 0);
}

singleton TSShapeConstructor(Warrior_Dts)
{
   baseShape = "art/shapes/players/Warrior/warrior.dts";      
   upAxis = "DEFAULT";
   unit = "-1";
   canSaveDynamicFields = "1";
   Enabled = "1";
    
};

//--- OBJECT WRITE END ---


is it right?.. is priority 0 the highest priority?

and what can i make animation, blend or complete ?
#8
09/17/2009 (2:13 pm)
@picasso

how can i work this code?..

www.garagegames.com/community/blogs/view/14629


i dont understand plz explain this source code to me :)
#9
09/17/2009 (3:59 pm)
Without a transition you will get very sharp starting/ending of your animation.
Without a transition each time when you call playthread(),it calls setSequence().
With a transition playthread will call setSequence() the first time (just to handle the thread with a sequence),each next time it will call transitionToSequence() and will get smooth results.
#10
09/17/2009 (5:41 pm)
I don't remember exactly... I'm not sure if the sequence priorities are increasing (1 is higher priority than 0) or decreasing (0 is higher priority than 1).

If it's decreasing, you'll need to set every sequence priority to 1 and only your casting sequence priority to 0. If it's the other way, you only need to set your casting sequence priority to 1.
#11
09/18/2009 (4:22 am)
1 is higher than 0
#12
09/18/2009 (7:33 am)
@Piccaso

wow.. thx for your explane!
#13
03/15/2010 (9:02 am)
@Manoel - Is setting priority still necessary with the transition code added from the link:
www.garagegames.com/community/blogs/view/14629
?