LlGetParcelFlags Test

From Second Life Wiki
Revision as of 16:14, 5 August 2009 by Dil Spitz (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
  1. Create a box, add the script below to the box.
  2. Touch the box. It will say a lot of lines about parcel and region flags.
  3. Open the About Land dialog for the parcel the object is on.
  4. - Verify that the PARCEL_FLAG statements made by the object match those shown in the About Land window. (Will require looking at multiple tabs.)
  5. As a non-God or Estate Owner open the Region/Estate window (from the World menu)
  6. - Verify the REGION_FLAG statements match what you can find in the Region/Estate menu.
  • There are some REGION_FLAGs that aren't currently showing to everyone, including direct teleport. Verify as a god or estate owner that the statements made by the box match.

<lsl> // llGetRegionFlags() and llGetParcelFlags() test lsl script testFlag(integer flags, integer flag, string flag_name) {

   if (flags & flag)
   {
       llOwnerSay(flag_name + " is set to TRUE");
   }
   else
   {
       llOwnerSay(flag_name + " is set to FALSE");
   }    

}

default {

   touch_start(integer total_number)
   {
       integer rf = llGetRegionFlags();
       integer pf = llGetParcelFlags(llGetPos());
       
       llOwnerSay("Parcel flags: (" + (string)pf + ")");
       testFlag(pf,PARCEL_FLAG_ALLOW_CREATE_OBJECTS,"PARCEL_FLAG_ALLOW_CREATE_OBJECTS");
       testFlag(pf,PARCEL_FLAG_ALLOW_DAMAGE,"PARCEL_FLAG_ALLOW_DAMAGE");
       testFlag(pf,PARCEL_FLAG_ALLOW_FLY,"PARCEL_FLAG_ALLOW_FLY");
       testFlag(pf,PARCEL_FLAG_ALLOW_LANDMARK,"PARCEL_FLAG_ALLOW_LANDMARK");
       testFlag(pf,PARCEL_FLAG_ALLOW_SCRIPTS,"PARCEL_FLAG_ALLOW_SCRIPTS");
       testFlag(pf,PARCEL_FLAG_ALLOW_TERRAFORM,"PARCEL_FLAG_ALLOW_TERRAFORM");
       testFlag(pf,PARCEL_FLAG_LOCAL_SOUND_ONLY,"PARCEL_FLAG_LOCAL_SOUND_ONLY");
       testFlag(pf,PARCEL_FLAG_USE_ACCESS_GROUP,"PARCEL_FLAG_USE_ACCESS_GROUP");
       testFlag(pf,PARCEL_FLAG_USE_ACCESS_LIST,"PARCEL_FLAG_USE_ACCESS_LIST");
       testFlag(pf,PARCEL_FLAG_USE_BAN_LIST,"PARCEL_FLAG_USE_BAN_LIST");
       testFlag(pf,PARCEL_FLAG_USE_LAND_PASS_LIST,"PARCEL_FLAG_USE_LAND_PASS_LIST");
       
       llOwnerSay("Region flags: (" + (string)rf + ")");
       testFlag(rf,REGION_FLAG_ALLOW_DAMAGE,"REGION_FLAG_ALLOW_DAMAGE");
       testFlag(rf,REGION_FLAG_ALLOW_DIRECT_TELEPORT,"REGION_FLAG_ALLOW_DIRECT_TELEPORT");
       testFlag(rf,REGION_FLAG_BLOCK_FLY,"REGION_FLAG_BLOCK_FLY");
       testFlag(rf,REGION_FLAG_BLOCK_TERRAFORM,"REGION_FLAG_BLOCK_TERRAFORM");
       testFlag(rf,REGION_FLAG_DISABLE_COLLISIONS,"REGION_FLAG_DISABLE_COLLISIONS");
       testFlag(rf,REGION_FLAG_DISABLE_PHYSICS,"REGION_FLAG_DISABLE_PHYSICS");
       testFlag(rf,REGION_FLAG_FIXED_SUN,"REGION_FLAG_FIXED_SUN");
       testFlag(rf,REGION_FLAG_SANDBOX,"REGION_FLAG_SANDBOX");
   }

} </lsl>