Game Development Community

Stopping a pesky cycling animation?

by Stephen Zepp · in Torque Game Engine · 03/26/2005 (9:49 pm) · 3 replies

Background: I'm using the RTS-SK, which derives RTSUnits from the player class, but optimized a large amount of the original code.

We've built a new "generic rig" structure for our RTS-Units, and have successfully linked both one-time and cycling animations (.dsq) to the shapes, and things overall are going pretty well. The one stopper I'm having currently is transitioning from one cycling animation to another...for the most part, once a cycling animation has started, we can't seem to get it to solidly stop so that we can transition to a different one.

For example, we have a cycling attack animation that is set when the unit engages in combat, and that works fine. When the target dies, part of RTSUnit::processTick() determines the current state of the unit, and determines which thread to play next--in this case, we should transition to the root thread. Unfortunately, this transition isn't happening--the unit keeps on swinging until it is given a move command.

We also have the issue where the unit is moving (and playing the walk animation), but when it reaches it's destination, it should transition back to the root sequence (we do this manully with setActionThread). Again, the transition never happens, and the unit moonwalks at it's destination.

I've re-written pickActionAnimation() to accomodate the basic nature of our custom animations, and confirmed that it actually isn't being called during these transition states, so that seems to be a dead end.

Is there any way to force a thread to actually stop processing completely, so a new one can take over? I even tried stopThread("attack");, but not only doesn't it have any effect, we can't really manually cancel every single animation that may be running to start up a new one. Any thoughts?

#1
12/19/2006 (5:36 am)
-bump- i have a similar problem..
#2
12/19/2006 (7:21 am)
SetArmThreadTransitionOnce()...does this hep at all?? How about creating the sequence as a blendType and running it as an armThread.....??
#3
12/19/2006 (8:30 am)
%obj.stopThread()