Game Development Community

How to get current animation frame

by Andy Hawkins · in Torque Game Engine · 06/01/2006 (11:33 pm) · 2 replies

When my character makes a move, for my example a sword slash, how can I get the frame number of the current animation so I can set off effects based on where the sword is. So I want a fireball to launch as the sword is mid way through the animation? Is there a function call or something in Torque Script? I'd rather not mod the source.

#1
06/02/2006 (7:19 am)
I don't believe that TGE handles sequences in that way; in that you can't find out what 'frame' your in[probably because of bandwidth and keeping track of ALL the frames of all animations running?...;), just a quess.] Putting a trigger in the sequence is another good way, alas I don't think that is a 'stock' engine function of readTrigger, lol! It should; be nice if GameBase objects did, ;).

I think 'scheduling' is about as close as you're likely to come, unless you alter C++ code....again, just a guess.

I certainly wish that the engine handled things in that fashion, moreso with triggers in sequences. I don't believe there is a scripting solution to 'reading' any triggers beyond footsteps. If there is any other or a way to read a trigger in a sequence, please share!
#2
06/02/2006 (10:02 am)
Thanks Rex. That sound like it could work for me. I can just time when the sword is in front. I imagine doing this way is the network friendly way as you mentioned. Thanks again :)