Animations
by Adam Gardner · in Torque 3D Professional · 04/06/2012 (12:55 am) · 4 replies
OK well Ive just bought the zombie pack and im using the %obj.setActionThread("Attack1"); and it doesn't play while walking and will stop playing when you start running is there any way to play while running?
#2
The first way would be to change a few lines of code in "Player::pickActionAnimation" (player.cpp). You could add some checks to see if a character is attacking, and if he is then don't set a new action thread. This probably wouldn't be best as it would cause the zombies to slide while attacking.
You should probably look into blend animations. Blend animations are played on top of other animation. They allow for things like the player's head being able to look around while moving. These are not usually played like normal animations, but I remember an old resource that allowed for playing arm animations all the way through. A quick search for "Server Side Melee System" should prove fruitful.
Blend animations can be a bit tricky. I used that resource I mentioned just for the code on playing arm animations through. Then I used normal (non-blended) animations that only controlled the upper body to get my zombies to attack while running. You still have to make the attack animations yourself however.
I gotta ask though; do you really want to have them attacking while moving? See, I thought I did too, but after awhile I realized that having them stop to attack was really the best way to go for me. What you're trying to do is entirely possible. It's just going to take some work.
04/06/2012 (8:44 am)
By default, user set action animations are overridden by the engine if the player is moving. There are a few ways to do this though.The first way would be to change a few lines of code in "Player::pickActionAnimation" (player.cpp). You could add some checks to see if a character is attacking, and if he is then don't set a new action thread. This probably wouldn't be best as it would cause the zombies to slide while attacking.
You should probably look into blend animations. Blend animations are played on top of other animation. They allow for things like the player's head being able to look around while moving. These are not usually played like normal animations, but I remember an old resource that allowed for playing arm animations all the way through. A quick search for "Server Side Melee System" should prove fruitful.
Blend animations can be a bit tricky. I used that resource I mentioned just for the code on playing arm animations through. Then I used normal (non-blended) animations that only controlled the upper body to get my zombies to attack while running. You still have to make the attack animations yourself however.
I gotta ask though; do you really want to have them attacking while moving? See, I thought I did too, but after awhile I realized that having them stop to attack was really the best way to go for me. What you're trying to do is entirely possible. It's just going to take some work.
#3
same happened for me.not only with zombie but with others model.but in other engine same animation with blending is ok.i have to say their is something wrong with t3d's blending system.it does not show blended animation properly in shape editor.in shape editor when u select an animation to blend with other u will not be able to see actual one that will be played in game time.
do we have any other option?
04/06/2012 (9:24 am)
Quote:it would cause the zombies to slide while attacking.
same happened for me.not only with zombie but with others model.but in other engine same animation with blending is ok.i have to say their is something wrong with t3d's blending system.it does not show blended animation properly in shape editor.in shape editor when u select an animation to blend with other u will not be able to see actual one that will be played in game time.
Quote:I gotta ask though; do you really want to have them attacking while moving?
do we have any other option?
#4
04/07/2012 (7:53 am)
Quote:i have to say their is something wrong with t3d's blending systemI'm note sure something is actually wrong with it, but it is very confusing to work with at times. I personally like to avoid using blend animations whenever possible. :p
Quote:do we have any other option?Every game is different, so you might need this. Otherwise you could just have the zombie stop, attack, and then run again.
Ahsan Muzaheed
Default Studio Name
it will add this line in your models *.cs file
function YourModelDts::onLoad(%this)
{
.
.
.
%this.setSequenceCyclic("Attack1", "0");//this one
}
then use
%this.setActionThread("Attack1",false,true);
instead of
%obj.setActionThread("Attack1");