How To:? Scripting a 3d (dts) object in your scene and run a DSQ
by Matt Troup · in Torque Game Builder · 11/17/2006 (2:51 pm) · 1 replies
I've read the 3d Shapes tutorial and the following page on TDN:
http://tdn.garagegames.com/wiki/Torque_2D/T2D_3DShapes#Shape_Object_Creation
From the two I can't script a shape in my scene and run an animation. The 3d Shapes documentation doesn't go that far, and the TDN page is either out of date or just doesn't make sense (names change throughout the tutorial, the objects within the file are placed within your gameScripts folder and not the data/shapes folder, etc).
Would anyone be willing to help me get a simple example rolling? I'll start and go as far as I can.
STEP 1
a) Open TGB and create a new empty project called "soldier".
b) click on your scenegraph within the level editor or find "t2dSceneGraph" within the "Project" tab.
Open the "Edit" tab, click on the "Scene Graph Scripting" fly-out, and name your scenegraph "mySceneGraph".
STEP 2
Download the "reinstated soldier" dts, dsq, and png files from:
http://tdn.garagegames.com/wiki/images/b/b3/Reinstatedsoldier.zip
and unzip them into your soldier/data/shapes folder
STEP 3
Open up your favorite text editor and create a file named "player.cs" and add the following function:
*****WHAT TO ADD HERE?******
Within a few steps I think it'd be I'd like to see a character scripted on the scene and play an animation when a button is pressed.
http://tdn.garagegames.com/wiki/Torque_2D/T2D_3DShapes#Shape_Object_Creation
From the two I can't script a shape in my scene and run an animation. The 3d Shapes documentation doesn't go that far, and the TDN page is either out of date or just doesn't make sense (names change throughout the tutorial, the objects within the file are placed within your gameScripts folder and not the data/shapes folder, etc).
Would anyone be willing to help me get a simple example rolling? I'll start and go as far as I can.
STEP 1
a) Open TGB and create a new empty project called "soldier".
b) click on your scenegraph within the level editor or find "t2dSceneGraph" within the "Project" tab.
Open the "Edit" tab, click on the "Scene Graph Scripting" fly-out, and name your scenegraph "mySceneGraph".
STEP 2
Download the "reinstated soldier" dts, dsq, and png files from:
http://tdn.garagegames.com/wiki/images/b/b3/Reinstatedsoldier.zip
and unzip them into your soldier/data/shapes folder
STEP 3
Open up your favorite text editor and create a file named "player.cs" and add the following function:
*****WHAT TO ADD HERE?******
function playerInstance()
{
new t2dShape3D(soldier)
{
scenegraph = mySceneGraph;
class = "player";
position = "0 0";
size = "15";
};
}*****THE ABOVE ISN'T CORRECT*****Within a few steps I think it'd be I'd like to see a character scripted on the scene and play an animation when a button is pressed.
About the author
Torque Owner Tank Dork
www.garagegames.com/mg/forums/result.thread.php?qt=41207
edit: side note.. I did however, come to the conclussion that you did.. that tutorial is whack... more of a "what you can do" than a "how you do this".