Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Poseball script question

Dylan Rickenbacker
Animator
Join date: 11 Oct 2006
Posts: 365
02-02-2008 07:38
Hi, I have several poseballs with my own poseball script linked to one piece of furniture. When someone sits on one of them, I get a script error from the others because the changed event is triggered in all of them, not just the one I sit on. How can I avoid that?
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
02-02-2008 07:53
In the changed() event handler, check to see if it applies to the specific scripted prim--usually testing if llAvatarOnSitTarget() has changed (assuming this is a normal, llSitTarget() poseball).
Beezle Warburton
=o.O=
Join date: 10 Nov 2006
Posts: 1,169
02-02-2008 07:57
From: Dylan Rickenbacker
Hi, I have several poseballs with my own poseball script linked to one piece of furniture. When someone sits on one of them, I get a script error from the others because the changed event is triggered in all of them, not just the one I sit on. How can I avoid that?


Use a llAvatarOnSitTarget() check to make sure someone is actually sitting on the prijm inside the change event.

Example:

changed(integer change)
{
if (change & CHANGED_LINK)
{
if (llAvatarOnSitTarget() != NULL_KEY)
{
llRequestPermissions(llAvatarOnSitTarget(), PERMISSION_TRIGGER_ANIMATION);
}
}
}
_____________________
Though this be madness, yet there is method in't.
-- William Shakespeare

Warburton's Whimsies:
In SL
Apez.biz
Dylan Rickenbacker
Animator
Join date: 11 Oct 2006
Posts: 365
02-02-2008 09:14
Yes, that's exactly what I've been doing. I still get that script error (avatar not found). Not in every piece of furniture with multiple poseballs, but every time in some of them. I can't make out what's the difference.
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
02-02-2008 15:41
I think seeing the script is probably the next step. Other than that... probably the most common error is to try to stop the animation of a non-existent avatar just because there's no llAvatarOnSitTarget(). One way to avoid that is to test llGetPermissionsKey(). But "avatar not found" doesn't seem like quite the right error for that condition.
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
02-02-2008 17:01
Take a look at my AO Overriding poseball script and see if that helps:

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