Why does torque override every animation when I move?
by Josh Albrecht · in Artist Corner · 01/27/2002 (9:24 am) · 23 replies
I have 3 animations, as follows:
1. An aiming animation, blend, priority 0.
2. A sword swinging animation, priority 1, blend.
3. A run animaiton, priority 0, blend(tried with normal to)
1 and 2 work perfeclty toghether.
1 and 3 work fine.
2 and 3 dont not work fine. The sword swing animation never plays if the paleyr is running, and if it is playing when he starts to run, then the swing gets cut off.
Any idea why I cannot swing and run at the same time? Any suggestions?
1. An aiming animation, blend, priority 0.
2. A sword swinging animation, priority 1, blend.
3. A run animaiton, priority 0, blend(tried with normal to)
1 and 2 work perfeclty toghether.
1 and 3 work fine.
2 and 3 dont not work fine. The sword swing animation never plays if the paleyr is running, and if it is playing when he starts to run, then the swing gets cut off.
Any idea why I cannot swing and run at the same time? Any suggestions?
#2
Priority 0 is the highest (I'm guessing) and 1 is the next down.
Try doing the run at 1 and the swing at 0?
Phil.
01/27/2002 (9:59 am)
Looks like your priority would mess that up to me Josh.Priority 0 is the highest (I'm guessing) and 1 is the next down.
Try doing the run at 1 and the swing at 0?
Phil.
#3
Tried it though, and it doesnt work. Any other ideas anyone?
01/27/2002 (10:06 am)
Thanks for the suggestion phil. :)Tried it though, and it doesnt work. Any other ideas anyone?
#4
For the sword swinging sequence, just make sure the upper body node, or just the arm node are in the Always Export column:
Oh, the sequence shouldn't be a blend either. If you have any kind of 'look' sequence, the sword swing sequence priority should be higher than that.
Hope this made sense ;)
Oh yeah, the higher the number, the higher the priority :D
01/27/2002 (10:25 am)
Ok...when you created the running anmation, did you animate the arms at all? If so, try removing any arm animation that's in the sequence. Also, make sure your .CFG doesn't have any upper body nodes listed in the Always Export column. Try and have it like this:Quote:
AlwaysExport:
Eye
Cam
mount*
Bip01
Bip01 Spine
Bip01 L Thigh
Bip01 L Calf
Bip01 L Foot
Bip01 R Thigh
Bip01 R Calf
Bip01 R Foot
Bip01 Pelvis
For the sword swinging sequence, just make sure the upper body node, or just the arm node are in the Always Export column:
Quote:
AlwaysExport:
eye
cam
mount*
Bip01 L UpperArm
Bip01 L Forearm
Bip01 L Hand
Bip01 R UpperArm
Bip01 R Forearm
Bip01 R Hand
Bip01 Spine1
Bip01 Spine2
Oh, the sequence shouldn't be a blend either. If you have any kind of 'look' sequence, the sword swing sequence priority should be higher than that.
Hope this made sense ;)
Oh yeah, the higher the number, the higher the priority :D
#5
01/27/2002 (4:01 pm)
Hmmm, what if I WANTED the run to have arm animation? What would I do then? Is there a way to seperate the run (upper body) from the run (lower body) ?
#6
Play them both at the same time in different threads.
01/27/2002 (5:14 pm)
Yes, export the animation twice. On the first one cull out the upper body, on the secone cull out the lower body (using your .cfg files) Play them both at the same time in different threads.
#7
How are you running the animations? Are you running your own threads in C++ code, or trying to do it with the existing player actions and script mehods? I can go into different amounts of detail accordingly :)
01/28/2002 (9:20 am)
Ok, this get's complicated. Running multiple animations can get tricky as there are number of ways to organize it, and the way the player currently animates may not be what you want.How are you running the animations? Are you running your own threads in C++ code, or trying to do it with the existing player actions and script mehods? I can go into different amounts of detail accordingly :)
#8
Any ideas?
Thanks alot guys! :)
01/28/2002 (3:14 pm)
I let torque use the defualt cod efor run and aim animations, and I have a commandtoserver that I bound to a key for my swing animation. I am not sure on how I would get two threads (upper and lower run) to play player at the same time without adding extra code...Any ideas?
Thanks alot guys! :)
#9
One thing to try... the shapebase class allows you to play up to four threads on any shape. You could try playing the swing using the playThread, stopThread script methods.
Something else you could try... the player class runs a thread to deal with weapon recoils that affect the arms. The recoil is activated from the weapon state tables (in script) so you could set it up to swing the arm when you press the fire button (basically play the recoil).
I'm not sure what the default priority of the sequences is. In the old (Tribes 1) engine before this one, the default sequence priority was the distance of it's first animated bone from the root bone (in # of links). So something animating the root would have the highest priority. I'm not sure this latest incarnation of TS is setup up this way though.
You could also try the swing as a blend on top of the default arm position, in that case the priority doesn't matter. Priority is only an issue when multiple sequences are trying to animate the same bone. Setting higher priority let's one sequence override the bone transforms in another.
01/28/2002 (7:12 pm)
If you call the script setActionThread(), it will override the run. That function plays the sequence on the same thread as the run/walk/jump animations. It wouldn't be to hard to add another thread.One thing to try... the shapebase class allows you to play up to four threads on any shape. You could try playing the swing using the playThread, stopThread script methods.
Something else you could try... the player class runs a thread to deal with weapon recoils that affect the arms. The recoil is activated from the weapon state tables (in script) so you could set it up to swing the arm when you press the fire button (basically play the recoil).
I'm not sure what the default priority of the sequences is. In the old (Tribes 1) engine before this one, the default sequence priority was the distance of it's first animated bone from the root bone (in # of links). So something animating the root would have the highest priority. I'm not sure this latest incarnation of TS is setup up this way though.
You could also try the swing as a blend on top of the default arm position, in that case the priority doesn't matter. Priority is only an issue when multiple sequences are trying to animate the same bone. Setting higher priority let's one sequence override the bone transforms in another.
#10
I DO use setActionThread("threadname");, but unlike what you said, it does NOT override my walking animation... even when the priority is higher.
Adding another thread is an interesting idea... woudl this create the need for ALOT of changes in the animation functions? Or does the player class already support multiple simultaneous threads? It would appear so, given the stuff like ArmThread...
I cant use the ShapeBase animations for swings, since there will be ALOT more than 4 attack animations... Is there are reason that it was limited to four?
That is a very nice idea with the recoil, though it would be a mild bit of a hack.
Nothing that I have seen in the engine idicates that animations with a higher nubmer of links have precendence, but I will check again.
I did try making the swing animation a blend, and it exported correctly, but it did not play while the walk played.... It did play while standing still. What could be causing this? Do blend animaitons (like my swing) always need a reference point, or is that just for blends like aim?
Thanks for your help! :)
01/29/2002 (4:07 pm)
Mr. Gift:I DO use setActionThread("threadname");, but unlike what you said, it does NOT override my walking animation... even when the priority is higher.
Adding another thread is an interesting idea... woudl this create the need for ALOT of changes in the animation functions? Or does the player class already support multiple simultaneous threads? It would appear so, given the stuff like ArmThread...
I cant use the ShapeBase animations for swings, since there will be ALOT more than 4 attack animations... Is there are reason that it was limited to four?
That is a very nice idea with the recoil, though it would be a mild bit of a hack.
Nothing that I have seen in the engine idicates that animations with a higher nubmer of links have precendence, but I will check again.
I did try making the swing animation a blend, and it exported correctly, but it did not play while the walk played.... It did play while standing still. What could be causing this? Do blend animaitons (like my swing) always need a reference point, or is that just for blends like aim?
Thanks for your help! :)
#11
On the ShapeBase thing, you can play up to four animations at the same time, not four total. If you have more than four attack animations going on at once, it may get a little confusing. You might want to reconsider ;)
The recoil is a hack, I just threw it out there though :)
On the blend... as I mentioned ubove, the actions set from the scripts are overriden by the player as soon as he moves. A player feature, not an animation issue. Sounds like you should use the ShapeBase animation methods.
01/29/2002 (4:17 pm)
It doesn't override the run/walk? that's wierd, is it playing at all? The other thing about the setAction, is that the player will abort that animation as soon as you move. This has nothing to do with animation priority, just the way the player is coded :)On the ShapeBase thing, you can play up to four animations at the same time, not four total. If you have more than four attack animations going on at once, it may get a little confusing. You might want to reconsider ;)
The recoil is a hack, I just threw it out there though :)
On the blend... as I mentioned ubove, the actions set from the scripts are overriden by the player as soon as he moves. A player feature, not an animation issue. Sounds like you should use the ShapeBase animation methods.
#12
Is there some special way that I need to setup the animations (ie not using a .cs file, or using a differnet format in one) so that they will work for the shapebase methods?
Yeah, I didnt intend on having four attack animations going on at once. :)
Thanks alot. This makes alot more sense now. :)
01/29/2002 (6:20 pm)
Ahhh... Thank you very much for clarifying that. So if the player is running, you cannot set another animation if the run key is still held, correct? Is there some special way that I need to setup the animations (ie not using a .cs file, or using a differnet format in one) so that they will work for the shapebase methods?
Yeah, I didnt intend on having four attack animations going on at once. :)
Thanks alot. This makes alot more sense now. :)
#13
Nothing special about the shape base animations methods, just call the sequences by name. You can play any sequence in the dts file (or pre-loaded dsq).
01/29/2002 (7:05 pm)
That is correct, while the player is running or performing any other action. Basically the setAction animations only work when the player is standing still, or has been disabled (such as when his is dead).Nothing special about the shape base animations methods, just call the sequences by name. You can play any sequence in the dts file (or pre-loaded dsq).
#14
*if this question is too dumb, please ignore...*
05/21/2006 (5:49 pm)
So... how do I actually do this? I created a swing animation "slash.dsq". How do I put it in shapebase? what is a shapebase? is there an exaple script how this is done? in client's config file? player's server file?*if this question is too dumb, please ignore...*
#15
05/25/2006 (6:59 am)
Don't think the question is to dumb, I just think that nobody knows. Ive look everywhere for info on this subjuct
#16
Normally your best option is to add new sequence lines at the bottom of the list, and then your animations can be referenced via script by name.
05/25/2006 (1:41 pm)
/data/shapes/player/player.cs has a datablock called TSShapeConstructor(PlayerDts) that maps new .dsq animations to a name, and a sequence number.Normally your best option is to add new sequence lines at the bottom of the list, and then your animations can be referenced via script by name.
#17
@Stephen: Yes, It's there. I'm guessing that we can add as many Animation in TSShapeConstructor and call the animation from script-server side? I will look into this. Thank you.
05/25/2006 (8:26 pm)
@Caleb: Thanks for your reply. I thought I was the only one who's struggling finding solution to these issues (in the forum). @Stephen: Yes, It's there. I'm guessing that we can add as many Animation in TSShapeConstructor and call the animation from script-server side? I will look into this. Thank you.
#18
I've been spending the past few days trying to get my throw animation to stop canceling whenever the player moved. So should I stop trying to fix it, is it impossible with stock Torque?
07/12/2008 (2:35 pm)
Is it not possible then? Will walk animation always override added animations? Thats the conclusion I got from reading all these posts. Did I miss something or has someone figured out how to override the walk animation?I've been spending the past few days trying to get my throw animation to stop canceling whenever the player moved. So should I stop trying to fix it, is it impossible with stock Torque?
#19
For some things, you just need to change the source code. It would be pointless to try and code every possible adaptation every game would ever need. The example Player class probably does far too much stuff already.
07/12/2008 (5:10 pm)
The Player has to be specially constructed to do what you want, unless what you want is exactly what it already does. ;)For some things, you just need to change the source code. It would be pointless to try and code every possible adaptation every game would ever need. The example Player class probably does far too much stuff already.
#20
EDIT: Wow, just looked through the player.h and player.cc files in the code and I have no clue what's going on (I've never dealt with the engine or C++ before).
Anybody have any tips on where to start?
07/12/2008 (6:00 pm)
So it can't be done in script? All right, I guess I'll start looking at the code then. Thanks for the help.EDIT: Wow, just looked through the player.h and player.cc files in the code and I have no clue what's going on (I've never dealt with the engine or C++ before).
Anybody have any tips on where to start?
Torque 3D Owner Luigi Rosso
That'd be of some help as that animation plays even when you're running.
I can't help as honestly I don't know, what you've done seems correct...