Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

How do you set the Group of an object?

AnnMarie Otoole
Addicted scripter
Join date: 6 Jan 2007
Posts: 162
02-11-2008 18:28
I want to check that the person OWNING the object is in a particular group.
I used the Set function in edit to set the required group on the object.
I tried saving it with and without "share with group" checked.
But every time it is rezzed the "set" group changes to what ever current group is set on the owner's avatar.

So the script:-
if(llSameGroup(OwnerKey)== FALSE){
llOwnerSay("Only available to XXXX group members. Self destructing.";);
llDie();
}
Is useless because the group re-sets set to the owner's group every time and is never FALSE.

What did I miss here?
Alicia Sautereau
if (!social) hide;
Join date: 20 Feb 2007
Posts: 3,125
02-11-2008 20:02
try the llDetectedKey(0) and run that trough the LLSameGroup check

you can`t set the group of an object and will be the active group the person used to place this object
_____________________
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
02-11-2008 20:07
I know there's a way to get the actual key of a group. If you can get that key, you can hardcode the check of "llDetectedGroup" or "llSameGroup" against the key OF the group, rather than against the key of the owner/rezzed object/whatever.

I know it CAN be done, I'm not sure HOW specifically it IS done.

You MIGHT be able to do something with using an OBJECT rather than an agent for llSameGroup comparison. I'm not sure if the object needs to be in the same sim or not. I'd experiment. See if you can get the key for the group you want to test, see if you can set a wooden prim to the correct group, get the prim's key, and then walk a few sims away and see if you can test against that object with llSameGroup.

There's a few possibilities. Unfortunately, the wikis are not comprehensive, and a lot of lsl elements aren't as well explained as some would like:

http://wiki.secondlife.com/wiki/LlSameGroup
http://slhomepage.com/lsl/llSameGroup.htm
http://www.lslwiki.net/lslwiki/wakka.php?wakka=llSameGroup
http://rpgstats.com/wiki/index.php?title=LlSameGroup
_____________________

● Inworld Store: http://slurl.eclectic-randomness.com
● Website: http://www.eclectic-randomness.com
● Twitter: @WinterVentura
AnnMarie Otoole
Addicted scripter
Join date: 6 Jan 2007
Posts: 162
02-11-2008 20:44
llDetectedKey won't work. You need an event to trigger the detection and this is an ownership test.

Well I had more or less come to the conclusions presented but it just seemed very strange that the llSameGroup is a totally useless function.

I too remember reading something about getting a group key. It is obscure but there somewhere.
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
02-11-2008 20:59
well you can use the on_rez event. and llSameGroup. Likewise I suppose you COULD use a sensor on rez, to ping out to detect the owner that did the rezzing.

But as the OP points out, the object takes on the owner's current group, on rez.

I wonder if no-modify & no-copy will lock in the group setting? I know that some guy gave out some Halo armor once that would unwear if you weren't wearing the right group tag. So I've seen this done, but I'm not ENTIRELY sure how it WAS done.
_____________________

● Inworld Store: http://slurl.eclectic-randomness.com
● Website: http://www.eclectic-randomness.com
● Twitter: @WinterVentura
Harleen Gretzky
Registered User
Join date: 27 Oct 2005
Posts: 51
02-11-2008 21:57
llGetObjectDetails can be used to get a group key. llSameGroup and llDetectedGroup do not return keys to compare against it though. The typical use of these functions is to detect the active group of an avatar using a permanently rezzed object set to the group (e.g. a group-only TP). Several different groups can be detected by using a link set of prims set to different groups.

You could put your object in a rezzed vendor that checks the group before the agent is given the object, that way they at least had to be a member of the group when they obtained the object.
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
02-12-2008 01:50
It seems you can have different prims in an object set to different groups. It might be worth testing whether it is every prim in the link set or only the root prim that is changed when the object is rezzed. Of course, I don't know what happens on change of ownership either. :confused:
Kahiro Watanabe
Registered User
Join date: 28 Sep 2007
Posts: 572
02-12-2008 02:52
From: Harleen Gretzky
llGetObjectDetails can be used to get a group key. llSameGroup and llDetectedGroup do not return keys to compare against it though. The typical use of these functions is to detect the active group of an avatar using a permanently rezzed object set to the group (e.g. a group-only TP). Several different groups can be detected by using a link set of prims set to different groups.

You could put your object in a rezzed vendor that checks the group before the agent is given the object, that way they at least had to be a member of the group when they obtained the object.


Harleen got the point:

key myGroupKey = "put-your-group's-key-here";
default
{
on_rez(integer parameter)
{
list myList;
myList = llGetObjectDetails(llGetKey(),[OBJECT_GROUP]);

if (llList2Key(myList,0) != myGroupKey)
{
llSay(0,"Sorry";);
}
}

}

No need to check llSameGroup(key) on rez because it will always be the same in this instance.
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
02-12-2008 06:39
I knew there was a way, I just couldn't find the right command! Good show!
_____________________

● Inworld Store: http://slurl.eclectic-randomness.com
● Website: http://www.eclectic-randomness.com
● Twitter: @WinterVentura