Animation Platform not working. Need Helps
by Sventhors · in Artist Corner · 08/08/2005 (3:33 pm) · 1 replies
I am new to Torque and I want to bring in animated or moving platform into to Torque where the players has to jump to platform to get across burning or water below.
I have look at several forums and tutorials on moving animation pieces.
Like his tutorialwww.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=6109
And this Threadwww.garagegames.com/index.php?sec=mg&mod=forums&page=result.thread&qt=3860
I have tried many things and could not get it.
This is how I did the tutorial
1. I first made platform in Maya(triangulated it)and used dtsUtility(Bounding box(made sure it is big enough to have animation in it)Embed, Register Detail) I duplicated my polygon and named it Col_1(changed its Subdivision to 1 from 4.
2. I duplicated My detail1 and named it Collison_1
3. I then saved it as platform as a dts and exported to my
Torque\SDK\example\starter.fps\data\shapes\MovingPlatform
*The MovingPlatform (folder) is were I save/export all my dts dsq
4. Then I made saved it as platform_root and created sequence node named it sequence_root and have start frame at 1 and end frame at 20
5. I Exported it as platform_root.dsq
Torque\SDK\example\starter.fps\data\shapes\MovingPlatform
6. I saved it again
7. Saved it again as platform_move
8. renamed my sequence not too sequence_move and have start frame 30 to 80
9. Animated both polygons(pCube1 and Col_1) in x-axis (in-between 30 and 80)
10. Saved it.
11. Exported it as platform_move as a dsq file
12. I saved it again
13. Saved it again as platform_ambient
14. renamed my sequence node to platform_ambient and have start frame 100 end frame 150
15. Animated it in x-axis(in-between 100-15)
16. Saved it and exported it as platform_ambient
17. I made cs file named platform.cs and saved it to
Torque\SDK\example\starter.fps\data\shapes\MovingPlatform
18. I then made another file cs named it platform.cs and saved it to
Torque\SDK\example\starter.fps\server\scripts
I also just in case saved it just incase to
Torque\SDK\example\starter.fps\data\shapes\MovingPlatform
I have look at several forums and tutorials on moving animation pieces.
Like his tutorialwww.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=6109
And this Threadwww.garagegames.com/index.php?sec=mg&mod=forums&page=result.thread&qt=3860
I have tried many things and could not get it.
This is how I did the tutorial
1. I first made platform in Maya(triangulated it)and used dtsUtility(Bounding box(made sure it is big enough to have animation in it)Embed, Register Detail) I duplicated my polygon and named it Col_1(changed its Subdivision to 1 from 4.
2. I duplicated My detail1 and named it Collison_1
3. I then saved it as platform as a dts and exported to my
Torque\SDK\example\starter.fps\data\shapes\MovingPlatform
*The MovingPlatform (folder) is were I save/export all my dts dsq
4. Then I made saved it as platform_root and created sequence node named it sequence_root and have start frame at 1 and end frame at 20
5. I Exported it as platform_root.dsq
Torque\SDK\example\starter.fps\data\shapes\MovingPlatform
6. I saved it again
7. Saved it again as platform_move
8. renamed my sequence not too sequence_move and have start frame 30 to 80
9. Animated both polygons(pCube1 and Col_1) in x-axis (in-between 30 and 80)
10. Saved it.
11. Exported it as platform_move as a dsq file
12. I saved it again
13. Saved it again as platform_ambient
14. renamed my sequence node to platform_ambient and have start frame 100 end frame 150
15. Animated it in x-axis(in-between 100-15)
16. Saved it and exported it as platform_ambient
17. I made cs file named platform.cs and saved it to
Torque\SDK\example\starter.fps\data\shapes\MovingPlatform
datablock TSSHapeConstructor (platform)
{
baseshape = "./platform.dts";
sequence0 = "./platform_root.dsq root";
sequence1 = "./platform_move.dsq move";
sequence1 = "./platform_ambient.dsq ambient";
};18. I then made another file cs named it platform.cs and saved it to
Torque\SDK\example\starter.fps\server\scripts
I also just in case saved it just incase to
Torque\SDK\example\starter.fps\data\shapes\MovingPlatform
About the author
Torque Owner Sventhors
Here's the code I used. Got it from
[url] http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=1522[/url
datablock ItemData(platform) { // The category variable determins where the item // shows up in the mission editor's creator tree. // (this is misspelled in v1.0, v1.1 or higher should // use the correct spelling "category") category = "Misc"; shapeFile = "~/data/shapes/MovingPlatform/platform.dts"; }; datablock StaticShapeData(platform) { // The category variable determins where the item // shows up in the mission editor's creator tree. // (this is misspelled in v1.0, v1.1 or higher should // use the correct spelling "category") category = "Misc"; shapeFile = "~/data/shapes/MovingPlatform/platform.dts"; }; function Platform::onAdd(%this,%obj) { // %obj is the object being added to the world // with %this datablock. Start up a thread on the // new object. Since the wave sequence is cyclic // this animation will run continuously. %obj.playThread(0,"move"); } function StaticShapeData::create(%block) { // The mission editor invokes this method when it // wants to create an object of the given datablock // type. You only need one of these methods for any // class/datablock type (in this case StaticShape). %obj = new StaticShape() { dataBlock = %block; }; return(%obj); }19. in Game.cs I added exec("./platform.cs"); //where all other exec is at.
20. I tested my animation in Show tool and it animates there.\
21. I start up TGE and F11 and F4 and I Click Shapes I notice that Platform folder is not there. 22. I click on static shapes and it is the folder is located there. I have selected the platform and does not move but it has collision on it.
23. I have also tried this but it only rotates and does not have x-axis movement and I can walk right through the platform. Code below
datablock ItemData(flag) { // The mission editor uses the "category" to put in moving folder. // item under the "shapes" root category. category = "Misc"; shapeFile = "~/data/shapes/ MovingPlatform /platform.dts"; };THIS IS were I PUT it IN HERE OF GAME.CS
function onMissionLoaded()
{
// Called by loadMission() once the mission is finished loading.
// Nothing special for now, just start up the game play.
//******
startGame();
}[/code]
23. It just spins around as mention before.
I have also tried put the other scripts in here and them gives me errors.
I have also tried this link and no luck
www.garagegames.com/mg/forums/result.thread.php?qt=32785
I know that I don't want my shape to be in the static library but rather in the first part of the Shapes where MISC, Health and others are there.
Can anyone help me or tell me an easier way or making moving platforms