Game Development Community

How to change the animation name?

by Paulo Coutinho · in General Discussion · 12/11/2009 (9:28 pm) · 2 replies

Hi.

Im using the Human Construction from FroGames, but i dont know how to change the animation sequence.

Im trying the code:

### CODE 1 ###

%obj = new StaticShape()
{
position = "0 0 1";
shapeName = "art/shapes/buildings/human/classic/human1.dts";
collisionType = "Visible Mesh";
scale = "1 1 1";
};

%obj.playThread(0, "idle");

Error: scripts/gui/playGui.cs (160): Unable to find object: '0' attempting to call function 'playThread'

### CODE 2 ###

%obj = new TSStatic()
{
position = "0 0 6";
shapeName = "art/shapes/buildings/human/classic/human1.dts";
collisionType = "Visible Mesh";
scale = "0.5 0.5 0.5";
};

%obj.playThread(0, "idle");

Error: scripts/gui/playGui.cs (160): Unknown command playThread.

#####

What im doing wrong?

#1
12/12/2009 (10:02 pm)
%obj = new StaticShape()
{
position = "0 0 1";
shapeName = "art/shapes/buildings/human/classic/human1.dts";
collisionType = "Visible Mesh";
scale = "1 1 1";
};

%obj.playThread(0, "idle");
Your StaticShape has no datablock. I'm assuming you're using T3D, so I can't give you specific help, but I'd assume that TGE and T3D haven't changed too much in this regard. You'll need to create a datablock (StaticShapeData), which is where you put the shape file, and then assign the datablock to the new static shape you create. At the moment, %obj is 0 because the script fails to create the StaticShape on account of no datablock being present.
#2
12/12/2009 (11:53 pm)
Thanks, solved.

The problem is the datablock.

I think that all models need a datablock.

Thansk again.