Group script
|
|
Leona Fraina
Registered User
Join date: 3 Jan 2007
Posts: 4
|
04-04-2008 19:55
Okay I know a bit about scripting(just enough to hurt myself really). I need a script that can be somehow set to one group but detect if a avatar has a completely different group active.
Bassically the idea is that I want this for a sim where all objects not part of the residents group get autoreturned but the people who are to access it should be in a completely different group. Is there someway to get the UUID of a group and the UUID of the Ava's currently active group so you can compare them?
I'm a bit sumped on this one and really don't want to do it in list form as its painful(over 100 people on the list)
Edit its touch activated
|
|
Kaluura Boa
Polygon Project
Join date: 27 Mar 2007
Posts: 194
|
04-04-2008 21:00
Bad luck for you... The group of an AV is more well guarded than Fort Knox. In other words, you can't read it through LSL.
The 2 instructions giving some information about an AV's group and that could be used in a touch event are:
llDetectedGroup(0) llSameGroup(llDetectedKey(0))
But both will only answer TRUE or FALSE to the question "Is this AV in the same group than this object?"
The simples solution would be that the landowner deeds a tiny parcel to the group which is allowed. So the object can be set on this parcel and deeded to this group. But all this is beyond the power of LSL...
|
|
Leona Fraina
Registered User
Join date: 3 Jan 2007
Posts: 4
|
04-04-2008 21:37
*sighs* Well at least I was right.... i was honestly hoping to be wrong
|
|
Antonius Misfit
Certifiable Linux Addict
Join date: 13 Jun 2006
Posts: 97
|
04-04-2008 22:08
From: Leona Fraina *sighs* Well at least I was right.... i was honestly hoping to be wrong Actually, there is a way to get a group ID with LSL. Take a look at this simple group inviter script from the Script Library(I've tested it and it totally works): /54/59/250395/1.htmlThe line you'll be interested in is this: string groupID =llList2String(llGetObjectDetails(llGetKey(), [OBJECT_GROUP]), 0);
|
|
Leona Fraina
Registered User
Join date: 3 Jan 2007
Posts: 4
|
04-04-2008 22:46
From: Antonius Misfit Actually, there is a way to get a group ID with LSL. Take a look at this simple group inviter script from the Script Library(I've tested it and it totally works): /54/59/250395/1.htmlThe line you'll be interested in is this: string groupID =llList2String(llGetObjectDetails(llGetKey(), [OBJECT_GROUP]), 0); But the problem is I need to get the group an Avi is in... not an object.
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
04-04-2008 23:39
You can get a group key, yes, but you can't test whether an avatar belongs to that group at this point, or even if an avatar is set to that group, unless the object with the script is.
|
|
Kidd Krasner
Registered User
Join date: 1 Jan 2007
Posts: 1,938
|
04-05-2008 11:05
From: Leona Fraina Bassically the idea is that I want this for a sim where all objects not part of the residents group get autoreturned but the people who are to access it should be in a completely different group. Is there someway to get the UUID of a group and the UUID of the Ava's currently active group so you can compare them?
Are you saying that only residents can put objects onto the sim but only people in a different group can use the scripted features of those objects? If that's the case, then one question is whether it's feasible to take advantage of the fine control over group permissions? Specifically, create a group with both resident and non-resident roles and use that for both. At the top level, disable all build and object entry from non-owners, and then grant build rights to the resident role. This would lose the ability of non-residents to rez things that get autoreturned after a while, but I can't tell from your description whether or not that's acceptable. This mechanism could make the membership management easier in some ways, and a bit more work in others, but not much. If this is not acceptable, then a different approach might be to have an object that belongs to the resident group but for which one prim belongs to the alternative group. I seem to remember reading that this is possible, and I'm assuming that the auto-return would be based upon the root prim's group. If it's too inconvenient to do this for multiple objects, you could do it with just one object on the sim acting as an authorization server, using llRegionSay to communicate with the others.
|
|
Leona Fraina
Registered User
Join date: 3 Jan 2007
Posts: 4
|
04-05-2008 13:21
From: Kidd Krasner If this is not acceptable, then a different approach might be to have an object that belongs to the resident group but for which one prim belongs to the alternative group. I seem to remember reading that this is possible, and I'm assuming that the auto-return would be based upon the root prim's group. If it's too inconvenient to do this for multiple objects, you could do it with just one object on the sim acting as an authorization server, using llRegionSay to communicate with the others.
This I might try.... see if it beats the autoreturn. I want to thank everyone here for their help its been very helpful.
|
|
Cypher Ragu
[Mad Scientist]
Join date: 6 Jul 2008
Posts: 174
|
08-22-2008 20:41
You can change preferences such as this without any scripts.
go to ABOUT LAND, navigate to the OPTIONS tab, and then set "rez objects" to group only, or something of the sort.
|