Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Change default sit animation unreliable

Kayaker Magic
low carbonated footprint
Join date: 11 Sep 2008
Posts: 109
12-06-2008 18:47
I don’t want avatars to squat while they are teleporting, even if I llUnSeat them just a fraction of a second later, and besides sometimes the double-click doesn’t take and they squat in front of my telepad. So I put the following code in to change the default sit behavior to a standing pose. It works some of the time, but most of the time it doesn’t work at all and my avatar gets into the sit position. What am I doing wrong?


changed(integer change)
{
if (change & CHANGED_LINK)
{
key user = llAvatarOnSitTarget();
if (user != NULL_KEY)
{
llRequestPermissions(user, PERMISSION_TRIGGER_ANIMATION);
}
}
} //changed

run_time_permissions(integer perm)
{
if(PERMISSION_TRIGGER_ANIMATION & perm)
{
llStopAnimation("sit";);
llStartAnimation("stand_2";);

}
} // run_time_permissions
Osprey Therian
I want capslocklock
Join date: 6 Jul 2004
Posts: 5,049
12-06-2008 19:14
Does it have anything to do with the priority of the anim your AO is running?
Kayaker Magic
low carbonated footprint
Join date: 11 Sep 2008
Posts: 109
12-06-2008 19:23
From: Osprey Therian
Does it have anything to do with the priority of the anim your AO is running?

I'm not running any other animations that I know of, I'm even using the default walk on my newbie avatar.
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
12-06-2008 19:49
From: Kayaker Magic
I'm not running any other animations that I know of, I'm even using the default walk on my newbie avatar.

Try throwing a half second sleep in after llStopAnimation("sit";);

But.................. "that I know of" is the key phrase and can be a problem. You need to get the animation list and stop each. You can see how I did it here:

https://wiki.secondlife.com/wiki/AO_Overriding_Pose_Ball
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Kayaker Magic
low carbonated footprint
Join date: 11 Sep 2008
Posts: 109
llSleep fixed it!
12-06-2008 20:49
From: Jesse Barnett
Try throwing a half second sleep in after llStopAnimation("sit";);


A HALF A SECOND! THAT IS FOREVER! However, I tried it and it works! My avatar starts to sit down, then goes into the pose I wanted. So I tried 0.1 seconds instead, much nicer. I go into the desired pose with no visible squat, and so far it has worked every time instead of 10% of the time without the sleep. I understand your concern about stopping all animations, I took a look at your script, if I was making a for-sale product out of this I would do all that work. But for now I'm a happy camper! Things are working well enough for now. Thanks for your help!