Difference between revisions of "Remove Prim Properties"

From Second Life Wiki
Jump to navigation Jump to search
(llSetTextureAnim)
(Adjusted toc targeting and sub-headings. Turned integers to floats where appropriate. Added target omega cancellation.)
Line 1: Line 1:
{{LSL Header|ml=*}}
{{LSL Header|ml=*}}
====Prim Properties====
=Prim Properties=
Prim properties are attributes of a prim which are set via scripts, yet are retained by the prim even after the script is deleted from the prim.  The two most common properties are floating text and particles.  The scripts below show how to remove these properties from a prim.
Prim properties are attributes of a prim which are set via scripts, yet are retained by the prim even after the script is deleted from the prim.  The two most common properties are floating text and particles.  The scripts below show how to remove these properties from a prim.


When dropped onto a prim, the script will remove the designated property and delete itself from the prim.
When dropped onto a prim, the script will remove the designated property and delete itself from the prim.
=====Remove Floating Text ([[llSetText|llSetText]])=====
 
<lsl>
==Remove Floating Text ([[llSetText]])==
default {
<lsl>default {
     state_entry() {
     state_entry() {
         llSetText("", <0,0,0>, 0);
         llSetText("", <0.0,0.0,0.0>, 0.0);
         llRemoveInventory(llGetScriptName());
         llRemoveInventory(llGetScriptName());
     }
     }
}
}</lsl>
</lsl>
 
=====Remove Particles ([[llParticleSystem|llParticleSystem]])=====
==Remove Particles ([[llParticleSystem]])==
<lsl>
<lsl>default {
default {
     state_entry() {
     state_entry() {
         llParticleSystem([]);
         llParticleSystem([]);
         llRemoveInventory(llGetScriptName());
         llRemoveInventory(llGetScriptName());
     }
     }
}
}</lsl>
</lsl>


=====Remove Texture Animation ([[llSetTextureAnim]])=====
==Remove Texture Animation ([[llSetTextureAnim]])==
<lsl>
<lsl>default {
default {
     state_entry() {
     state_entry() {
         llSetTextureAnim(FALSE, ALL_SIDES, 0, 0, 0.0, 0.0, 1.0);
         llSetTextureAnim(FALSE, ALL_SIDES, 0, 0, 0.0, 0.0, 1.0);
         llRemoveInventory(llGetScriptName());
         llRemoveInventory(llGetScriptName());
     }
     }
}
}</lsl>
</lsl>


=====Remove Sit Target ([[llSitTarget|llSitTarget]])=====
==Remove Sit Target ([[llSitTarget]])==
<lsl>
<lsl>default {
default {
     state_entry() {
     state_entry() {
         llSitTarget(ZERO_VECTOR, ZERO_ROTATION);
         llSitTarget(ZERO_VECTOR, ZERO_ROTATION);
         llRemoveInventory(llGetScriptName());
         llRemoveInventory(llGetScriptName());
     }
     }
}
}</lsl>
</lsl>


=====Remove Forced Mouselook on Sit ([[llForceMouselook]])=====
==Remove Forced Mouselook on Sit ([[llForceMouselook]])==
<lsl>
<lsl>default {
default {
     state_entry() {
     state_entry() {
         llForceMouselook(FALSE);
         llForceMouselook(FALSE);
         llRemoveInventory(llGetScriptName());
         llRemoveInventory(llGetScriptName());
     }
     }
}
}</lsl>
</lsl>


=====Reset Pie Menu "Sit" Option ([[llSetSitText|llSetSitText]])=====
==Reset Pie Menu "Sit" Option ([[llSetSitText]])==
<lsl>
<lsl>default {
default {
     state_entry() {
     state_entry() {
         llSetSitText("");
         llSetSitText("");
         llRemoveInventory(llGetScriptName());
         llRemoveInventory(llGetScriptName());
     }
     }
}
}</lsl>
</lsl>
 
=====Remove Pie Menu "Touch" Option ([[llSetTouchText|llSetTouchText]])=====
==Reset Pie Menu "Touch" Option ([[llSetTouchText]])==
<lsl>
<lsl>default {
default {
     state_entry() {
     state_entry() {
         llSetTouchText("");
         llSetTouchText("");
         llRemoveInventory(llGetScriptName());
         llRemoveInventory(llGetScriptName());
     }
     }
}
}</lsl>
</lsl>
 
=====Reset to Default Prim Status ([[llSetStatus|llSetStatus]])=====
==Reset to Default Prim Status ([[llSetStatus]])==
<lsl>
<lsl>default {
default {
     state_entry() {
     state_entry() {
         llSetStatus( STATUS_PHYSICS | STATUS_PHANTOM, FALSE);
         llSetStatus( STATUS_PHYSICS | STATUS_PHANTOM, FALSE);
Line 79: Line 68:
         llRemoveInventory(llGetScriptName());
         llRemoveInventory(llGetScriptName());
     }
     }
}
}</lsl>
</lsl>
 
==Cancel Spinning ([[llTargetOmega]])==
<lsl>default {
    state_entry() {
        llTargetOmega(<0.0,0.0,0.0>, 0.0, 0.0);
        llRemoveInventory(llGetScriptName());
    }
}</lsl>


[[Category:LSL Examples]]
[[Category:LSL Examples]]

Revision as of 03:41, 18 May 2010

Prim Properties

Prim properties are attributes of a prim which are set via scripts, yet are retained by the prim even after the script is deleted from the prim. The two most common properties are floating text and particles. The scripts below show how to remove these properties from a prim.

When dropped onto a prim, the script will remove the designated property and delete itself from the prim.

Remove Floating Text (llSetText)

<lsl>default {

   state_entry() {
       llSetText("", <0.0,0.0,0.0>, 0.0);
       llRemoveInventory(llGetScriptName());
   }

}</lsl>

Remove Particles (llParticleSystem)

<lsl>default {

   state_entry() {
       llParticleSystem([]);
       llRemoveInventory(llGetScriptName());
   }

}</lsl>

Remove Texture Animation (llSetTextureAnim)

<lsl>default {

   state_entry() {
       llSetTextureAnim(FALSE, ALL_SIDES, 0, 0, 0.0, 0.0, 1.0);
       llRemoveInventory(llGetScriptName());
   }

}</lsl>

Remove Sit Target (llSitTarget)

<lsl>default {

   state_entry() {
       llSitTarget(ZERO_VECTOR, ZERO_ROTATION);
       llRemoveInventory(llGetScriptName());
   }

}</lsl>

Remove Forced Mouselook on Sit (llForceMouselook)

<lsl>default {

   state_entry() {
       llForceMouselook(FALSE);
       llRemoveInventory(llGetScriptName());
   }

}</lsl>

Reset Pie Menu "Sit" Option (llSetSitText)

<lsl>default {

   state_entry() {
       llSetSitText("");
       llRemoveInventory(llGetScriptName());
   }

}</lsl>

Reset Pie Menu "Touch" Option (llSetTouchText)

<lsl>default {

   state_entry() {
       llSetTouchText("");
       llRemoveInventory(llGetScriptName());
   }

}</lsl>

Reset to Default Prim Status (llSetStatus)

<lsl>default {

   state_entry() {
       llSetStatus( STATUS_PHYSICS | STATUS_PHANTOM, FALSE);
       llSetStatus( STATUS_ROTATE_X | STATUS_ROTATE_Y | STATUS_ROTATE_Z, TRUE);
       llRemoveInventory(llGetScriptName());
   }

}</lsl>

Cancel Spinning (llTargetOmega)

<lsl>default {

   state_entry() {
       llTargetOmega(<0.0,0.0,0.0>, 0.0, 0.0);
       llRemoveInventory(llGetScriptName());
   }

}</lsl>