The name of the currently running animation
by Steve Lamperti · in Torque Game Engine · 10/21/2004 (3:36 pm) · 2 replies
I'm trying to figure out how to get the name of the currently running animation from C++ code. (I guess if someone knows how to get it from script that would be the same thing, as I could look at the code of the script function and find the C++ code.) If anyone has any suggestions for how to do this, I would be grateful to hear them. (What I'm trying to do, is to set up a system where I can associate playing certain sounds with certain animations, and looking at what animation is currently playing will help with this.)
Thanks for any suggestions,
Thanks for any suggestions,
#2
I'm actually trying to do this above player, basically in shapebase, but I think you're right, that the simplest thing to do would probably be to add a new variable that contains the string, and set it at the time the animation starts running, then I can just get the value of that string variable whenever I want. Thanks for the suggestion. I was assuming that there was some way to retrieve the value currently, but it will be just as easy to save it myself.
10/22/2004 (7:40 am)
@robertI'm actually trying to do this above player, basically in shapebase, but I think you're right, that the simplest thing to do would probably be to add a new variable that contains the string, and set it at the time the animation starts running, then I can just get the value of that string variable whenever I want. Thanks for the suggestion. I was assuming that there was some way to retrieve the value currently, but it will be just as easy to save it myself.
Torque Owner Robert Brower
public:
U32 getAction();
const char* getActionName();
getActionName() can index into PlayerData::ActionAnimationList and return the string.