Getting animation sequences to play in torque
by Tom · in Artist Corner · 03/16/2005 (8:35 am) · 9 replies
A view people, including myself are having problems to play animation sequences to play in the torque engine not the show tool.
Documentation that i have found finish their explanations at "if it works in the show tool it will work in the engine" and therefore don't explain putting the sequences in the engine, so if anyone could help others and i will be very greatful.
Documentation that i have found finish their explanations at "if it works in the show tool it will work in the engine" and therefore don't explain putting the sequences in the engine, so if anyone could help others and i will be very greatful.
#2
I am not sure whether it is code or the export but it seems to work in the show tool so i would say it might be code related.
However,
Export wise.....i have tried the different methods having the "collaspe transforms" unchecked and the rest, but i have resulted just to keep going through it to makes sure that i have made no mistakes.
Code wise......i try have tried to follow the player.cs and the others that correspond to it within the torque engine for the default player but it is still not working.
03/16/2005 (1:36 pm)
I can get the animation to work within torques show tool but when i come to place a character/object with an animation sequence, the sequence won't play, the character/object just stays stastic.I am not sure whether it is code or the export but it seems to work in the show tool so i would say it might be code related.
However,
Export wise.....i have tried the different methods having the "collaspe transforms" unchecked and the rest, but i have resulted just to keep going through it to makes sure that i have made no mistakes.
Code wise......i try have tried to follow the player.cs and the others that correspond to it within the torque engine for the default player but it is still not working.
#3
Back to showtool though, do your animations load fine via the dts/cs combo button (TSTPro only), or must you load them manually? If they are loading automatically, just fine, then there is nothing at all wrong with your models/animations. If you must load them manually, then the console will tell you why and in a very roundabout way, what you need to fix.
03/16/2005 (1:44 pm)
The basic rule is valid, 'if it works in showtool, it works in game'. If that is not the case for you, then you need to start looking over your naming conventions. TGE has a LOT of hardcoded assumptions when it comes to animations. All are very easy to redo, but it will take a moment to find them.Back to showtool though, do your animations load fine via the dts/cs combo button (TSTPro only), or must you load them manually? If they are loading automatically, just fine, then there is nothing at all wrong with your models/animations. If you must load them manually, then the console will tell you why and in a very roundabout way, what you need to fix.
#4
i load shape, the shape appears and it is animated, so i pressume everything is fine.
03/16/2005 (2:01 pm)
I don't think the show tool is TSTPro. The show tool comes up with a black screen and seven buttons starting with load shape and ending with quit.i load shape, the shape appears and it is animated, so i pressume everything is fine.
#5
I've had a lot of cases where it works in one but not the other.
The saying is true for the new show tool though. Download the demo and try it! Beware that once you are hooked on it, you will not want to go back.
03/31/2005 (1:30 am)
For the old show tool "when things work..... it works in the game" does _not_ apply. Its a very very stripped down TGE that is unlike the "real game" in a lot of aspectsI've had a lot of cases where it works in one but not the other.
The saying is true for the new show tool though. Download the demo and try it! Beware that once you are hooked on it, you will not want to go back.
#6
Can you be a little more specific? I'm having the same trouble and could really use a shove in the right direction.
Is there a script that you have to modify to get something to animate within the engine itself? I've seen other places that mention the CFG file but I'm confused as to what I have to modify to get something to work.
//"For the old show tool "when things work..... it works in the game" does _not_ apply. Its a very very //stripped down TGE that is unlike the "real game" in a lot of aspects"
Can you provide an example? If things don't correlate between showtool and engine then why use it at all?
This is happening with Maya 5.
Thanks in advance.
05/04/2005 (11:52 am)
//"If that is not the case for you, then you need to start looking over your naming conventions."Can you be a little more specific? I'm having the same trouble and could really use a shove in the right direction.
Is there a script that you have to modify to get something to animate within the engine itself? I've seen other places that mention the CFG file but I'm confused as to what I have to modify to get something to work.
//"For the old show tool "when things work..... it works in the game" does _not_ apply. Its a very very //stripped down TGE that is unlike the "real game" in a lot of aspects"
Can you provide an example? If things don't correlate between showtool and engine then why use it at all?
This is happening with Maya 5.
Thanks in advance.
#7
You've created stunning sequences in your favorite modelling package and exported it successfully! No small feat, and at this point you're left wondering why can't I see this fine work inside the engine. They work fine in showTool.XX but they don't 'play' when inside the engine.
This is due to the fact that any action you want to see occur inside the engine at runtime, needs to be scripted in some manner beforehand! Everything; so that the engine 'knows' when to play, such-and such animation when the player[et all] are doing 'this'. This involves entering the script files for the objects in question[or building them if none exist!] and creating functions dedicated to these sequences, and probably entering the script file[s] for the players[et al] and editing these hardcoded functions to include these 'new' actions...I hope you understand where this is heading. As an artist, you're going to need the help of a scriptor/coder to get your sequences triggering at the 'proper' time...hope all this made some kind of sense.
The GG official tutorials on scripting will outline these priciples hopefully clearly. They start with simple engine 'recognition' of the shape as an 'object'. They move into triggering and simple collision interaction, and finishing with a keybinding example to a function calling...it's a somewhat serpentine process to getting a object 'working' inside the engine.
Utililzing a 'tool' is not the same as utilizing the code involved for a specific object. This often gets overlooked by the artist attempting to quickly validate the work...it's a part of the process...good luck.
Rex
05/04/2005 (4:54 pm)
Afternoon, Justin. This is a question I see arrive on the Boards quite often.You've created stunning sequences in your favorite modelling package and exported it successfully! No small feat, and at this point you're left wondering why can't I see this fine work inside the engine. They work fine in showTool.XX but they don't 'play' when inside the engine.
This is due to the fact that any action you want to see occur inside the engine at runtime, needs to be scripted in some manner beforehand! Everything; so that the engine 'knows' when to play, such-and such animation when the player[et all] are doing 'this'. This involves entering the script files for the objects in question[or building them if none exist!] and creating functions dedicated to these sequences, and probably entering the script file[s] for the players[et al] and editing these hardcoded functions to include these 'new' actions...I hope you understand where this is heading. As an artist, you're going to need the help of a scriptor/coder to get your sequences triggering at the 'proper' time...hope all this made some kind of sense.
The GG official tutorials on scripting will outline these priciples hopefully clearly. They start with simple engine 'recognition' of the shape as an 'object'. They move into triggering and simple collision interaction, and finishing with a keybinding example to a function calling...it's a somewhat serpentine process to getting a object 'working' inside the engine.
Utililzing a 'tool' is not the same as utilizing the code involved for a specific object. This often gets overlooked by the artist attempting to quickly validate the work...it's a part of the process...good luck.
Rex
#8
This is the code I used for my windmill.cs script.
I added exec("./windmill.cs"); to game.cs and that seemed to get the animation working in game. I'm not sure how difficult the animation your trying to get working is, but for a simple animation this seemed to work for me.
edit: typo
05/04/2005 (5:20 pm)
I was having this problem a couple of weeks ago and I eventually was able to figure it out. My windmill called for a simple animation of its stocks and shutters to rotate in game. After I exported the shape with the animation sequence called "sequence01" I made a new script called "windmill.cs" and placed it in my server/scripts folder.This is the code I used for my windmill.cs script.
datablock StaticShapeData(Windmill)
{
category = "Einlanzer";
shapeFile = "~/data/shapes/einlanzer/windmill.dts";
};
function Windmill::onAdd(%this,%obj)
{
%obj.playThread(0,"sequence01");
}I added exec("./windmill.cs"); to game.cs and that seemed to get the animation working in game. I'm not sure how difficult the animation your trying to get working is, but for a simple animation this seemed to work for me.
edit: typo
#9
05/05/2005 (4:13 am)
I see you are starting the animation thread in onAdd(). Does TGE dispose of these threads or should we cancel the thread and in what function?
Torque 3D Owner Billy L