Jump to content

How do I test to see if I am wearing the same group tag a parcel is set to?


Life Camino
 Share

You are about to reply to a thread that has been inactive for 3511 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I need my script to be able to test whether or not I have rez rights in the parcel and if group building is allowed, I need to know if I have the correct group activated.  I can retrieve the group key for the parcel.  But, what do I  with it?  I looked up llSameGroup(id) and it didn't seem to fit the situation.  Do I pass the parcel UUID to llSameGroup(id) or do I pass the Group UUID to llSameGroup(id)?

Any help would be appreciated.

Link to comment
Share on other sites

Assuming that you are in a touch* or sensor* or collision* event where llDetectedKey(0) makes sense ...

if (llSameGroup(llDetectedKey(0))){    llSay(0,"You are in the same group that this object is set to.");}else{    llSay(0, "You don't belong here.");}

 

Link to comment
Share on other sites

Perhaps, a little more information is in order: 

I'm wearing a teleporter HUD.  It rezzes beams - but, only if it can.  I want the teleporter script to detect whether or not I can rez before trying.  Because, if I try to rez, and I can't, I get an error message.  And, instead of getting an error message because I can't rez my beam, I want to use llTeleportAgentGlobalCoords and not use a beam at all.

So, I can't use your suggestion.  I need something else to tell me whether I can rez on a parcel of land.

Link to comment
Share on other sites

Oh, I hate it when someone poses a fascinating puzzle on a Friday.  OK, Try this.....

default{    touch_start(integer total_number)    {        if (llGetParcelFlags(llGetPos()) & PARCEL_FLAG_ALLOW_CREATE_OBJECTS)        {            llOwnerSay("Anyone can rez objects here");        }        else if (llGetParcelFlags(llGetPos()) & PARCEL_FLAG_ALLOW_CREATE_GROUP_OBJECTS)        {            llOwnerSay("Only group members can rez here.");            llSensor("","",ACTIVE|PASSIVE,5.0,PI);        }                }        sensor(integer num)    {        if(llDetectedGroup(0))        {            llOwnerSay("You are in the same group");        }        else        {            llOwnerSay("You are not in the same group");        }    }        no_sensor()    {        llOwnerSay("No nearby objects detected.  Try again.");    }}

 So, put that into a prim and attach it as a HUD.  Then stand within 5 m of ANYTHING in the parcel and touch the HUD.  You should be able to tell whether rezzing is restricted to group members and, if so, whether you are in the same group as whatever you are standing nearest to (within 5 m).  Assuming that the detected object would not be there if a group member hadn't rezzed it, you'll know whether it's OK for you to rez as well.  It's not 100% foolproof but it gets you close.

Link to comment
Share on other sites

That puzzle puzzled me too.

You can get the group key of the hud:

     key hud_groupkey=llList2Key(llGetObjectDetails(llGetKey(),[OBJECT_GROUP]),0);

And the groupkey of the parcel:

     key land_groupkey=llList2Key(llGetParcelDetails(llGetPos(),[PARCEL_DETAILS_GROUP]),0);

If they are equal you are in the same group the parcel is set to. I made a short test and it works for me. The hud always has the group of the avatar.

Link to comment
Share on other sites

This seems to work:

default {    touch_start(integer total_number) {        key groupkey = llList2Key(llGetObjectDetails(llGetKey(), [OBJECT_GROUP]), 0);        list details = llGetParcelDetails(llGetPos(), [PARCEL_DETAILS_GROUP]);                if (llGetParcelFlags(llGetPos()) & PARCEL_FLAG_ALLOW_CREATE_OBJECTS) {            llOwnerSay("CanRez");        }        else if (llGetParcelFlags(llGetPos()) & PARCEL_FLAG_ALLOW_CREATE_GROUP_OBJECTS) {            if (llList2Key(details,0) == groupkey) {                llOwnerSay("CanRez");            }            else llOwnerSay("NoRez");        }        else llOwnerSay("NoRez");    }}

 

Link to comment
Share on other sites

I combined your example and all I know. Did I miss anything?

default {
    touch_start(integer total_number)
    {
        if (llGetOwner()==llList2Key(llGetParcelDetails(llGetPos(),[PARCEL_DETAILS_OWNER]),0))
        {
            llOwnerSay("The owner of the parcel can always rez.");
        }
        else if (llGetParcelFlags(llGetPos()) & PARCEL_FLAG_ALLOW_CREATE_OBJECTS)
        {
            llOwnerSay("Anyone can rez objects here.");
        }
        else if (llGetParcelFlags(llGetPos()) & PARCEL_FLAG_ALLOW_CREATE_GROUP_OBJECTS)
        {
            llOwnerSay("Only group members can rez here.");
            key hud_groupkey=llList2Key(llGetObjectDetails(llGetKey(),[OBJECT_GROUP]),0);
            key land_groupkey=llList2Key(llGetParcelDetails(llGetPos(),[PARCEL_DETAILS_GROUP]),0);
        if (hud_groupkey==land_groupkey)
         {
             llOwnerSay("You are a group member.");
         }
            else
            {
                llOwnerSay("You are a not a group member.");
            }
        }
        else
        {
            llOwnerSay("You can not rez here.");
        }
    }
}

 

Link to comment
Share on other sites

I was playing around and found 2 'problems'.

1. When on land that is not deeded to a group, the land_groupkey is null. If the hud owner is not wearing a grouptag, the hud_grouptag is also null. This gives a false result when on land that is not group-owned and has 'only group members can rez' option active. The solution to this is to check if the parcel-owner-key and the parcel-group-key are the same.

integer CanRez() {    integer T;    if (llGetOwner() == llList2Key(llGetParcelDetails(llGetPos(),[PARCEL_DETAILS_OWNER]),0)) {        // Land owner can allways rez.        T = 1;    }    else if (llGetParcelFlags(llGetPos()) & PARCEL_FLAG_ALLOW_CREATE_OBJECTS) {         // Everyone can rez here.        T = 1;    }    else if (llGetParcelFlags(llGetPos()) & PARCEL_FLAG_ALLOW_CREATE_GROUP_OBJECTS) {         // Group members can rez here.        list parcel_keys = llGetParcelDetails(llGetPos(),[PARCEL_DETAILS_GROUP, PARCEL_DETAILS_OWNER]);         if (llList2Key(parcel_keys, 0) == llList2Key(parcel_keys, 1)) {                // Land is group-owned            key hud_groupkey = llList2Key(llGetObjectDetails(llGetKey(),[OBJECT_GROUP]),0);            key land_groupkey = llList2Key(parcel_keys,0);            if (hud_groupkey == land_groupkey) {                  // Hud owner is a group member.                T = 1;            }        }    }    return T;}default {    touch_start(integer total_number) {        if (CanRez()) llOwnerSay("You can rez here.");        else llOwnerSay("You can not rez here.");    }}

 

2. If the land is group deeded, the owner of the group can rez there. However, if (s)he is not wearing the grouptag, and the parcel is set to 'only group members can rez', the script says (s)he can not rez.
I don't know if there's a way around that.  

Link to comment
Share on other sites

Cool, another case covered :)

If land is deeded - the owner of the group can always rez? Hmmm - I see no way to find out if someone is group owner, even if the group tag is worn.

Do estate owners can rez everywhere? Due to different timezones I will find that out later. But doesnt matter, there is no script function to get that info anyways.

Looks like a script can cover most, but not all cases.

But I checked the wiki for llRezAtRoot
Rezzing fails silently without error message if rez is not possible. So the statement of the OP that he gets an error message is wrong - in theory :) SL does not throw an error, but my viewer writes an info about the failed rez into my chat window. Well I see no problem to ignore that since nobody else can see it.

In this case you can rez something and start a timer. If the object_rez event fires - bingo - you can rez - if the timer fires you can't. Only problem I see is: rezzing time can be everything between nearly 0 and a few seconds and in very rare cases the rez can be delayed an eternity. :D

A simple question like "can I rez here" is obviously a super complicated matter. :D

Link to comment
Share on other sites

What i am wondering right now is if it is at all necessary to have rez rights in order to create beams. If the beams are particles/objects that are spawn from an invisible prim that you are wearing, then you shouldn't need rez rights at all? I have never created such an object, but I own HUDs that do similar stuff and they always work, even if there is no rez permission.

Link to comment
Share on other sites

You think that's what the OP means when he says "beams"?  I assumed he meant that he was rezzing some sort of prim I-beams -- goodness only knows why -- but particle beams do make more sense.  If that's the case, then I agree.  We've all been wasting our time worrying about whether the OP can rez stuff.  He can create a particle beam anywhere.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3511 days.

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
 Share

×
×
  • Create New...