Animating Static Objects
by Jon Cahill · in Artist Corner · 02/09/2002 (10:52 am) · 4 replies
Hey
I have created an object in max and made an animation for it. I followed the Max2DTS exporter docs to make sure my model was correct and setup right to export the animation along with the model.
I tested my model in the model viewer and it animates perfectly but when in the game it doesn't. I followed the tutorial found at
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=1522
but i still can't seem to get it to work. This was my script that i ended up creating for it.
datablock StaticShapeData(Blades)
{
// 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 = "./blades.dts";
};
function Blades::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 continously.
%obj.playThread(0,"Spin");
}
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);
}
Any help would be great thanks
Jon
www.insomniagames.com
I have created an object in max and made an animation for it. I followed the Max2DTS exporter docs to make sure my model was correct and setup right to export the animation along with the model.
I tested my model in the model viewer and it animates perfectly but when in the game it doesn't. I followed the tutorial found at
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=1522
but i still can't seem to get it to work. This was my script that i ended up creating for it.
datablock StaticShapeData(Blades)
{
// 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 = "./blades.dts";
};
function Blades::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 continously.
%obj.playThread(0,"Spin");
}
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);
}
Any help would be great thanks
Jon
www.insomniagames.com
About the author
#2
If it animates using the show tool, then you need to make sure your dropping the correct object in the editor. There are are two "static" shape classes, the TSStatic which is a light weight class (which doesn't need a datablock and is non-animating, non-scriptable, etc.), and StaticShape which is derived from ShapeBase (what your declaring). In the mission editor window though, your blade.dts file will show up under the "Static Shape" section which actually creates a TSStatic shape object, your StaticShape datablock will show up in the "Shapes", in the "Misc" category.
02/09/2002 (11:51 am)
The StaticShape class is static in the sense that it doesn't move. It can animate though.If it animates using the show tool, then you need to make sure your dropping the correct object in the editor. There are are two "static" shape classes, the TSStatic which is a light weight class (which doesn't need a datablock and is non-animating, non-scriptable, etc.), and StaticShape which is derived from ShapeBase (what your declaring). In the mission editor window though, your blade.dts file will show up under the "Static Shape" section which actually creates a TSStatic shape object, your StaticShape datablock will show up in the "Shapes", in the "Misc" category.
#3
In reference to the shape itself. Where does it need to sit in the directory structure?
I too am having trouble getting the World Creation Editor to show my "flag" under the Shapes>Misc section.
thanks.
03/03/2002 (12:49 pm)
Tim,In reference to the shape itself. Where does it need to sit in the directory structure?
I too am having trouble getting the World Creation Editor to show my "flag" under the Shapes>Misc section.
thanks.
#4
Seeing as how your post is over a month old I don't know if this will help you...but I figured my issues out (with a lil bit 'o help from Joe M.).
Here's my thread which helps explain how I did it.
www.garagegames.com/index.php?sec=mg&mod=forums&page=result.thread&qt=3860
Good luck, bro.
03/04/2002 (1:38 am)
Jon,Seeing as how your post is over a month old I don't know if this will help you...but I figured my issues out (with a lil bit 'o help from Joe M.).
Here's my thread which helps explain how I did it.
www.garagegames.com/index.php?sec=mg&mod=forums&page=result.thread&qt=3860
Good luck, bro.
Torque Owner David Chait
d