Playthread help !?
by Billy L · in Torque Game Engine · 07/11/2003 (1:33 pm) · 10 replies
Hi all !
Im stuck !
How does this playthread really work ?
I can play a thread on a flag thats no problem ,
But when i try to use playthread as a blend animation on the player it dont play !
So what do i do wrong ?
I can see the animation in the show tool and use it as thread
1 on a run animation .
The command i use is
%client.player.playThread(0,"myThread");
what does the 0 do ?
Do i need triggers or something in max to get this to work ?
I export it as a blend animation.
what is the blend Ref. time in max ?
Give me a hint if you got one !
Thx Billy
Im stuck !
How does this playthread really work ?
I can play a thread on a flag thats no problem ,
But when i try to use playthread as a blend animation on the player it dont play !
So what do i do wrong ?
I can see the animation in the show tool and use it as thread
1 on a run animation .
The command i use is
%client.player.playThread(0,"myThread");
what does the 0 do ?
Do i need triggers or something in max to get this to work ?
I export it as a blend animation.
what is the blend Ref. time in max ?
Give me a hint if you got one !
Thx Billy
#2
07/12/2003 (2:21 pm)
For players, you should use setActionAnimation. Do a find in files in the script to see examples of how it is called.
#3
can i have 4 threads on every single movement like
4 threads on run
4 threads on left
?
And Josh
The Actionanimation can you use this as a blend ?
what i understand you guys doing melee combat games or ?
I try to but i havent found a good way to play the animations.
07/12/2003 (4:12 pm)
Matthew do you mean i only can have total of 4 threads orcan i have 4 threads on every single movement like
4 threads on run
4 threads on left
?
And Josh
The Actionanimation can you use this as a blend ?
what i understand you guys doing melee combat games or ?
I try to but i havent found a good way to play the animations.
#4
For players you can have more in the form of a DSQ. Basically you export the animation info. Check the default Player model and how its set up. I think but am not sure if your trying to add new moves then you'll have to substitute some of the default animation with yours and set up how the player controls them.
There is this resource though www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=4348
It might give you a hand. I thought there was a resource on setting up melee combat but not sure you might try to search. It can be done and with player models its should be a little easier because of the amount of animations you can have.
PlayThread isn't a really good alternative for you.
Matt
07/12/2003 (6:54 pm)
You can only have a total of 4 animations (threads). I don't know anything about action animation. That might give you more.For players you can have more in the form of a DSQ. Basically you export the animation info. Check the default Player model and how its set up. I think but am not sure if your trying to add new moves then you'll have to substitute some of the default animation with yours and set up how the player controls them.
There is this resource though www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=4348
It might give you a hand. I thought there was a resource on setting up melee combat but not sure you might try to search. It can be done and with player models its should be a little easier because of the amount of animations you can have.
PlayThread isn't a really good alternative for you.
Matt
#5
07/12/2003 (6:58 pm)
What exactly are you trying to do?
#6
want them to trigger on what direction the player moves
The recoilstate is a nice thing if i could change the way
it chooses the recoil animation on the fly.
so i want smooth animation that not stops or waiting for
the basic ones .
Like a swing with a sword but they should trigger at once when
i fire the mouse !
So whats the best way to get this ,maybe i must do my own
function but would be nice with a easier way !
Im going on vacation for 2 weeks .
have a nice summer !!
-Billy
07/13/2003 (4:24 am)
I want to have a lot animations blend on the run,back and sideswant them to trigger on what direction the player moves
The recoilstate is a nice thing if i could change the way
it chooses the recoil animation on the fly.
so i want smooth animation that not stops or waiting for
the basic ones .
Like a swing with a sword but they should trigger at once when
i fire the mouse !
So whats the best way to get this ,maybe i must do my own
function but would be nice with a easier way !
Im going on vacation for 2 weeks .
have a nice summer !!
-Billy
#7
The engine will automatically blend between two different animations when you use setActionAnimation. So if you are walking, then start to run, it will blend correctly between the two anims.
07/14/2003 (2:23 pm)
Use setActionAnimation like I said. Yes, you can use blend, but that's not what blend is made for. Blending is supposed to be so you can have an animation that controls the rotation of the player's head as he looks up and down, or something like that. It shouldnt be used with setActionAnimation, it should be coded into the engine.The engine will automatically blend between two different animations when you use setActionAnimation. So if you are walking, then start to run, it will blend correctly between the two anims.
#8
on my basic moves ?
Like one run only ,and one run attack ?
I tried to play my arm and body swing on my basic animations
but its not working with setActionAnimation !
Realmwars made a armthreadfunction it plays on the top
of the run animation !
Can i make simular one on the setActionAnimation ?
Thx guys for the answers
-Billy
07/19/2003 (2:09 pm)
Josh does this mean that i need todo my sword swing animationson my basic moves ?
Like one run only ,and one run attack ?
I tried to play my arm and body swing on my basic animations
but its not working with setActionAnimation !
Realmwars made a armthreadfunction it plays on the top
of the run animation !
Can i make simular one on the setActionAnimation ?
Thx guys for the answers
-Billy
#9
1. Export the run animation, and be sure that your cfg file ONLY has the leg and possibly hip nodes included in the animaiton. Then when you export the swing, make sure that the leg bones and hips (if you included them in the run) are NOT included in the animation. This should allow you to play both at once using just setActionAnimation
2. The second approach is to create another 'thread' for the player by essentially copying and pasting most of the code for ActionAnimation. Then you can use this new thread for attacks, and the ActionAnimations for movement, etc.
Pros and Cons:
1. Pros: No need to make a second animation thread.
Cons: Animations will look strange since hips are needed while running and while attacking.
2. Pros: Can produce better looking animations.
Cons: Takes more work, both to create the new thread, and to make sure that the animations dont cause glitches when multiple anims are playing.
07/19/2003 (8:15 pm)
There are two solutions to your problem:1. Export the run animation, and be sure that your cfg file ONLY has the leg and possibly hip nodes included in the animaiton. Then when you export the swing, make sure that the leg bones and hips (if you included them in the run) are NOT included in the animation. This should allow you to play both at once using just setActionAnimation
2. The second approach is to create another 'thread' for the player by essentially copying and pasting most of the code for ActionAnimation. Then you can use this new thread for attacks, and the ActionAnimations for movement, etc.
Pros and Cons:
1. Pros: No need to make a second animation thread.
Cons: Animations will look strange since hips are needed while running and while attacking.
2. Pros: Can produce better looking animations.
Cons: Takes more work, both to create the new thread, and to make sure that the animations dont cause glitches when multiple anims are playing.
#10
Can you answer this of topic quastion to ?
In your melee combat tut i understand the damage from the
attachprojectile comes from the command.cs script.
I would have the damage based on each weapon ?
Is there any short ways or must i send the specefic damage
from the weapons to that script ?
07/20/2003 (1:26 am)
Thx Josh i got the clue now i think hehe !Can you answer this of topic quastion to ?
In your melee combat tut i understand the damage from the
attachprojectile comes from the command.cs script.
I would have the damage based on each weapon ?
Is there any short ways or must i send the specefic damage
from the weapons to that script ?
Torque Owner Matthew Jones
The "0" stands for the thread number. Basically you can only have 4 threads play on a player's internal animation. Not matter how many you make in the model the engine only loads 4 of them 0-3. So "(0,"myThread") is the first thread in the stack and its name.
You might have to look into it a little farther. I will also and try to post back some info for ya. Setting the player as a global might not be a good thing, Not sure.
Matt