Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Stopping then restarting all animations?

Haravikk Mistral
Registered User
Join date: 8 Oct 2005
Posts: 2,482
06-29-2006 05:13
Okay, this is a fairly simple script chunk, the stuff that's done is more complex but these are the bits that matter:

CODE
myFunction() {
list anims = llGetAnimationList(llGetOwner());
integer x = 0;
llStartAnimation(animation); // Do my pose, then stop all other animations
@loop;
llStopAnimation(llList2String(anims, x));
if ((++x) < llGetListLength(anims)) jump loop;

// Do some stuff

x = 0;
@loop2;
llStartAnimation(llList2String(anims, x));
if ((++x) < llGetListLength(anims)) jump loop2;
llStopAnimation(animation); // Stop my pose once all others have returned
}


Stopping the animations works a charm, I needed that because my pose doesn't fully over-ride the standing animation so it looked funny unless I stopped it.
However, the startanimation part, which is meant to put me back to standing again doesn't seem to work

Now, I presume the reason for this is that llStartAnimation() doesn't accept keys, however, there appears to be no-way to change the key from llGetAnimationList() into a name that I can then use.

Is there a way to do this or am I going to have to check the avatar's current action (e.g sitting, standing etc)?
_____________________
Computer (Mac Pro):
2 x Quad Core 3.2ghz Xeon
10gb DDR2 800mhz FB-DIMMS
4 x 750gb, 32mb cache hard-drives (RAID-0/striped)
NVidia GeForce 8800GT (512mb)
Angela Salome
Registered User
Join date: 6 Oct 2005
Posts: 224
06-29-2006 23:07
From: Haravikk Mistral
Okay, this is a fairly simple script chunk, the stuff that's done is more complex but these are the bits that matter:

CODE
myFunction() {
list anims = llGetAnimationList(llGetOwner());
integer x = 0;
llStartAnimation(animation); // Do my pose, then stop all other animations
@loop;
llStopAnimation(llList2String(anims, x));
if ((++x) < llGetListLength(anims)) jump loop;

// Do some stuff

x = 0;
@loop2;
llStartAnimation(llList2String(anims, x));
if ((++x) < llGetListLength(anims)) jump loop2;
llStopAnimation(animation); // Stop my pose once all others have returned
}


Stopping the animations works a charm, I needed that because my pose doesn't fully over-ride the standing animation so it looked funny unless I stopped it.
However, the startanimation part, which is meant to put me back to standing again doesn't seem to work

Now, I presume the reason for this is that llStartAnimation() doesn't accept keys, however, there appears to be no-way to change the key from llGetAnimationList() into a name that I can then use.

Is there a way to do this or am I going to have to check the avatar's current action (e.g sitting, standing etc)?


Check out these links:
http://secondlife.com/badgeo/wakka.php?wakka=while
http://secondlife.com/badgeo/wakka.php?wakka=dowhile
http://secondlife.com/badgeo/wakka.php?wakka=for
They're better choices than using jump or goto.

Consider starting the animation after your script stops all other animations.

llStartAnimation doesn't accept keys. There's no way of changing a animation key back to a name, because ultimately the animation is not in the inventory of the prim. I'd let the avatar's AO restart any needed animations.