Difference between revisions of "Remove Prim Properties"

From Second Life Wiki
Jump to navigation Jump to search
m
(I'm thinking about having articles link directly into this (and I'm not keen on having to put in long targets in the links))
Line 3: Line 3:
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.
==Prim Scripts==


==Remove Floating Text ({{Anchor|llSetText|[[llSetText]]}})==
When dropped onto a prim, theses scripts will remove the designated property and delete itself from the prim.
 
===Remove Floating Text ({{Anchor|llSetText|[[llSetText]]}})===
<lsl>default {
<lsl>default {
     state_entry() {
     state_entry() {
Line 13: Line 15:
}</lsl>
}</lsl>


==Remove Particles ({{Anchor|llParticleSystem|[[llParticleSystem]]}})==
===Remove Particles ({{Anchor|llParticleSystem|[[llParticleSystem]]}})===
<lsl>default {
<lsl>default {
     state_entry() {
     state_entry() {
Line 21: Line 23:
}</lsl>
}</lsl>


==Remove Texture Animation ({{Anchor|llSetTextureAnim|[[llSetTextureAnim]]}})==
===Remove Texture Animation ({{Anchor|llSetTextureAnim|[[llSetTextureAnim]]}})===
<lsl>default {
<lsl>default {
     state_entry() {
     state_entry() {
Line 29: Line 31:
}</lsl>
}</lsl>


==Remove Sit Target ({{Anchor|llSitTarget|[[llSitTarget]]}})==
===Remove Sit Target ({{Anchor|llSitTarget|[[llSitTarget]]}})===
<lsl>default {
<lsl>default {
     state_entry() {
     state_entry() {
Line 37: Line 39:
}</lsl>
}</lsl>


==Remove Forced Mouselook on Sit ({{Anchor|llForceMouselook|[[llForceMouselook]]}})==
===Remove Forced Mouselook on Sit ({{Anchor|llForceMouselook|[[llForceMouselook]]}})===
<lsl>default {
<lsl>default {
     state_entry() {
     state_entry() {
Line 45: Line 47:
}</lsl>
}</lsl>


==Reset Pie Menu "Sit" Option ({{Anchor|llSetSitText|[[llSetSitText]]}})==
===Reset Pie Menu "Sit" Option ({{Anchor|llSetSitText|[[llSetSitText]]}})===
<lsl>default {
<lsl>default {
     state_entry() {
     state_entry() {
Line 53: Line 55:
}</lsl>
}</lsl>


==Reset Pie Menu "Touch" Option ({{Anchor|llSetTouchText|[[llSetTouchText]]}})==
===Reset Pie Menu "Touch" Option ({{Anchor|llSetTouchText|[[llSetTouchText]]}})===
<lsl>default {
<lsl>default {
     state_entry() {
     state_entry() {
         llSetTouchText("");
         llSetTouchText("");
        llRemoveInventory(llGetScriptName());
    }
}</lsl>
<!--
===Reset to Default Prim Status ({{Anchor|llSetStatus|[[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>
-->
==Object Scripts==
When dropped onto an object, theses scripts will remove the designated property from all prims and delete the script from the object's inventory.
===Remove Floating Text ({{Anchor|PRIM_TEXT|[[PRIM_TEXT]]}})===
<lsl>default {
    state_entry() {
        llSetLinkPrimitiveParamsFast(LINK_SET, [PRIM_TEXT, "", <1.0,1.0,1.0>, 1.0]);
        llRemoveInventory(llGetScriptName());
    }
}</lsl>
===Remove Particles ({{Anchor|llLinkParticleSystem|[[llLinkParticleSystem]]}})===
<lsl>default {
    state_entry() {
        llLinkParticleSystem(LINK_SET, []);
        llRemoveInventory(llGetScriptName());
    }
}</lsl>
===Remove Texture Animation ({{Anchor|llSetLinkTextureAnim|[[llSetLinkTextureAnim]]}})===
<lsl>default {
    state_entry() {
        llSetLinkTextureAnim(LINK_SET, FALSE, ALL_SIDES, 0, 0, 0.0, 0.0, 1.0);
        llRemoveInventory(llGetScriptName());
    }
}</lsl>
<!--
===Remove Sit Target ({{Anchor|llSitTarget|[[llSitTarget]]}})===
<lsl>default {
    state_entry() {
        llSitTarget(ZERO_VECTOR, ZERO_ROTATION);
        llRemoveInventory(llGetScriptName());
    }
}</lsl>
===Remove Forced Mouselook on Sit ({{Anchor|llForceMouselook|[[llForceMouselook]]}})===
<lsl>default {
    state_entry() {
        llForceMouselook(FALSE);
         llRemoveInventory(llGetScriptName());
         llRemoveInventory(llGetScriptName());
     }
     }
}</lsl>
}</lsl>


==Reset to Default Prim Status ({{Anchor|llSetStatus|[[llSetStatus]]}})==
===Reset Pie Menu "Sit" Option ({{Anchor|llSetSitText|[[llSetSitText]]}})===
<lsl>default {
    state_entry() {
        llSetSitText("");
        llRemoveInventory(llGetScriptName());
    }
}</lsl>
 
===Reset Pie Menu "Touch" Option ({{Anchor|llSetTouchText|[[llSetTouchText]]}})===
<lsl>default {
    state_entry() {
        llSetTouchText("");
        llRemoveInventory(llGetScriptName());
    }
}</lsl>
-->
===Reset to Default Object Status ({{Anchor|llSetStatus|[[llSetStatus]]}})===
<lsl>default {
<lsl>default {
     state_entry() {
     state_entry() {

Revision as of 12:51, 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.

Prim Scripts

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

Remove Floating Text ()

<lsl>default {

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

}</lsl>

Remove Particles ()

<lsl>default {

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

}</lsl>

Remove Texture Animation ()

<lsl>default {

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

}</lsl>

Remove Sit Target ()

<lsl>default {

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

}</lsl>

Remove Forced Mouselook on Sit ()

<lsl>default {

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

}</lsl>

Reset Pie Menu "Sit" Option ()

<lsl>default {

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

}</lsl>

Reset Pie Menu "Touch" Option ()

<lsl>default {

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

}</lsl>

Object Scripts

When dropped onto an object, theses scripts will remove the designated property from all prims and delete the script from the object's inventory.

Remove Floating Text ()

<lsl>default {

   state_entry() {
       llSetLinkPrimitiveParamsFast(LINK_SET, [PRIM_TEXT, "", <1.0,1.0,1.0>, 1.0]);
       llRemoveInventory(llGetScriptName());
   }

}</lsl>

Remove Particles ()

<lsl>default {

   state_entry() {
       llLinkParticleSystem(LINK_SET, []);
       llRemoveInventory(llGetScriptName());
   }

}</lsl>

Remove Texture Animation ()

<lsl>default {

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

}</lsl>

Reset to Default Object Status ()

<lsl>default {

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

}</lsl>