Game Development Community

AnimationDone

by Drew Madsen · in Torque Game Engine · 08/13/2009 (10:14 pm) · 2 replies

I'm attempting to make a melee system with as little source code editing as possible.

I have a system thought out.

I need to check the distances on the melee weapon while it is in the slash animation.

My problem is I can't find a way to detect when the animation ends.

I really need the function to be generic.

I've seen this on the forums:
Armor::animationdone(%this,%obj)
{
Echo("Sequence Done");
}


But I don't know how it works.

I've tried using many ways, replacing armor with the animation name, the player DB, and others yet it never echos when I $player.setactionthread(slash,0,0);

I've spent hours trying to find a solution. Any assistance will be very appreciated.

Thoughts comments?

#1
08/14/2009 (3:12 am)
I think that's a callback that fires when a call to playThread is finished, not sure if it works with
setActionThread();
. Try grabbing a AI path KORK and
playerID.stop();
him.....then try running
playerID.playThread( 1, "someSequence" );
on it....you should see that echo printed to the console when the DSQ finishes running, proving that the callback is working...try that.

Also,try calling the functions on the player ID of the object instance you want it working on.....

#2
08/14/2009 (5:38 am)
Unfortunately in my experience Playthread messes up blending on characters. Which Torque seems to recognize the end of playthread Sequences.

So far no luck getting the "armor::animationDone" call back that should be occuring whenever a sequence greater than the base set is called in setactionthread.

I seem to have it working now on the player.

Setup like this playerdata::AnimationDone(%this,%obj)

when using the setactionthead(A,b,C) A is the sequence, B is Hold or not, C seems to be related to checking to return callback. when it is 0 it doesn't call back, when it is >0 it does.

I'll update if I continue to have problems.