Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

What is the best way to stop an animation on unsit?

Kurt Zidane
Just Human
Join date: 1 Apr 2004
Posts: 636
08-04-2004 10:26
Hi I'm new to scripting, but I have done some research, and It seem there isn't an event that's triggered when avatars stand or when they sit. The closes thing I have found to ether of these events would be change. But my experience with change is that it can be rigged to detect sitting or standing. But it's ugly, and any events triggered on by change hacks happens after they stand. Witch means the user has to authorize the end of the animation to stop the animation. ick!

thanks to a buddy, who took a look at my code. I've learned of a timer hack. Witch is triggered while the user sitting, I guess that's why it can cancel animations after the avatar stands. I find
much easer to deal with, and implement, and it's clean.

But it bothers me that I have to waist server space, and processor time by running a timer constantly for each avatar sitting.

I really wish there was a onSit trigger, a sitting trigger and an unSit trigger that was triggered right before people stand. Maybe there is and I just don't know it.

Is there a better way to cancel animations?
Neo Rebus
Registered User
Join date: 10 Apr 2004
Posts: 59
Re: What is the best way to stop an animation on unsit?
08-04-2004 15:35
The "official" way to detect when an avatar is sitting on your object is to first set a sit target (via llSitTarget()), then use the "changed" event handler to check for CHANGED_LINK events, then use llAvatarOnSitTarget() to determine who is sitting on you. If that returns non-NULL, then that is the key of the avatar sitting on you - and you can request permission to play animations and it will be granted automatically. If llAvatarOnSitTarget() returns NULL, then you can (using the key originally obtained through llAvatarOnSitTarget() above and recorded somewhere in your program) stop the animation playing via llStopAnimation.

- Neo

From: someone
Originally posted by Kurt Zidane
Hi I'm new to scripting, but I have done some research, and It seem there isn't an event that's triggered when avatars stand or when they sit. The closes thing I have found to ether of these events would be change. But my experience with change is that it can be rigged to detect sitting or standing. But it's ugly, and any events triggered on by change hacks happens after they stand. Witch means the user has to authorize the end of the animation to stop the animation. ick!

thanks to a buddy, who took a look at my code. I've learned of a timer hack. Witch is triggered while the user sitting, I guess that's why it can cancel animations after the avatar stands. I find
much easer to deal with, and implement, and it's clean.

But it bothers me that I have to waist server space, and processor time by running a timer constantly for each avatar sitting.

I really wish there was a onSit trigger, a sitting trigger and an unSit trigger that was triggered right before people stand. Maybe there is and I just don't know it.

Is there a better way to cancel animations?