PlayThread and setActionThread
by Game Maker 2 · in Torque Game Engine · 11/17/2004 (11:36 am) · 2 replies
Hi there!
Not sure how to fully explain, but here's what i'm trying to do:
1. Move my toon around the map, it has the run animation.
2. I collide with an item, the toon should then play an animation once.
3. When finished playing, toon should go back to the run or idle animation.
My problem is that when i set the animation with playThread() it plays instantly, no blending, and then when the animation has finished the idle animation of my toon is...well messed up.
I play the animation like this:
Note that i'm a beginner so i really don't know if this is correct... =/
Anyway, after i have called this function i call a function:
...which basically just says:
When all this is finished the idle animation of my toon is wrong and it also seems halted...
Ok, not sure i'm making myself understood here.. ;)
I belive it resembles of a soldier running, then when shooting he switch to the shoot animation, and then when finished continues with the run animation...
Is there some way to "push" a thread onto another, making it play that one instead, and when it is stopped it continue playing on the underlying thread...?
I've searched around the forums and resources from quite some time now but havn't found any answears to what i'm looking for...
I am very grateful for any help that might shed some light on this...
Thanks in advance!
Not sure how to fully explain, but here's what i'm trying to do:
1. Move my toon around the map, it has the run animation.
2. I collide with an item, the toon should then play an animation once.
3. When finished playing, toon should go back to the run or idle animation.
My problem is that when i set the animation with playThread() it plays instantly, no blending, and then when the animation has finished the idle animation of my toon is...well messed up.
I play the animation like this:
function Player::playThreadOnce(%this, %anim, %animLen)
{
%this.playThread(1, %anim);
%this.schedule(%animLen, "stopThread", 1);
}Note that i'm a beginner so i really don't know if this is correct... =/
Anyway, after i have called this function i call a function:
%this.schedule(3000, "stopEatAnimation");
...which basically just says:
%this.playThread(0, "root");
When all this is finished the idle animation of my toon is wrong and it also seems halted...
Ok, not sure i'm making myself understood here.. ;)
I belive it resembles of a soldier running, then when shooting he switch to the shoot animation, and then when finished continues with the run animation...
Is there some way to "push" a thread onto another, making it play that one instead, and when it is stopped it continue playing on the underlying thread...?
I've searched around the forums and resources from quite some time now but havn't found any answears to what i'm looking for...
I am very grateful for any help that might shed some light on this...
Thanks in advance!
About the author
#2
I think the animation is cyclic and blended...but it is full body movement...
I'm not really sure how to exactly describe my problem.
I have gotten it to play, though no blending, and then switch back to the "root" animation. But then when i start to move again it seems some animation or something is still there, basically making my toon skate around the map =/
It feels like after one play two threads is colliding...Is this possible?
According to the source the "root" and "run" animation is set by setActionThread. I tried to, with script, do a setActionThread to my custom animation but nothing happened at all...
One more thing. I am having trouble to see how the code and script work together. What affects what and so on. Is there some documentation or reference that i have missed?
11/18/2004 (12:19 am)
Thank you for answering Anthony!I think the animation is cyclic and blended...but it is full body movement...
I'm not really sure how to exactly describe my problem.
I have gotten it to play, though no blending, and then switch back to the "root" animation. But then when i start to move again it seems some animation or something is still there, basically making my toon skate around the map =/
It feels like after one play two threads is colliding...Is this possible?
According to the source the "root" and "run" animation is set by setActionThread. I tried to, with script, do a setActionThread to my custom animation but nothing happened at all...
One more thing. I am having trouble to see how the code and script work together. What affects what and so on. Is there some documentation or reference that i have missed?
Associate Anthony Rosenbaum
I know there is a setArmThread() left in from tribes that move the player's arm's to a rifle stance. You might take advantage of that if you are only doing upper body movement.