Game Development Community

ShapeBaseImage Animation

by Xavier "eXoDuS" Amado · in Torque Game Engine · 10/14/2002 (10:52 am) · 5 replies

Ok, this is kinda a complex thing, what I have is an object which is derived from ShapeBase and a ShapeBaseImage (weapon) mounted on that ShapeBase object. The dts for the ShapeBaseImage has a sequence, called Rotate, which animates the rotation of the turret gun. What I now need to know is how to play that animation from the code of my Turret class (the one that is derived from shapebase).
Anyone can give me some pointers on this please?
Thanks in advance.

#1
10/15/2002 (5:19 am)
You can use the method
void ShapeBase::setImageState(U32 imageSlot, U32 newState,bool force)
which will allow you to trigger a state for your shape base image. Then for this state, you defined it with an animation (in your datablock). That's all folks :)
#2
10/15/2002 (6:10 am)
I'd set it as the sequence (stateSequence) for the fire state via script. Make sure the timeout value is at least as long as the animation length so it loops properly. I'd also give it 0 reload time (if you're trying to achieve a chain turret type effect) so it loops smoothly...


Good luck :)
#3
10/15/2002 (12:44 pm)
No, I meant rotation as to move the turret cannon to aim at different places, like rotating the player around... what I have to do is scale the animation to the client's movement with the mouse.
#4
08/14/2007 (7:39 pm)
Umm you could just rotate the node your weapon is attached to, no? :)
#5
08/15/2007 (5:57 pm)
How do you create a character or how do you get to it