Game Development Community

Ambient animation - how to "or" how not?

by Stephen Walsh · in Torque Game Engine · 10/27/2005 (12:33 pm) · 9 replies

I have a complex model (with bones) (it is my player model - minus the eye and cam dummys)
i created a 25 frame sequence and linked it to a sequence dummy called "ambient" and exported the whole shape. i load it up in show tool and it auto runs my sequence at thread 0 called ambient.

i know there is some scripting invloved ( it seems the ambient sequence doesn't seem to be enough to kick it off on its own - although according to some FAQ sites it should)

so i added this to the game.cs ( under exec("./player.cs"); )

exec("./reception.cs");

and created a file called "reception.cs" in that same directory..
i put this in it.

datablock StaticShapeData(reception)
{
category = "Misc";
shapeFile = "~/data/Animations/reception.dts";
};

function reception::onAdd(%this,%obj)
{
%obj.playThread(0,"ambient");
}
function StaticShapeData::create(%block)
{
%obj = new StaticShape()
{
dataBlock = %block;
};
return(%obj);
}


incase you haven't guested its a receptionist model - and the animation is her typing.

This doesn't work - i dont know why and help would be great

Kind Regards
Sephen Walsh

#1
10/27/2005 (12:55 pm)
What doesn't work? Are you putting it in game and it isn't playing? If so, how are you placing the object in the level? Keep in mind there is a specific section of the editor for StaticShape data, which is a bit backhanded as it's called "Shapes" whereas the "Static Shapes" section puts in .dts models directly.
#2
10/27/2005 (1:02 pm)
It doesn't work as in the object doesn't move in the game

i load the game click f11 then f4 i go to the directory - StaticShape -> Wyeth "project Name" ->data->animations "reception.dts"

then i ajust the object to the correct position and some size adjustments in the level.

any help to you ?
#3
10/27/2005 (1:31 pm)
Have you tried triggering the animation via the console?

function StaticShapeData::create(%block)
{
%obj = new StaticShape()
{
dataBlock = %block;
};
return(%obj);


if that's your exact code.... you're missing a semi colon
#4
10/27/2005 (1:43 pm)
Lol ok i put in the semi colon at the end of "%obj = new StaticShape()". so how do i tigger it in the console. ? Thats a new one for me
#5
10/27/2005 (1:50 pm)
Use the editor to find the receptionists ID, and replace obj with it
%obj.playThread(0,"ambient");

However, you just stated above that you're loading it via the static shapes dir. That won't play anything. Load it via the shapes dir.

hmm, also, I don't think you should be setting up the DB as a staticshape. I usually use shapeBaseData instead. I may be wrong on that though...
#6
10/27/2005 (1:57 pm)
Hi Stephen,

From what I see, I think it would be beneficial for you to check out Kevin Harris' Torque Tutorials, especially number 2 and 4.
#7
10/27/2005 (1:59 pm)
Bang on boy, got it "Load it via the shapes dir" worked a treat.

Thanks for everyones input
#8
10/27/2005 (1:59 pm)
Try adding it through the shapes menu instead of static shapes
#9
10/27/2005 (2:05 pm)
Wow i have to say the interest in this topic has been overwelming. Wow 10 post in just over an hour.


Thanks for everyone help ,

@David Stewart

o thanks for that link i was just about to look at triggers, its a start in the right direction.
Cheers all