Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llGetParcelFlags and group information

Kayaker Magic
low carbonated footprint
Join date: 11 Sep 2008
Posts: 109
07-03-2009 00:35
I have an autonomous critter that I want to keep out of trouble. Having it detect when it is about to leave the owners parcel would be one way, but how do I detect that? It would also be nice to navigate away from home in safe areas.
I’ve done this with llGetParcelFlags with some success, but I can’t find a way to take advantage of group settings. If my critter looks ahead into another parcel and sees ALLOW_SCRIPTS it may be safe to proceed. But if I see only ALLOW_GROUP_SCRIPTS how do I know if the critter’s owner is a member of the group? llSameGroup(llGetOwner()) looks like it might tell me this, but only for my current position, not where I am going.
I can find out the key of the group in a parcel I am about to step into with llGetParcelDetails, but how do I know if my critters owner is a member of that group? Is there a request to enumerate the owners group ids so I can search for it?
Are USE_BAN_LIST and USE_ACCESS_LIST only about avatars entering parcels, or do they ban/allow my moving objects as well? If they do, how do I find out if my owner is on one of the lists?
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
07-03-2009 04:56
From: Kayaker Magic
I have an autonomous critter that I want to keep out of trouble. Having it detect when it is about to leave the owners parcel would be one way, but how do I detect that?

check out llOverMyLand

From: someone
It would also be nice to navigate away from home in safe areas.
I’ve done this with llGetParcelFlags with some success, but I can’t find a way to take advantage of group settings. If my critter looks ahead into another parcel and sees ALLOW_SCRIPTS it may be safe to proceed. But if I see only ALLOW_GROUP_SCRIPTS how do I know if the critter’s owner is a member of the group? llSameGroup(llGetOwner()) looks like it might tell me this, but only for my current position, not where I am going.

llSameGroup(llGetOwner()) will actually only tell you the owners current group (or possibly the last one set while they were in the sim, or the critters own group, or null, not sure)


From: someone
I can find out the key of the group in a parcel I am about to step into with llGetParcelDetails, but how do I know if my critters owner is a member of that group? Is there a request to enumerate the owners group ids so I can search for it?

nope, no reporting on which group the av is in, although you CAN check to see if the critters group is the same as the parcel it's entering... that's one guaranteed group

From: someone
Are USE_BAN_LIST and USE_ACCESS_LIST only about avatars entering parcels, or do they ban/allow my moving objects as well? If they do, how do I find out if my owner is on one of the lists?

they only list av's, but I believe they affect all objects owned by that av, so...

a dirty way of checking if the land ahead will support said critter is to rezz a temp-on-rez sensor, and move it into the parcel... if it fails to report back, it's obviously not safe...

vehicle controls might also be an option, but I'm not really in depth on that set of functions, so ymmv.
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Kayaker Magic
low carbonated footprint
Join date: 11 Sep 2008
Posts: 109
07-03-2009 08:41
From: Void Singer
check out llOverMyLand

This only works with an object ID, using the critters ID tells me if it is in my land now, but not after it moves...


From: someone
although you CAN check to see if the critters group is the same as the parcel it's entering...

Really, how do I do that? I thought you said llSameGroup was ambiguous. I know the group ID of the parcel its entering, but not the criters own group. Unless there is some other simple routine I'm missing...

From: someone
they only list av's, but I believe they affect all objects owned by that av, so...

They list? How do I read that list? If my critter could read the list I could do the test.

From: someone
a dirty way of checking if the land ahead will support said critter is to rezz a temp-on-rez sensor, and move it into the parcel... if it fails to report back, it's obviously not safe...

There are many places where my critter could safely travel but where it or I am not allowed to rez.
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
07-03-2009 16:00
From: Kayaker Magic
This only works with an object ID, using the critters ID tells me if it is in my land now, but not after it moves...

used in conjunction with that temp rez sensor... see caveat below.

From: someone
Really, how do I do that? I thought you said llSameGroup was ambiguous. I know the group ID of the parcel its entering, but not the criters own group. Unless there is some other simple routine I'm missing...

if you're trying to check versus the owner (you) yes... if your checking against the parcel owner (group owned) then it compares to the group thats set for your critter. you could also preload group group keys, and test directly against those, but Im not 100% sure said critter will be allowed if it doesn't have the same group set (you'll need to test)

From: someone
They list? How do I read that list? If my critter could read the list I could do the test.

I don't believe you can read the list unfortunately. on the plus side it should behave like no-object-entry and keep you from moving into the parcel at all. *I think*

From: someone
There are many places where my critter could safely travel but where it or I am not allowed to rez.

assuming you rezzed where you started, and only moved to new parcels after... beyond that, it's hit or miss.
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Kayaker Magic
low carbonated footprint
Join date: 11 Sep 2008
Posts: 109
more success with llGetParcelFlags ()
08-05-2009 15:30
The following function checks for ALLOW_SCRIPTS and ALLOW_OBJECT_ENTRY both globally and in the same group that the object belongs in. This has allowed my critters to roam over most of the parcels on my island, and avoid ones where they can’t work.
There are still two problems: Some parcels have auto return turned on, and my critter is returned to Lost and Found. Is there a way to detect places where this will happen so I can void them?
And there is one parcel on my island that is surrounded by red “NO ENTRY” text lines that only appear in the air when you fly close to them. The only parcel flags on in this area is ALLOW_SCRIPTS, GROUP_OBJECT_ENTRY and ALLOW_GROUP_OBJECT_ENTRY. The parcel group matches the object group and the ban and access lists are not enabled. My critter flies up to the boundary and stops advancing (llSetPos stops working), but the script is still running. How can I detect these areas so my critter can avoid them?

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

integer okfly(vector lookpos) //return true if lookpos is safe to move into
{
integer flags=llGetParcelFlags(lookpos);
key pgroup=llList2Key(llGetParcelDetails(lookpos,[PARCEL_DETAILS_GROUP]),0);
if (
(
(flags&PARCEL_FLAG_ALLOW_SCRIPTS) ||
((pgroup==ogroup)&&;(flags&PARCEL_FLAG_ALLOW_GROUP_SCRIPTS))
)&&
(
(flags&PARCEL_FLAG_ALLOW_ALL_OBJECT_ENTRY) ||
((pgroup==ogroup)&&;(flags&PARCEL_FLAG_ALLOW_GROUP_OBJECT_ENTRY))
)
)
return TRUE;
return FALSE;
}
jeaniesing Trilling
Loves to animate & script
Join date: 21 Oct 2006
Posts: 61
08-05-2009 22:23
Within the same parcel.....

if you are using setpos then you know where the next position is... if you know where the next position is you can mess with this function to see whether it is on your parcel

integer jt_isvectoronproperty(vector nextpos)
{
list critterparcellist = llGetParcelDetails(llGetPos(),[PARCEL_DETAILS_NAME]);
list nextparcellist = llGetParcelDetails(nextpos,0),[PARCEL_DETAILS_NAME]);
string nextparcel = llList2String(nextparcellist,0);
string critterparcel = llList2String(critterparcellist,0);
if (nextparcel==critterparcel)//compares this parcel name to the next position
return TRUE;
else return FALSE;
}
if TRUE go on to that pos

if FALSE you might return it to its previous position (that requires keeping it in a variable somewhere) and letting its random take over after that... the critter might hesitate in corners from time to time
_____________________
Pinastri/113/171/30
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
08-06-2009 01:47
From: Kayaker Magic
... And there is one parcel on my island that is surrounded by red “NO ENTRY” text lines that only appear in the air when you fly close to them. The only parcel flags on in this area is ALLOW_SCRIPTS, GROUP_OBJECT_ENTRY and ALLOW_GROUP_OBJECT_ENTRY.
If it is NO ENTRY then one of two flags are set: PARCEL_FLAG_USE_ACCESS_GROUP or PARCEL_FLAG_USE_ACCESS_LIST.
Unless you have a personal ban on that parcel:)
_____________________
From Studio Dora
Kayaker Magic
low carbonated footprint
Join date: 11 Sep 2008
Posts: 109
08-06-2009 21:18
From: Dora Gustafson
If it is NO ENTRY then one of two flags are set: PARCEL_FLAG_USE_ACCESS_GROUP or PARCEL_FLAG_USE_ACCESS_LIST.
Unless you have a personal ban on that parcel:)

You are right, I thought USE_ACCESS_LIST was off, but it is on on that parcel. So by adding the following test to my OKfly function, I can avoid that parcel now!
(!(flags&PARCEL_FLAG_USE_ACCESS_LIST))
(if there is an access list I'm probably not in it)

Great! So now how do I detect when autoreturn is on in a parcel?
Kayaker Magic
low carbonated footprint
Join date: 11 Sep 2008
Posts: 109
How to stay in-parcel
08-06-2009 21:28
Earlier I whined that llOverMyLand only tells you if your object is there, it doesn’t help you avoid going off-parcel. Well, I found a way to do that! The following test will result in TRUE if the position lookpos is inside the owners parcel, FALSE outside:

llList2Key(llGetParcelDetails(lookpos,[PARCEL_DETAILS_OWNER]),0)
==llGetOwner()

If this returns TRUE, then it is safe to call llSetPos(lookpos).

OH! I just noticed jeaniesing Trilling's post above on how to do something very similar by using the parcel name instead of the owners key! Yup, that would also work!
Kayaker Magic
low carbonated footprint
Join date: 11 Sep 2008
Posts: 109
Allow Public Acess
08-12-2009 02:51
I’ll just keep talking to myself here under the foolish hope that someone will find a use for some of the crap I’ve figured out.
llGetParcelFlags will tell me if a parcel allows my object to rez, enter, or scripts to run. I’ve learned that if PARCEL_FLAG_USE_ACCESS_LIST is set, it will override all those flags, unless I am on the list. Since there is no way to read the list, I have to assume if there is one then I am NOT on it. I can live with that. But then there is a button in the Access tab of the About Land dialog that says “Allow Public Access” and this seems to OVERRIDE the Access List and allow the rest of us in (restricted by the rez, enter or scripts flags again).
When someone sets this bit, it seems to also suppress the PARCEL_FLAG_USE_ACCESS_LIST bit in the return from llGetParcelFlags. This is a good thing because it tells me if my object can fly into this parcel. It is all very confusing and COMPLETEY UNDOCUMENTED as far as I can tell.
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
08-12-2009 06:07
From: Kayaker Magic
It is all very confusing and COMPLETEY UNDOCUMENTED as far as I can tell.
I don't think so:) I think it is pretty obvious from the flag names and what you can see online in the land editor. Say: is it not logic that PARCEL_FLAG_USE_ACCESS_GROUP and PARCEL_FLAG_USE_ACCESS_LIST are of no importance when the public check mark is set? That is just my opinion.
I use this site as reference:
http://www.lslwiki.net/lslwiki/wakka.php?wakka=llGetParcelFlags
_____________________
From Studio Dora