Difference between revisions of "Remove Prim Properties"

From Second Life Wiki
Jump to navigation Jump to search
(In the old protocol I think it does some fancy null encoding so that zero values take up less space. My memory is really fuzzy on this one.)
m (<lsl> tag to <source>)
Line 8: Line 8:


===Remove Floating Text ({{Anchor|llSetText|[[llSetText]]}})===
===Remove Floating Text ({{Anchor|llSetText|[[llSetText]]}})===
<lsl>default {
<source lang="lsl2">default {
     state_entry() {
     state_entry() {
         llSetText("", <0.0,0.0,0.0>, 0.0);
         llSetText("", <0.0,0.0,0.0>, 0.0);
         llRemoveInventory(llGetScriptName());
         llRemoveInventory(llGetScriptName());
     }
     }
}</lsl>
}</source>


===Remove Particles ({{Anchor|llParticleSystem|[[llParticleSystem]]}})===
===Remove Particles ({{Anchor|llParticleSystem|[[llParticleSystem]]}})===
<lsl>default {
<source lang="lsl2">default {
     state_entry() {
     state_entry() {
         llParticleSystem([]);
         llParticleSystem([]);
         llRemoveInventory(llGetScriptName());
         llRemoveInventory(llGetScriptName());
     }
     }
}</lsl>
}</source>


===Remove Texture Animation ({{Anchor|llSetTextureAnim|[[llSetTextureAnim]]}})===
===Remove Texture Animation ({{Anchor|llSetTextureAnim|[[llSetTextureAnim]]}})===
<lsl>default {
<source lang="lsl2">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>
}</source>


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


===Remove Forced Mouselook on Sit ({{Anchor|llForceMouselook|[[llForceMouselook]]}})===
===Remove Forced Mouselook on Sit ({{Anchor|llForceMouselook|[[llForceMouselook]]}})===
<lsl>default {
<source lang="lsl2">default {
     state_entry() {
     state_entry() {
         llForceMouselook(FALSE);
         llForceMouselook(FALSE);
         llRemoveInventory(llGetScriptName());
         llRemoveInventory(llGetScriptName());
     }
     }
}</lsl>
}</source>


===Reset Pie Menu "Sit" Option ({{Anchor|llSetSitText|[[llSetSitText]]}})===
===Reset Pie Menu "Sit" Option ({{Anchor|llSetSitText|[[llSetSitText]]}})===
<lsl>default {
<source lang="lsl2">default {
     state_entry() {
     state_entry() {
         llSetSitText("");
         llSetSitText("");
         llRemoveInventory(llGetScriptName());
         llRemoveInventory(llGetScriptName());
     }
     }
}</lsl>
}</source>


===Reset Pie Menu "Touch" Option ({{Anchor|llSetTouchText|[[llSetTouchText]]}})===
===Reset Pie Menu "Touch" Option ({{Anchor|llSetTouchText|[[llSetTouchText]]}})===
<lsl>default {
<source lang="lsl2">default {
     state_entry() {
     state_entry() {
         llSetTouchText("");
         llSetTouchText("");
         llRemoveInventory(llGetScriptName());
         llRemoveInventory(llGetScriptName());
     }
     }
}</lsl>
}</source>
<!--
<!--
===Reset to Default Prim Status ({{Anchor|llSetStatus|[[llSetStatus]]}})===
===Reset to Default Prim Status ({{Anchor|llSetStatus|[[llSetStatus]]}})===
<lsl>default {
<source lang="lsl2">default {
     state_entry() {
     state_entry() {
         llSetStatus( STATUS_PHYSICS | STATUS_PHANTOM, FALSE);
         llSetStatus( STATUS_PHYSICS | STATUS_PHANTOM, FALSE);
Line 70: Line 70:
         llRemoveInventory(llGetScriptName());
         llRemoveInventory(llGetScriptName());
     }
     }
}</lsl>
}</source>
-->
-->


Line 78: Line 78:


===Remove Floating Text ({{Anchor|PRIM_TEXT|[[PRIM_TEXT]]}})===
===Remove Floating Text ({{Anchor|PRIM_TEXT|[[PRIM_TEXT]]}})===
<lsl>default {
<source lang="lsl2">default {
     state_entry() {
     state_entry() {
         llSetLinkPrimitiveParamsFast(LINK_SET, [PRIM_TEXT, "", <0.0,0.0,0.0>, 0.0]);
         llSetLinkPrimitiveParamsFast(LINK_SET, [PRIM_TEXT, "", <0.0,0.0,0.0>, 0.0]);
         llRemoveInventory(llGetScriptName());
         llRemoveInventory(llGetScriptName());
     }
     }
}</lsl>
}</source>


===Remove Particles ({{Anchor|llLinkParticleSystem|[[llLinkParticleSystem]]}})===
===Remove Particles ({{Anchor|llLinkParticleSystem|[[llLinkParticleSystem]]}})===
<lsl>default {
<source lang="lsl2">default {
     state_entry() {
     state_entry() {
         llLinkParticleSystem(LINK_SET, []);
         llLinkParticleSystem(LINK_SET, []);
         llRemoveInventory(llGetScriptName());
         llRemoveInventory(llGetScriptName());
     }
     }
}</lsl>
}</source>


===Remove Texture Animation ({{Anchor|llSetLinkTextureAnim|[[llSetLinkTextureAnim]]}})===
===Remove Texture Animation ({{Anchor|llSetLinkTextureAnim|[[llSetLinkTextureAnim]]}})===
<lsl>default {
<source lang="lsl2">default {
     state_entry() {
     state_entry() {
         llSetLinkTextureAnim(LINK_SET, FALSE, ALL_SIDES, 0, 0, 0.0, 0.0, 1.0);
         llSetLinkTextureAnim(LINK_SET, FALSE, ALL_SIDES, 0, 0, 0.0, 0.0, 1.0);
         llRemoveInventory(llGetScriptName());
         llRemoveInventory(llGetScriptName());
     }
     }
}</lsl>
}</source>
<!--
<!--
===Remove Sit Target ({{Anchor|llSitTarget|[[llSitTarget]]}})===
===Remove Sit Target ({{Anchor|llSitTarget|[[llSitTarget]]}})===
<lsl>default {
<source lang="lsl2">default {
     state_entry() {
     state_entry() {
         llSitTarget(ZERO_VECTOR, ZERO_ROTATION);
         llSitTarget(ZERO_VECTOR, ZERO_ROTATION);
         llRemoveInventory(llGetScriptName());
         llRemoveInventory(llGetScriptName());
     }
     }
}</lsl>
}</source>


===Remove Forced Mouselook on Sit ({{Anchor|llForceMouselook|[[llForceMouselook]]}})===
===Remove Forced Mouselook on Sit ({{Anchor|llForceMouselook|[[llForceMouselook]]}})===
<lsl>default {
<source lang="lsl2">default {
     state_entry() {
     state_entry() {
         llForceMouselook(FALSE);
         llForceMouselook(FALSE);
         llRemoveInventory(llGetScriptName());
         llRemoveInventory(llGetScriptName());
     }
     }
}</lsl>
}</source>


===Reset Pie Menu "Sit" Option ({{Anchor|llSetSitText|[[llSetSitText]]}})===
===Reset Pie Menu "Sit" Option ({{Anchor|llSetSitText|[[llSetSitText]]}})===
<lsl>default {
<source lang="lsl2">default {
     state_entry() {
     state_entry() {
         llSetSitText("");
         llSetSitText("");
         llRemoveInventory(llGetScriptName());
         llRemoveInventory(llGetScriptName());
     }
     }
}</lsl>
}</source>


===Reset Pie Menu "Touch" Option ({{Anchor|llSetTouchText|[[llSetTouchText]]}})===
===Reset Pie Menu "Touch" Option ({{Anchor|llSetTouchText|[[llSetTouchText]]}})===
<lsl>default {
<source lang="lsl2">default {
     state_entry() {
     state_entry() {
         llSetTouchText("");
         llSetTouchText("");
         llRemoveInventory(llGetScriptName());
         llRemoveInventory(llGetScriptName());
     }
     }
}</lsl>
}</source>
-->
-->
===Reset to Default Object Status ({{Anchor|llSetStatus|[[llSetStatus]]}})===
===Reset to Default Object Status ({{Anchor|llSetStatus|[[llSetStatus]]}})===
<lsl>default {
<source lang="lsl2">default {
     state_entry() {
     state_entry() {
         llSetStatus( STATUS_PHYSICS | STATUS_PHANTOM, FALSE);
         llSetStatus( STATUS_PHYSICS | STATUS_PHANTOM, FALSE);
Line 140: Line 140:
         llRemoveInventory(llGetScriptName());
         llRemoveInventory(llGetScriptName());
     }
     }
}</lsl>
}</source>


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

Revision as of 16:43, 24 January 2015

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 ()

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

Remove Particles ()

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

Remove Texture Animation ()

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

Remove Sit Target ()

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

Remove Forced Mouselook on Sit ()

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

Reset Pie Menu "Sit" Option ()

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

Reset Pie Menu "Touch" Option ()

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

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 ()

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

Remove Particles ()

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

Remove Texture Animation ()

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

Reset to Default Object Status ()

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