|
|
Line 1: |
Line 1: |
| {{LSL Header|ml=*}}
| | #REDIRECT [[Prim Properties#Reset_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 Scripts==
| |
| | |
| When dropped onto a prim, theses scripts will remove the designated property and delete itself from the prim.
| |
| | |
| ===Remove Floating Text ({{Anchor|llSetText|[[llSetText]]}})===
| |
| <source lang="lsl2">default {
| |
| state_entry() {
| |
| llSetText("", <0.0,0.0,0.0>, 0.0);
| |
| llRemoveInventory(llGetScriptName());
| |
| }
| |
| }</source>
| |
| | |
| ===Remove Particles ({{Anchor|llParticleSystem|[[llParticleSystem]]}})===
| |
| <source lang="lsl2">default {
| |
| state_entry() {
| |
| llParticleSystem([]);
| |
| llRemoveInventory(llGetScriptName());
| |
| }
| |
| }</source>
| |
| | |
| ===Remove Texture Animation ({{Anchor|llSetTextureAnim|[[llSetTextureAnim]]}})===
| |
| <source lang="lsl2">default {
| |
| state_entry() {
| |
| llSetTextureAnim(FALSE, ALL_SIDES, 0, 0, 0.0, 0.0, 1.0);
| |
| llRemoveInventory(llGetScriptName());
| |
| }
| |
| }</source>
| |
| | |
| ===Remove Sit Target ({{Anchor|llSitTarget|[[llSitTarget]]}})===
| |
| <source lang="lsl2">default {
| |
| state_entry() {
| |
| llSitTarget(ZERO_VECTOR, ZERO_ROTATION);
| |
| llRemoveInventory(llGetScriptName());
| |
| }
| |
| }</source>
| |
| | |
| ===Remove Forced Mouselook on Sit ({{Anchor|llForceMouselook|[[llForceMouselook]]}})===
| |
| <source lang="lsl2">default {
| |
| state_entry() {
| |
| llForceMouselook(FALSE);
| |
| llRemoveInventory(llGetScriptName());
| |
| }
| |
| }</source>
| |
| | |
| ===Reset Pie Menu "Sit" Option ({{Anchor|llSetSitText|[[llSetSitText]]}})===
| |
| <source lang="lsl2">default {
| |
| state_entry() {
| |
| llSetSitText("");
| |
| llRemoveInventory(llGetScriptName());
| |
| }
| |
| }</source>
| |
| | |
| ===Reset Pie Menu "Touch" Option ({{Anchor|llSetTouchText|[[llSetTouchText]]}})===
| |
| <source lang="lsl2">default {
| |
| state_entry() {
| |
| llSetTouchText("");
| |
| llRemoveInventory(llGetScriptName());
| |
| }
| |
| }</source>
| |
| <!--
| |
| ===Reset to Default Prim Status ({{Anchor|llSetStatus|[[llSetStatus]]}})===
| |
| <source lang="lsl2">default {
| |
| state_entry() {
| |
| llSetStatus( STATUS_PHYSICS | STATUS_PHANTOM, FALSE);
| |
| llSetStatus( STATUS_ROTATE_X | STATUS_ROTATE_Y | STATUS_ROTATE_Z, TRUE);
| |
| llRemoveInventory(llGetScriptName());
| |
| }
| |
| }</source>
| |
| -->
| |
| | |
| ==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]]}})===
| |
| <source lang="lsl2">default {
| |
| state_entry() {
| |
| llSetLinkPrimitiveParamsFast(LINK_SET, [PRIM_TEXT, "", <0.0,0.0,0.0>, 0.0]);
| |
| llRemoveInventory(llGetScriptName());
| |
| }
| |
| }</source>
| |
| | |
| ===Remove Particles ({{Anchor|llLinkParticleSystem|[[llLinkParticleSystem]]}})===
| |
| <source lang="lsl2">default {
| |
| state_entry() {
| |
| llLinkParticleSystem(LINK_SET, []);
| |
| llRemoveInventory(llGetScriptName());
| |
| }
| |
| }</source>
| |
| | |
| ===Remove Texture Animation ({{Anchor|llSetLinkTextureAnim|[[llSetLinkTextureAnim]]}})===
| |
| <source lang="lsl2">default {
| |
| state_entry() {
| |
| llSetLinkTextureAnim(LINK_SET, FALSE, ALL_SIDES, 0, 0, 0.0, 0.0, 1.0);
| |
| llRemoveInventory(llGetScriptName());
| |
| }
| |
| }</source>
| |
| <!--
| |
| ===Remove Sit Target ({{Anchor|llSitTarget|[[llSitTarget]]}})===
| |
| <source lang="lsl2">default {
| |
| state_entry() {
| |
| llSitTarget(ZERO_VECTOR, ZERO_ROTATION);
| |
| llRemoveInventory(llGetScriptName());
| |
| }
| |
| }</source>
| |
| | |
| ===Remove Forced Mouselook on Sit ({{Anchor|llForceMouselook|[[llForceMouselook]]}})===
| |
| <source lang="lsl2">default {
| |
| state_entry() {
| |
| llForceMouselook(FALSE);
| |
| llRemoveInventory(llGetScriptName());
| |
| }
| |
| }</source>
| |
| | |
| ===Reset Pie Menu "Sit" Option ({{Anchor|llSetSitText|[[llSetSitText]]}})===
| |
| <source lang="lsl2">default {
| |
| state_entry() {
| |
| llSetSitText("");
| |
| llRemoveInventory(llGetScriptName());
| |
| }
| |
| }</source>
| |
| | |
| ===Reset Pie Menu "Touch" Option ({{Anchor|llSetTouchText|[[llSetTouchText]]}})===
| |
| <source lang="lsl2">default {
| |
| state_entry() {
| |
| llSetTouchText("");
| |
| llRemoveInventory(llGetScriptName());
| |
| }
| |
| }</source>
| |
| -->
| |
| ===Reset to Default Object Status ({{Anchor|llSetStatus|[[llSetStatus]]}})===
| |
| <source lang="lsl2">default {
| |
| state_entry() {
| |
| llSetStatus( STATUS_PHYSICS | STATUS_PHANTOM, FALSE);
| |
| llSetStatus( STATUS_ROTATE_X | STATUS_ROTATE_Y | STATUS_ROTATE_Z, TRUE);
| |
| llRemoveInventory(llGetScriptName());
| |
| }
| |
| }</source>
| |
| | |
| [[Category:LSL Examples]]
| |