Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Items deeded to group, llGetOwner() and llSameGroup()

Nepenthes Ixchel
Broadly Offended.
Join date: 6 Dec 2005
Posts: 696
03-22-2006 00:59
Here is the desired behavior:

If object is owned by an individual, only accept commands from that individual.
If object had been deeded to a group only accept commands from members of that group.


I've already conceeded to having the user wear the appropriate group tag since it appears to be impossible to access any other group information at all (like "are they an officer?", which would be nice) but I'm not clear on the following:

What do llGetOwner() and llGetownerKey() return if an item is deeded to a group?

How can I tell if an item has been deeded to a group?

Can a listen handler be set to listen for members of a particular group, or do I need to make an open listener and run llSameGroup() in the listen handler?
Greg Hauptmann
Registered User
Join date: 30 Oct 2005
Posts: 283
03-22-2006 01:43
don't know the answer however I'm very interested to hear more on this (I just posted a question which is somewhat related to this at /54/db/95260/1.html)
Sable Sunset
Prim Herder
Join date: 15 Apr 2005
Posts: 223
03-22-2006 04:41
It looks like you're generally on the right tracks:

From: Nepenthes Ixchel
What do llGetOwner() and llGetownerKey() return if an item is deeded to a group?
They return the key of the group the object has been deeded to. Interesting info, but generally pretty useless as none of the other functions (llKey2Name(), llDetectedGroup etc.) provide you with the ability to 1) Convert the key back into a group name, and 2) grab the group key directly from an Avatar for comparison.

From: Nepenthes Ixchel
How can I tell if an item has been deeded to a group?
The CHANGED_OWNER property of the changed() event will be triggered when the object is deeded to group. For more information on this see the >LSL Wiki<: Specifically >this< page.

From: Nepenthes Ixchel
Can a listen handler be set to listen for members of a particular group, or do I need to make an open listener and run llSameGroup() in the listen handler?
You'll need to use llSameGroup() within the listen handler.

I hope the information is useful! :D
_____________________
Nepenthes Ixchel
Broadly Offended.
Join date: 6 Dec 2005
Posts: 696
03-23-2006 02:16
Hmm... is there any way to use llReqestAgentData() to see if a given key is an agent or a group? I don't need to detect the moment when an item is deeded to a group, as much as I need to ba able to have a script start up and know if the object is group owned.
Sable Sunset
Prim Herder
Join date: 15 Apr 2005
Posts: 223
03-23-2006 05:38
From: Nepenthes Ixchel
Hmm... is there any way to use llReqestAgentData() to see if a given key is an agent or a group? I don't need to detect the moment when an item is deeded to a group, as much as I need to ba able to have a script start up and know if the object is group owned.


I'm not sure what llKey2Name returns when passed the key of a group. If it errors in a specific way (i.e. returns -1) then it may be possible to use this output to determine if the objet has been deeded at some point previously. I'm not able to get IW atm (at work) so you'll need to test this for yourself. :)
_____________________
Sky Honey
Coder
Join date: 16 May 2005
Posts: 105
03-23-2006 08:05
llRequestAgentData doesn't cause a dataserver event if the key is a group key, so it's a reliable way to tell the difference. It's not fast because you have to use a timer and if the interval is too short and the system is laggy it could time out even if the key is an agent. I haven't tried llKey2Name with a group key but I expect it returns an empty string. It will also do that for an agent if they're not nearby though.
_____________________
Nepenthes Ixchel
Broadly Offended.
Join date: 6 Dec 2005
Posts: 696
03-23-2006 15:10
From: sky Honey
I haven't tried llKey2Name with a group key but I expect it returns an empty string. It will also do that for an agent if they're not nearby though.


From memory it returns an empty string, which would be good if I wanted to listen to the group when the owner wasn't in the sim. :-)


After careful consideration, I'll just add a "grouplisten={TRUE|FALSE}" in the config notecard, and a warning in the docs that if grouplisten is enabled anyone in the right group can break things.