Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llReleasePermissions

Eadoin Welles
Registered User
Join date: 5 Jan 2007
Posts: 149
05-02-2008 09:12
I have a sit that asks permissions to animate an avatar. I use chat to select the animation, and so I can change the sit pose while the avatar is sit. However if I use the chat when the vatar stands up, the avatar is still animated. I suspect I have to release permissions before stand up, but how? There is no llReleasePermissions function in LSL!

Note that if I place

llRequestPermissions(avatar,0x00) ;

in the changed event when avatar stands up, I get an error, since avatar is no more available for granting permissions.
Lear Cale
wordy bugger
Join date: 22 Aug 2007
Posts: 3,569
05-02-2008 09:39
I bet if you pass NULL_KEY to llRequestPermissions(), it will have the desired effect.

However, there is a simple alternative that works regardless: don't take action unless llAvatarOnSitTarget() matches llGetPermissionsKey(), and they're not NULL_KEY.

BTW, the error you're getting has nothing to do with whether the avatar is sitting. You can request permissions when an avatar is not sitting. Something else is going on there. Perhaps 'avatar' is NULL_KEY or something, in which case my first suggestion won't work. Try using the key of the avatar who had been sitting.
BamBam Sachertorte
floral engineer
Join date: 12 Jul 2005
Posts: 228
05-03-2008 08:08
It is also a good idea to check if the avatar is still logged in before animating them or stopping an animation. Check if llGetAgentInfo(key) returns a non-zero value before changing the avatar's animation. Although in your case it is impossible for llAvatarOnSitTarget() to return the key of a logged out avatar. But when stopping animation on avatar unsit you do need to check for logout.
Eadoin Welles
Registered User
Join date: 5 Jan 2007
Posts: 149
05-05-2008 04:07
From: Lear Cale
I bet if you pass NULL_KEY to llRequestPermissions(), it will have the desired effect.

However, there is a simple alternative that works regardless: don't take action unless llAvatarOnSitTarget() matches llGetPermissionsKey(), and they're not NULL_KEY.

BTW, the error you're getting has nothing to do with whether the avatar is sitting. You can request permissions when an avatar is not sitting. Something else is going on there. Perhaps 'avatar' is NULL_KEY or something, in which case my first suggestion won't work. Try using the key of the avatar who had been sitting.


I did as you said and it works, of couse. Thank you very much. Just a question... what if the object that animates an avatar is not a sit but an attached one? How do I get the key in that case?
Lear Cale
wordy bugger
Join date: 22 Aug 2007
Posts: 3,569
05-05-2008 07:02
For an attachment, use llGetOwner(). Only the owner can attach an object. If the object is dual-purpose (attached or set out), you can use llGetOwner in the "attach" handler.
Eadoin Welles
Registered User
Join date: 5 Jan 2007
Posts: 149
05-05-2008 09:53
From: Lear Cale
For an attachment, use llGetOwner(). Only the owner can attach an object. If the object is dual-purpose (attached or set out), you can use llGetOwner in the "attach" handler.


Thank you