Game Development Community

How to animate a dts object other than the built in player

by Western Outdoor Interactive · in Torque Game Engine · 02/22/2006 (3:58 am) · 6 replies

Hi

I want to know how to animate a dts object other than the built in player or vehicle , that means any other item (a dts object having some animation) added to the world . I want to know how to start one animation , switch from one animation to another and how to stop and hide an existing animation.

#1
02/22/2006 (5:44 am)
In a nut shell the code to play an animation is
%obj.playThread(0, "animationName");
to stop animation
%obj.stopThread(1);


Do a search for playthread and you will find a wealth of information on the subject.
#2
02/22/2006 (7:13 am)
I have a question: I thought the first parameter of the *Thread() functions was the Animation Thread slot to run the sequence?

In the second bit; aren't you stopping the Animation Thread in slot [1] and not [0]? or is it a form of (true) you're using and will stop ALL animations currently running on all Threads???

Thanks, always curious about Animation and TGE....

@Deeptha: I have found the playThread function a little odd/quirky. I have an object that should run one of it's sequences randomly via a routine to generate the value with collision. What I've noticed is that if my random number was the same twice[or more] in a row, the sequence would NOT run, since, I believe, Source Code has that function not resetting the Thread once the sequence is finished. This means[I believe], to the engine, when my second,third,fourth identicle random number is generated[ie...sequence], thinks that the shape is indeed running that sequence; but actually the sequence is 'over' and should be run again, why this is....??? Perhaps there is some function that can check whether a sequence is running or storing the generated number?? ....some notes on playThread, from an artist.
#3
02/22/2006 (8:40 pm)
Thank you Anthony and Rex

I want to run an animation on a particluar event like a certain keypress , so how can i bind the this code to that event and where this code to be inserted more precisely in which file and where can i find a good example showing this ?

%obj.playThread(0, "animationName");
#4
02/22/2006 (9:38 pm)
Thank you Anthony and Rex

I want to run an animation on a particluar event like a certain keypress , so how can i bind the this code to that event and where this code to be inserted more precisely in which file and where can i find a good example showing this ?

%obj.playThread(0, "animationName");
#5
02/23/2006 (7:11 am)
Look at the celebration (wave, salute) animation work. They are done all in script, and do exactly what you want.
#6
02/26/2006 (12:05 am)
Im a begginer and im wondering how and where the action script is.
is it when you need to press ~ ?
or do you type it in when your out of the application?

please help it will be useful.