Domitan Redenblack Posted August 9, 2011 Share Posted August 9, 2011 If someone touches my hat, how do I tell if that person is a member of a group that I am in?If I we are each members of 20 groups, with some overlap, is there a way to tell?Or does the person that touches my hat have to have a group tag on that matches my own group tag showing? Link to comment Share on other sites More sharing options...
Rolig Loon Posted August 9, 2011 Share Posted August 9, 2011 The person has to be wearing a group tag that matches your hat's group. You could each have several groups in common, but there's no way that you can have a script look to see what groups another person might belong to. You can only check for a match against your hat and then only if the person has that group active at the moment. Link to comment Share on other sites More sharing options...
Domitan Redenblack Posted August 9, 2011 Author Share Posted August 9, 2011 Rolig Loon wrote: ...your hat's group. Can that be diff from my current group tag? You mean the group set in the Edit window? Perms etc? Does that interfere with other actions or perms, setting a Group on an object? Link to comment Share on other sites More sharing options...
Rolig Loon Posted August 9, 2011 Share Posted August 9, 2011 Function: integer llSameGroup( key Returns an integer boolean, that is TRUE if agent has the same active group, otherwise FALSE • key agent – avatar UUID that is in the same region Also returns TRUE if the object is deeded to the same active group as agent Also returns TRUE if the object is "set to" or deeded to the same group as group UUID (i.e. key OBJECT_GROUP) Your hat doesn't care (or know) what your current group is. llSameGroup is comparing your hat's group (look on the General page of Edit if you really don't know what your hat's group is for some reason) with the active group of the agent whose key you put into the function(in your example, fed by llDetectedKey because the agent touched the hat). It's a nice, simple, straightforward function. No frills. Link to comment Share on other sites More sharing options...
Domitan Redenblack Posted August 9, 2011 Author Share Posted August 9, 2011 Sorry, still confused. llSameGroup(toucher_key) checks the group of the whole object, or the group of the root, or the group of the prim? When I am wearing the "whole" hat now, and click Edit on it, it shows Group = (none) .... with a "Set" button. Is there another place for the object's group to be set? Or only there? Link to comment Share on other sites More sharing options...
Dora Gustafson Posted August 9, 2011 Share Posted August 9, 2011 Wiki and Waka Link to comment Share on other sites More sharing options...
Rolig Loon Posted August 9, 2011 Share Posted August 9, 2011 Read the LSL Wiki : "Also returns TRUE if the object is not set to a group (i.e. "(none)") and either the AV with the given key has no group active or the function is called with a NULL_KEY." Your hat's group is the group of the hat: the whole hat and nothing but the hat. While it is possible under unusual circumstances to set different prims in the same linkset to different groups, that's not what happens by default. Also, if you do that and then take the hat to inventory and re-rez it, the entire hat will be reset to the same group. Link to comment Share on other sites More sharing options...
Qwalyphi Korpov Posted August 9, 2011 Share Posted August 9, 2011 /me thinks that to really have this set of questions you need to have avoided reading about llSameGroup in the wiki. Link to comment Share on other sites More sharing options...
Void Singer Posted August 9, 2011 Share Posted August 9, 2011 by default all prims in an object are set to the group that you had active when the object is rezzed. if you change your active group, or change the group via edit, they will not match, and it will use whatever that prim is set to. you cannot set the group for a single prim of an object, only the whole object. the only special case is setting multiple unlinked prims to different groups before linking them... rezzing wipes this out as described above. Link to comment Share on other sites More sharing options...
Domitan Redenblack Posted August 9, 2011 Author Share Posted August 9, 2011 All: Sorry, this is my first programming with groups, and I find the Wiki very confusing since I am apparently not clear on how groups work with objects... And there is setting the group plus deeding the object to a group as well, as for TV sets with parcel media. Not sure how that affects our discussions. I think I understand now why the dance pole in a friend's club got broken so often. It was set to allow only group members to be able to dance on it, and you had to wear your tag. But sometimes it would not let you dance even if you were wearing your tag correctly. Resetting the scripts in the dance pole did not seem to help either, only the group/club owner could reset the pole I think. Of the 20+ members around, no one seemed to know why it kept breaking. If I change my group, then detach and re-attach the hat to my skull, will that then reset the hat to my current group? Is there a way to detect if I change my group tag in LSL? If so, I could auto detach and re-attach, yes? Is there a way to set the group of the hat *permanently* (until reset scripts etc) ? Will deeding the hat to a group do this? Link to comment Share on other sites More sharing options...
Rolig Loon Posted August 9, 2011 Share Posted August 9, 2011 (1) When you make an object, its group defaults to whatever tag are wearing at the time. (2) An object's group won't change unless you do it deliberately. (3) To change an object's group, you have to open the General page of Edit and set a new group by choosing the little wrnch and screwdriver tool icon next to "Group" and select a group name (one of the groups that YOU belong to) from the list presented. (4) Rarely, you may need to deed some objects, like radios, to the group in order to have access to some parcel properties. If so, then you have to click the Deed button on the General page. Once you do that, you are no longer the owner. The group is. There's not much else you need to know. It is all very simple. Link to comment Share on other sites More sharing options...
Void Singer Posted August 10, 2011 Share Posted August 10, 2011 Domitan Redenblack wrote: If I change my group, then detach and re-attach the hat to my skull, will that then reset the hat to my current group? (yes) Is there a way to detect if I change my group tag in LSL? (sort of *) If so, I could auto detach and re-attach, yes? (correct) Is there a way to set the group of the hat *permanently* (until reset scripts etc) ? (sort of **) Will deeding the hat to a group do this? (see **) * the only way to detect changes in an avatars group is to poll for it. and then you can only tell if it changes to or from the same group. if the change is from one different group, to another different group, it cannot be detected. ** Deeding does lock down the group of an object, but you no longer own it so you can't wear it. the only way to undeed it by script is to force it to go offworld (forces return). someone with group ability to rerurn it can also do that. Link to comment Share on other sites More sharing options...
Domitan Redenblack Posted August 10, 2011 Author Share Posted August 10, 2011 Thanks to you all, very much. No matter how I slice it, it seems that group control of the attachment is probably not a good idea due to LSL/SL restrictions. Probably a better way is to have keep a list of authorized residents, etc. Thanks again. Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now