|
Anderion Webb
Registered User
Join date: 8 Mar 2006
Posts: 17
|
04-11-2006 18:06
Hello all,
I'm probably being a pain in the fanny, but quick question. Is there a flag I can use with the llStopAnimation command to stop all animations that may be running at the same time? I have found if I run a second looped animation without stopping the first, sometimes they mix some, or when I stop the second the first is still going...
Thanks!!! Anderion
|
|
Jigsaw Partridge
A man of parts
Join date: 3 Apr 2005
Posts: 69
|
04-11-2006 21:26
The Wiki suggests using llGetAnimationList() for this, as I understand it. I think the following should work (assumes avatar is seated): key ava_key ; list ani_lst ; integer num_ani ;
ava_key = llAvatarOnSitTarget() ; if ( ( num_ani = llGetListLength ( ( ani_lst = llGetAnimationList ( ava_key ) ) ) ) > 0 ) { do { llStopAnimation ( llList2Key ( ani_lst , --num_ani ) ) ; } while ( num_ani > 0 ) ; }
|
|
SteveR Whiplash
teh Monkeh
Join date: 24 Sep 2004
Posts: 173
|
04-11-2006 22:26
It really depends on what you're trying to do. In most cases it would be easier just to keep track of what anims you're playing and stop/start them as needed. Something like this will kill ALL anims that the avatar is currently playing. But it's very rare that you would need to do this, as it will stop the base anims also, such as sit/walk/away/etc. Not somethign you'd want to do if the avatar is on a vehicle, all of a sudden they'll be standing in their seat.  list anims = llGetAnimationList(key_of_avatar); integer x; for (x = 0; x < llGetListLength(anims); x++){ llStopAnimation(llList2Key(anims, x)); }
|
|
Anderion Webb
Registered User
Join date: 8 Mar 2006
Posts: 17
|
04-12-2006 00:18
Thank you both for your help. This is for an animation HUD, for looping animations, I scripted it so that the first click starts the animation, and a second click stops it, however people tend to just want to click the next, not stoping the first. So it will act like a kill all, but did not realize it would also kill the basic ones as I should have. Will try to figure out how to keep track, so that when they click an animation it will autokill the one prior.
Thanks for all the help!! Anderion
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
04-15-2006 04:36
dunno about your target audience, but having a real "kill all" (even as a seperate button) would be nice, as I've occasionly had anims stick, when getting up from objects, poseballs etc... and since it isn't an anim I applied, it's also not an anim I can easily name to turn off (similar problem to your 2 loops)
|