Which is the way to find the key of the avatar that are wearing the object (in attachment).
Clearly the script is running on this object
Thanks
These forums are CLOSED. Please visit the new forums HERE
Avatar key detection question |
|
|
Electra Rehula
Registered User
Join date: 17 May 2007
Posts: 9
|
08-31-2007 07:17
Which is the way to find the key of the avatar that are wearing the object (in attachment).
Clearly the script is running on this object Thanks |
|
RJ Source
Green Sky Labs
Join date: 10 Jan 2007
Posts: 272
|
08-31-2007 07:22
At the time the object gets attached, your script can contain an attach event handler.
This event handler is passed the key of the avatar to which the object is being attached. http://rpgstats.com/wiki/index.php?title=Attach Another way would be to call llGetAttached() to insure the object is attached (returns 0 if not attached), and if it is attached, call llGetOwner(). This would work because attachments can only be worn by the owner. |
|
Shadow Subagja
Registered User
Join date: 29 Apr 2007
Posts: 354
|
08-31-2007 10:04
I thiiiiink you can also get they key like this:
if(llGetLinkKey(0) != llGetKey()) { avatarKey = llGetLinkKey(0); } This might be hogwash.. but if the object is not linked, it has link number 0. If it is linked to objects, there is no link 0. But if I recall.. if it is attached to an avatar, the avatar is link 0. Anybody care to remind me if I'm right? |
|
Darien Caldwell
Registered User
Join date: 12 Oct 2006
Posts: 3,127
|
08-31-2007 12:32
If they are wearing the object, they have to be the owner.
So you can just use llGetOwner(); _____________________
|
|
Jotheph Nemeth
Registered User
Join date: 9 Aug 2007
Posts: 142
|
09-01-2007 14:49
I thiiiiink you can also get they key like this: if(llGetLinkKey(0) != llGetKey()) { avatarKey = llGetLinkKey(0); } This might be hogwash.. but if the object is not linked, it has link number 0. If it is linked to objects, there is no link 0. But if I recall.. if it is attached to an avatar, the avatar is link 0. Anybody care to remind me if I'm right? You're both right and wrong. Depends on if it's a linked set or a single prim: "In objects with only one prim, the object's link number is 0 (unless there is an avatar sitting on it; then it is 1). In objects with multiple prims, the root is 1 and children start at 2. So, in a 2-prim object, llGetLinkNumber would return 1 in the parent/root and 2 in the first (and only) child. Avatars seated on an object are assigned link numbers at the end of the linked set in the order seated." So basically a single prim, the seated avatar is link 0. In a multi-prim object, the avatar is the max prims+1. But not sure about unseated attached avatars. Either way, I wouldn't recommend using linknums to get the avatar key. |
|
Wildefire Walcott
Heartbreaking
Join date: 8 Nov 2005
Posts: 2,156
|
09-01-2007 14:57
If they are wearing the object, they have to be the owner. So you can just use llGetOwner(); Yeah, that. _____________________
Desperation Isle Estates: Great prices, great neighbors, great service!
http://desperationisle.blogspot.com/ New Desperation Isle: The prettiest BDSM Playground and Fetish Mall in SL! http://desperationisle.com/ Desperation Isle Productions: Skyboxes for lots (and budgets) of all sizes! |