Difference between revisions of "Prim Properties"

From Second Life Wiki
Jump to navigation Jump to search
(Add some params that I missed)
(Add more missed params.)
Line 27: Line 27:
|-
|-
| Sound Queueing || [[llSetSoundQueueing]] || Flags if sounds are added to a playback queue when invoked via LSL, or are played instantly.
| Sound Queueing || [[llSetSoundQueueing]] || Flags if sounds are added to a playback queue when invoked via LSL, or are played instantly.
|-
| Sound Playback (Looped) || [[llLoopSound]],[[llLoopSoundMaster]],[[llLoopSoundSlave]] || Initiates playback of a sound sample, which is played indefinitely. (Until stopped by [[llStopSound]])
|-
|-
| Camera Position || [[llSetCameraAtOffset]],[[llSetLinkCamera]] || Sets the location where an avatar's camera will be positioned when sat on the object.
| Camera Position || [[llSetCameraAtOffset]],[[llSetLinkCamera]] || Sets the location where an avatar's camera will be positioned when sat on the object.
Line 35: Line 37:
|-
|-
| Sit Target || [[llSitTarget]],[[PRIM_SIT_TARGET]] || Dictates where the avatar sits on the object.
| Sit Target || [[llSitTarget]],[[PRIM_SIT_TARGET]] || Dictates where the avatar sits on the object.
|-
| Scripted Sit Only || [[SCRIPTED_SIT_ONLY]] || '''Experience only:''' Prevents an avatar manually sitting on the object.
|-
| Allow Unsit || [[PRIM_ALLOW_UNSIT]] || '''Experience only:''' Prevents an avatar from getting up manually.
|-
|-
| Keyframed Motion'''*''' || [[llSetKeyframedMotion]] || '''*'''Only when [[KFM_LOOP]] or [[KFM_PING_PONG]] is set.
| Keyframed Motion'''*''' || [[llSetKeyframedMotion]] || '''*'''Only when [[KFM_LOOP]] or [[KFM_PING_PONG]] is set.

Revision as of 10:35, 27 June 2022

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.

Prim Properties
Prim Property Associated LSL Additional Notes
Hidden properties
Context Menu Text (Touch) llSetTouchText Changes the string used for the context (pie) menu Touch action.
Context Menu Text (Sit) llSetSitText Changes the string used for the context (pie) menu Sit action.
Prim Text PRIM_TEXT,llSetText,llSetLinkText Aka "Hovertext".
Texture Animation llSetTextureAnim,llSetLinkTextureAnim Sets the texture to animate according to params specified.
Prim Omega PRIM_OMEGA,llTargetOmega Sets the prim rotating.
Particle System llParticleSystem,llLinkParticleSystem Configures params for a particle emitter.
Sound Radius llSetSoundRadius Establishes a hard cut-off for sounds played by the object.
Sound Queueing llSetSoundQueueing Flags if sounds are added to a playback queue when invoked via LSL, or are played instantly.
Sound Playback (Looped) llLoopSound,llLoopSoundMaster,llLoopSoundSlave Initiates playback of a sound sample, which is played indefinitely. (Until stopped by llStopSound)
Camera Position llSetCameraAtOffset,llSetLinkCamera Sets the location where an avatar's camera will be positioned when sat on the object.
Camera Focus llSetCameraEyeOffset,llSetLinkCamera Sets the location where an avatar's camera will focus on when sat on the object.
Force Mouselook llForceMouselook Will force an avatar's camera into mouselook mode when sitting down on the object.
Sit Target llSitTarget,PRIM_SIT_TARGET Dictates where the avatar sits on the object.
Scripted Sit Only SCRIPTED_SIT_ONLY Experience only: Prevents an avatar manually sitting on the object.
Allow Unsit PRIM_ALLOW_UNSIT Experience only: Prevents an avatar from getting up manually.
Keyframed Motion* llSetKeyframedMotion *Only when KFM_LOOP or KFM_PING_PONG is set.
Prim Center of Mass* llGetCenterOfMass *Calculated when the PHYSICAL flag is set. If the object has never been set as physical, the object's region position is returned instead.
Exposed in Build floater
Temporary PRIM_TEMP_ON_REZ Flags the prim for removal by the region on it's next garbage collection run.
Point Light PRIM_POINT_LIGHT Flags whether the prim is a light emitter, along with some params for the light emitted.
Projector Light PRIM_PROJECTOR Works in tandem with PRIM_POINT_LIGHT.
Unusable properties
Physics Restitution RESTITUTION Dynamic value of how much 'energy' is retained after a collision.

Reset Properties

As prim properties are "remembered" by the prim, even after the script is stopped or removed, it is necessary to manually reset these properties. The below scripts will reset their respective properties when ran inside the prim or linkset.

Note that some properties do not have 'defaults', and are therefore not included. (e.g. Prim Position)

By Prim

Remove Floating Text (llSetText)

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


Remove Particles (llParticleSystem)

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


Remove Texture Animation (llSetTextureAnim)

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


Remove Sit Target (llSitTarget)

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


Remove Forced Mouselook on Sit (llForceMouselook)

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


Reset Context Menu "Sit" Text (llSetSitText)

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


Reset Context Menu "Touch" Text (llSetTouchText)

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

By Linkset

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

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


Remove Particles (llLinkParticleSystem)

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


Remove Texture Animation (llSetLinkTextureAnim)

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


Reset Object Status Flags (llSetStatus)

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