Can't get animations to play
by Justin Tolchin · in Torque Game Engine · 02/24/2005 (1:35 pm) · 7 replies
Well actually the problem is that I can't get the animation that I *want* to play to play, and I can't the animation that I *don't* want to play to stop playing. :-)
We are just starting with our animations so it's all new to me. We have a character model (.dts) generated from 3DS Max 7 that contains two sequences: "idle" and "walk". I guess because the "walk" sequence was created first, it shows up as sequence 0 in the dump.dmp and the "idle" sequence is sequence 1. I don't know if this is a problem or not. When the character is first placed in the world he starts his walking animation, which I don't want. I want the idle animation. So I figured in the "createPlayer" script I could just call a method to set the animation sequence to "idle". I have tried the following methods (some from the console, some from the scripts):
playThread(0, "idle")
pauseThread(0)
stopThread(0)
playRootAnimation()
setActionThread("idle")
Nothing has any affect, and I've tried different thread values from 0-3. The model continues the walking animation. Can anyone tell me generally what I'm supposed to be calling here?
Also, how can I change the order that the sequences get exported, or does it even matter?
Thanks!
P.S. I am using the RTS kit, but I thought this question was general enough to post in the TGE forum.
We are just starting with our animations so it's all new to me. We have a character model (.dts) generated from 3DS Max 7 that contains two sequences: "idle" and "walk". I guess because the "walk" sequence was created first, it shows up as sequence 0 in the dump.dmp and the "idle" sequence is sequence 1. I don't know if this is a problem or not. When the character is first placed in the world he starts his walking animation, which I don't want. I want the idle animation. So I figured in the "createPlayer" script I could just call a method to set the animation sequence to "idle". I have tried the following methods (some from the console, some from the scripts):
playThread(0, "idle")
pauseThread(0)
stopThread(0)
playRootAnimation()
setActionThread("idle")
Nothing has any affect, and I've tried different thread values from 0-3. The model continues the walking animation. Can anyone tell me generally what I'm supposed to be calling here?
Also, how can I change the order that the sequences get exported, or does it even matter?
Thanks!
P.S. I am using the RTS kit, but I thought this question was general enough to post in the TGE forum.
#2
02/24/2005 (1:45 pm)
Hi Todd. I thought the intent of .dsq files was for animations that you wanted to share between characters/models. I was going to look into doing that next since we will probably want to share our walk sequence, etc., but for now I wanted to test out just triggering animations that were part of the .dts file. Isn't that possible?
#3
Here is a good link to a thread with someone asking if they should do the anims all in one file.
Also, here is a better link to setting up dsq files than the one I previously posted. It's kind of a long thread with some tangents but you should be able to glean enough information from it to get you rolling.
02/24/2005 (1:52 pm)
I believe it is possible but I haven't done it so I can't help you there unfortunately.Here is a good link to a thread with someone asking if they should do the anims all in one file.
Also, here is a better link to setting up dsq files than the one I previously posted. It's kind of a long thread with some tangents but you should be able to glean enough information from it to get you rolling.
#4
Thanks also for the thread postings. Believe me, I've been scouring the forums for what seems like the past month for various things, but it's hard to find the specific answers you need (especially when you have to search on a vague keyword like "animation"). :-)
Thanks again!
02/24/2005 (3:05 pm)
Thanks, Todd. I guess I'll go ahead and try the .dsq method for now and hopefully I can get it to work. I still think there ought to be a simple API for triggering sequences exported in the .dts but if I can use the .dsq's then I don't really care too much one way or the other.Thanks also for the thread postings. Believe me, I've been scouring the forums for what seems like the past month for various things, but it's hard to find the specific answers you need (especially when you have to search on a vague keyword like "animation"). :-)
Thanks again!
#5
I know how you feel about trying to find things based on vague searches. The worst is trying to search for things like "LOD" because its only 3 letters and always just gets ignored :(.
02/25/2005 (7:49 am)
There may be a simple method for doing it, I'm still pretty new to using the TGE myself. It is still a good idea to use dsq's for the animations though so that you can use cfg files to cull out nodes from the animation.I know how you feel about trying to find things based on vague searches. The worst is trying to search for things like "LOD" because its only 3 letters and always just gets ignored :(.
#6
I'm still not totally clear on how those different thread "channels" work, I need to realy dig through it more, but it seems to be that you have to explicitly stop the one you want to use if that channel is running a cyclic thread, before you tell it to use another one.
You should be able to play either of them whether it's loaded on the dts or saved separately as dsq files, though.
02/25/2005 (8:19 am)
Just out of curiousity, Justin, did you try going stopThread(0), and then subsequently going playThread(0,"idle")?I'm still not totally clear on how those different thread "channels" work, I need to realy dig through it more, but it seems to be that you have to explicitly stop the one you want to use if that channel is running a cyclic thread, before you tell it to use another one.
You should be able to play either of them whether it's loaded on the dts or saved separately as dsq files, though.
#7
Yep, I definitely tried that at some point. But I did a lot of this via the console, and one of the things I'm still unclear on is whether I'm supposed to stop/start animations on the client version of the object or the server version. However I did try both versions.
At least I'm pretty sure I did. :-) I noticed that the RTS script code would sometimes print out to the console the id of the object on the client and sometimes another number which I'm guessing was the id on the server. It just depended on the code being executed. For example, when I moved a unit, I would often see 2 lines gets printed when the unit arrived at its destination:
"unit 2225 has arrived at 40,50,60"
"unit 2221 has arrived at 40,50,60"
Since I was only moving 1 unit, I assumed the other number was the object id on the server and I tried using both to turn on/off the animations. I would type something like:
2225.stopThread(0);
or
2221.playThread(0, "idle");
in the console command line but nothing ever worked. I also tried doing this from the server script code as well using the actual object; i.e.
%player.stopThread(0);
02/25/2005 (9:55 am)
Hi Chris,Yep, I definitely tried that at some point. But I did a lot of this via the console, and one of the things I'm still unclear on is whether I'm supposed to stop/start animations on the client version of the object or the server version. However I did try both versions.
At least I'm pretty sure I did. :-) I noticed that the RTS script code would sometimes print out to the console the id of the object on the client and sometimes another number which I'm guessing was the id on the server. It just depended on the code being executed. For example, when I moved a unit, I would often see 2 lines gets printed when the unit arrived at its destination:
"unit 2225 has arrived at 40,50,60"
"unit 2221 has arrived at 40,50,60"
Since I was only moving 1 unit, I assumed the other number was the object id on the server and I tried using both to turn on/off the animations. I would type something like:
2225.stopThread(0);
or
2221.playThread(0, "idle");
in the console command line but nothing ever worked. I also tried doing this from the server script code as well using the actual object; i.e.
%player.stopThread(0);
Torque Owner Todd D. Degani
For instructions on exporting your animations as dsq's, look here