Hello thar!

I'm trying to use GetLayerDuration to obtain the length of an animation, so
that my entity knows to do something when the animation is over (assume for
now I don't want to use IsGesturePlaying(), I just need to know beforehand
how long an animation should last).

My code looks something like this, copying the only example of
GetLayerDuration from npc_strider:


int iLayer = AddGestureSequence(activity);
float fDuration = GetLayerDuration(iLayer);
DevMsg(0, "locked stance time %f\n", fDuration);


Assuming activity is a valid "Activity".

First of all, why do we need to AddGestureSequence to the overlay before
even getting a duration out of it? There doesn't seem to be something to
JUST get a layer, from an activity? You have to Add it first?

Second, isn't there any method to directly get the Activity's duration?
Would that the same thing as getting a Sequence's duration, or getting a
Gesture's duration? (I'm still confused between the distinction of the two).


The above code also does not behave like I expect it to. This line:

float fDuration = GetLayerDuration(iLayer);

Returns 0.01.
My animation for the layer I passed in is 66 frames long. That's AT LEAST a
second long animation. So..  clearly I'm not using this method properly.

Can anyone shine any light on the subject?

Thanks.

~M

PS FYI I also posted this question here, trying to expediently solve this:
http://forums.steampowered.com/forums/showthread.php?p=7922882#post7922882
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to