Skip to content
lsl.devlsl.devLSL Dev

Prims

A prim is the basic building block of an object, whether a parametric shape, a sculpt or mesh. Each prim has properties: position, rotation and size; shape; faces with textures and colors; light, glow and text; physics settings; and its own inventory.

Primitive params read and write almost all of these in one call, as a list of PRIM_* rules followed by their values. Specific functions cover the common cases.

How prims are linked into objects is covered under Linksets; what is drawn on each face under Textures & Materials.

Concepts

Functions and events

voidllSetLinkPrimitiveParamsFast(integer link, list rules)
listllGetLinkPrimitiveParams(integer link, list params)
voidllSetPos(vector pos)
voidllSetRot(rotation rot)
voidllSetScale(vector size)
voidllSetText(string text, vector color, float alpha)
stringllGetInventoryName(integer type, integer index)
integerllGetObjectPermMask(integer group)
eventchanged(integer changes)

Primitive params

A rule list is PRIM_* constants each followed by their values; one call can change many properties on many prims.

Prim inventory

Each prim holds its own inventory; a linked prim’s inventory is separate from its siblings. Scripts list and inspect it, give or remove items, and react to changes.

Scripting Details

voidllSetLinkPrimitiveParamsFast(integer link, list rules)
Sets primitive parameters for the linked prim link according to rules with no built-in script sleep delay.
listllGetLinkPrimitiveParams(integer link, list params)
Returns a list of primitive parameters requested in params for the linked prim specified by link (equivalent to llGetPrimitiveParams).
listllGetPrimitiveParams(list params)
Returns a list of primitive attribute values matching the requested params list.
voidllSetPos(vector pos)
Moves the non-physical object or prim toward the vector pos (up to 10m). If called in a child prim, pos is treated as root-relative; if called from the root prim, the entire object is moved.
voidllSetRot(rotation rot)
Sets the rotation of the prim to rot. If in a child prim, rot is treated as root-relative; if in the root prim of a non-physical object, rotates the entire object.
voidllSetScale(vector size)
Sets the physical scale (dimensions) of the prim containing the script to size.
vectorllGetScale()
Returns a vector representing the physical scale (dimensions in meters) of the prim containing the script.
integerllScaleByFactor(float scaling_factor)
Attempts to uniformly resize the entire object by scaling_factor, maintaining size-position ratios of the prims. Fails if the linkset is physical, a pathfinding character, in keyframed motion, would exceed prim scale/linkability limits, or would overflow parcel capacity.
integerllGetNumberOfSides()
Returns an integer representing the total number of sides (faces) of the prim containing the script.
integerllGetLinkNumberOfSides(integer link)
Returns an integer representing the number of sides (faces) of the linked prim specified by link.
voidllSetText(string text, vector color, float alpha)
Displays floating text above the prim with the specified color vector and transparency alpha.
voidllSetObjectName(string name)
Sets the name of the prim containing the script to name.
stringllGetObjectName()
Returns a string containing the name of the specific prim containing the script.
voidllSetObjectDesc(string description)
Sets the description of the prim containing the script to description (limited to 127 characters).
stringllGetObjectDesc()
Returns a string containing the description of the specific prim containing the script.
voidllSetTouchText(string text)
Displays the string text instead of 'Touch' in the right-click context menu.
voidllSetSitText(string text)
Displays the string text instead of 'Sit' (or 'Sit Here') in the viewer's right-click context menu.
voidllSetClickAction(integer action)
Sets the action (a CLICK_ACTION_* flag) performed when an avatar left-clicks the prim.
voidllSetPayPrice(integer price, list quick_pay_buttons)
Suggests default amounts for the pay text input field price and the four payment dialog quick_pay_buttons when an avatar pays this object.
keyllGetKey()
Returns the key (UUID) of the prim containing the script.
integerllGetInventoryNumber(integer type)
Returns the count of items of the specified type (INVENTORY_*) in the prim's inventory.
stringllGetInventoryName(integer type, integer index)
Returns the name of the inventory item of the specified type (INVENTORY_*) at the specified inventory index.
integerllGetInventoryType(string item)
Returns an integer representing the INVENTORY_* type of the named inventory item.
keyllGetInventoryKey(string item)
Returns the key (UUID) of the specified inventory item.
keyllGetInventoryCreator(string item)
Returns the key (UUID) of the creator of the specified inventory item.
stringllGetInventoryDesc(string item)
Returns the description string of the specified inventory item.
stringllGetInventoryAcquireTime(string item)
Returns the time when the item was placed in the prim's inventory, as a UTC timestamp string of the form "YYYY-MM-DDThh:mm:ssZ"
keyllRequestInventoryData(string item)
Asynchronously requests data for the named inventory item, triggering a dataserver event. Currently, only landmark items are supported (which return local region coordinates). Returns a key query handle.
voidllRemoveInventory(string item)
Permanently deletes the named inventory item from the prim's inventory.
voidllAllowInventoryDrop(integer add)
If add is TRUE, allows users without object modify permissions to drop inventory items into the prim. If FALSE, restricts inventory dropping to users with modify permissions.
voidllRemoteLoadScriptPin(key target, string script, integer pin, integer running, integer start_param)
Copies the script into target, setting it running (if running is TRUE) with the start_param, provided the script owner has modify permissions on target and target's PIN matches pin (set via llSetRemoteScriptAccessPin).
voidllSetRemoteScriptAccessPin(integer pin)
Sets the prim's remote script access PIN to pin (a non-zero value enables loading via llRemoteLoadScriptPin, while zero disables it).
integerllGetObjectPermMask(integer group)
Returns the script's object's permission flags for the specified group.
voidllSetObjectPermMask(integer group, integer flags)
Sets the scripts's object's permission flags for the specified group.
integerllGetInventoryPermMask(string item, integer group)
Returns the specified item's permission flags for the specified group.
voidllSetInventoryPermMask(string item, integer group, integer flags)
Sets the specified item's permission flags for the specified group.
integerllTransferOwnership(key agent, integer flags, list options)
Transfers ownership of the object (or a copy of it, depending on Flags) to the specified agent. Returns an integer indicating the success or failure of the transfer.
keyllGetCreator()
Returns the key (UUID) of the prim's original creator.
keyllGetOwner()
Returns the key (UUID) of the object's current owner.

Additional

Constant groups PrimParam 43PrimParamGet 41PrimType 8PrimTypeHole 4PrimTypeSculptType 6PrimTypeSculptFlag 3Faces 1InventoryType 14AssetPermission 5AssetPermissionCategory 5AssetPermissionCategoryFlag 1TransferOwnershipFlag 3

See also SL Wiki LSL PrimitiveParamsSL Wiki Script library: primsFeature InventoryFeature MovementFeature LinksetsFeature Textures & MaterialsFeature EffectsCategory Prim PropertiesCategory Prim InventorySL Wiki LSL InventoryCategory Asset PermissionsCategory Prim TargetSL Wiki LSL PrimPlanned Guide: primitive params rule lists