llGetAnimation()
|
Julian Fate
80's Pop Star
Join date: 19 Oct 2003
Posts: 1,020
|
04-06-2004 13:10
I was playing around with the llGetAnimation function today. The Linden help text says something like, "Returns the avatar's current animation."
Using an animation script I put myself into the "fly" animation and ran my llGetAnimation script. It said "Standing". Ok... I sat on the ground and ran it: "Sitting on Ground". Not "sit_ground"? Huh.
Why doesn't it return "fly" or "sit_ground" or "express_surprise"? In other words, the actual animation I'm currently running?
If this is on purpose, can we please have a function that actually tells us the name of the specific animation we're currently running? I can only think of a million uses for this. While you're at it, events like animation, animation_start, and animation_end would be very nice as well.
|
Kex Godel
Master Slacker
Join date: 14 Nov 2003
Posts: 869
|
04-06-2004 13:35
http://www.badgeometry.com/wiki/llGetAnimationBy the way, animations stack on top of each other, and whichever has the highest priority is the one that's expressed. For example, I can have all running at once: Standing dance_6 backflip Which animation do you want returned?
|
Julian Fate
80's Pop Star
Join date: 19 Oct 2003
Posts: 1,020
|
04-06-2004 14:38
I want the current or latest animation name returned. There has to be an array of currently running animations that the game code has access to.
I understand how it works now but I think either that it should change to return the specific animation name or (better) we should get a function that does. "Sitting on Ground" is not an animation name, it's more of a state, and it only seems to track animations states you can "naturally" get into. If a script uses llStartAnimation on you, even to start an animation like "Sitting on Ground", llGetAnimation won't notice. This makes llGetAnimation, in my opinion, pretty close to worthless.
|
Oz Spade
ReadsNoPostLongerThanHand
Join date: 23 Sep 2003
Posts: 2,708
|
04-07-2004 04:21
I agree it should return the equal equivelent that you use with llSetAnimation(), can you even use llSetAnimation("Sitting"  ?
_____________________
"Don't anticipate outcome," the man said. "Await the unfolding of events. Remain in the moment." - Konrad
|
Julian Fate
80's Pop Star
Join date: 19 Oct 2003
Posts: 1,020
|
04-07-2004 13:10
I'll check but I doubt it.
|
Kex Godel
Master Slacker
Join date: 14 Nov 2003
Posts: 869
|
04-07-2004 13:12
Perhaps this should be implemented as a new built-in function. The existing function is already in use by many people, and will break those people's scripts if it is suddenly changed to the behavior proposed.
Also if it returned a list of the current animation 'stack', instead of a single name, that would be preferable to the hit-or-miss results you'd get otherwise.
|
Julian Fate
80's Pop Star
Join date: 19 Oct 2003
Posts: 1,020
|
04-07-2004 14:04
I'll leave it to someone techically-minded to work out the specs. All I know is I WANT IT!!!!!1!
I know enough to know you're right about a new function and returning a list being helpful, Kex. Still, if all you want is the current animation name parsing a list would be a little clunky. Maybe the overhead of a seperate built in function to get the currently running animation name would be the same as the overhead to get the list of currently running animations then parsing it for the last entry but I suspect doing it with a script like the latter example would be slower even though they do the same general thing.
|
Kex Godel
Master Slacker
Join date: 14 Nov 2003
Posts: 869
|
04-07-2004 14:25
Hypothetical: key k = llDetectedKey(sensor_index); list anims = llGetAnimationStack(k); integer len = llGetListLength(anims); llSay(0, llList2String(anims,len - 1));
|
Oz Spade
ReadsNoPostLongerThanHand
Join date: 23 Sep 2003
Posts: 2,708
|
04-07-2004 19:10
That would be great Kex. 
_____________________
"Don't anticipate outcome," the man said. "Await the unfolding of events. Remain in the moment." - Konrad
|