Skip to content
lsl.devlsl.devLSL Dev

Linksets

An object is a linkset: one root prim plus any child prims, moving and rezzing as a unit. Each prim has a link number. The root is 1 when there are several prims, and 0 in a single-prim object. Seated avatars are added after the prims.

Most prim functions have a Link variant that works on any prim by link number, so one script can control the whole object. What a single prim looks like is covered by Prims.

Concepts

Functions and events

integerllGetLinkNumber()
integerllGetNumberOfPrims()
stringllGetLinkName(integer link)
keyllGetLinkKey(integer link)
voidllCreateLink(key target, integer parent)
voidllBreakLink(integer link)
voidllSetLinkPrimitiveParamsFast(integer link, list rules)
listllGetLinkPrimitiveParams(integer link, list params)
voidllMessageLinked(integer link, integer num, string str, key id)
keyllRezObjectWithParams(string item, list options)
eventon_rez(integer start_param)
eventchanged(integer changes)

Rezzing

Rez objects from inventory, pass them a start parameter or string, and derez them later.

Scripting Details

integerllGetLinkNumber()
Returns the integer link number of the prim containing the script (0 for unlinked, 1 for the root, and 2+ for children).
integerllGetNumberOfPrims()
Returns an integer representing the total number of prims and seated avatars in the linkset containing the script.
integerllGetObjectPrimCount(key prim)
Returns an integer representing the total number of prims in the object containing the specified prim.
stringllGetLinkName(integer link)
Returns a string containing the name of the linked prim specified by link.
keyllGetLinkKey(integer link)
Returns the key (UUID) of the linked prim or avatar specified by link.
integerllGetLinkNumberOfSides(integer link)
Returns an integer representing the number of sides (faces) of the linked prim specified by link.
integerLINK_ROOT = 1
Refers to the root prim of the linkset.
integerLINK_SET = -1
Refers to every prim in the linkset.
integerLINK_THIS = -4
Refers specifically to the single prim containing the running script.
integerLINK_ALL_OTHERS = -2
Refers to every other prim in the linkset, excluding the prim containing the script.
integerLINK_ALL_CHILDREN = -3
Refers to all child prims in the linkset (every prim except the root).
voidllCreateLink(key target, integer parent)
Attempts to link the object containing the script with target. Requires the PERMISSION_CHANGE_LINKS runtime permission.
voidllBreakLink(integer link)
Delinks the prim specified by the link number link. Requires the PERMISSION_CHANGE_LINKS runtime permission.
voidllBreakAllLinks()
Delinks all prims in the linkset. Requires the PERMISSION_CHANGE_LINKS runtime permission, which must be requested and granted by the owner.
eventchanged(integer changes)
Triggered when various properties of the object change. The parameter changes is a bitfield of CHANGED_* flags.
integerCHANGED_LINK = 0x20
Number of prims making up the object or avatars seated on it has changed. Also occurs when duplicating a linked object or when a prim changes type or shape. Does not trigger on attach/detach, sit/unsit in attachments, or single prim duplication.
integerPERMISSION_CHANGE_LINKS = 0x00080
Runtime permission that allows the script to successfully create, break, or modify links to other objects using llCreateLink, llBreakLink, or llBreakAllLinks.
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).
voidllSetLinkColor(integer link, vector color, integer face)
Sets the Blinn-Phong diffuse RGB color of face on the linked prim link.
voidllSetLinkAlpha(integer link, float alpha, integer face)
Sets the Blinn-Phong alpha (transparency) of face on the linked prim link.
voidllSetLinkTexture(integer link, string texture, integer face)
Applies texture (UUID or inventory name) to face of the linked prim link.
voidllMessageLinked(integer link, integer num, string str, key id)
Triggers a link_message event, sending num, str, and id to the scripts in the prim(s) specified by link to allow scripts within the same object to communicate.
vectorllGetRootPosition()
Returns a vector representing the position (in region coordinates) of the root prim of the linkset containing the script.
rotationllGetRootRotation()
Returns a rotation representing the orientation (relative to the region) of the root prim of the linkset containing the script.
listllGetBoundingBox(key object)
Returns the bounding box of object (including any linked prims) relative to its root prim in local coordinates, formatted as [ (vector) min_corner, (vector) max_corner ].
vectorllGetGeometricCenter()
Returns a vector representing the geometric center of the object relative to its root prim.
vectorllGetCenterOfMass()
Returns the vector position (in region coordinates) of the center of mass. Returns the individual child prim's center of mass if called from a child, or the entire linkset's center of mass if called from the root.
floatllGetObjectMass(key id)
Returns a float representing the mass of the avatar or object specified by id.
listllGetObjectDetails(key id, list params)
Returns a list containing the requested parameters of the specified avatar or object id, retrieved in the order requested by params.
keyllGetOwnerKey(key id)
Returns the key (UUID) of the owner of the prim specified by id.
keyllGetCreator()
Returns the key (UUID) of the prim's original creator.
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.
floatllGetMaxScaleFactor()
Returns a float representing the maximum scale factor that can be applied to the object via llScaleByFactor without violating size or linkability limits.
floatllGetMinScaleFactor()
Returns a float representing the minimum scale factor that can be applied to the object via llScaleByFactor without violating size limits.
keyllRezObjectWithParams(string item, list options)
Instantiates the named inventory object (defaulting to the rezzing prim's position unless REZ_POS is specified) using the initial set of parameters specified in options. Returns the key of the rezzed object, or a blank key on failure.
voidllRezObject(string item, vector pos, vector vel, rotation rot, integer start_param)
Instantiates the named inventory object with the bounding box centered at pos with velocity vel and rotation rot, passing param as the on_rez start parameter. The vel parameter is ignored if the rezzed object is non-physical.
voidllRezAtRoot(string item, vector pos, vector vel, rotation rot, integer start_param)
Instantiates the named inventory object with the root prim at pos with velocity vel and rotation rot, passing start_param as the on_rez start parameter. The vel parameter is ignored if the rezzed object is non-physical.
eventobject_rez(key id)
Triggered when this object successfully rezzes another object from its inventory. Passes the key (UUID) id of the newly rezzed object.
eventon_rez(integer start_param)
Triggered when the object is rezzed into the world (by a script or user). Passes start_param from the rezzing call (or 0 if rezzed from inventory). Also triggers on attachments during login or when attached from inventory.
integerllGetStartParameter()
Returns an integer representing the start/rez parameter passed to the object on creation (returns 0 if rezzed by an agent).
stringllGetStartString()
Returns the initialization string passed to the object's root prim on rez with llRezObjectWithParams (via REZ_PARAM_STRING; returns an empty string if rezzed by an agent).
voidllDie()
Deletes the entire object containing the script (the object does not go to inventory). Use llBreakLink first to delete only a single prim.
integerllDerezObject(key id, integer flags)
Derezzes (deletes or returns) a targeted object in the region previously rezzed by a script in this linkset, returning TRUE on success or FALSE on failure.
voidllGodLikeRezObject(key id, vector pos)
Rezzes an object directly from a UUID specified by id at the position pos, provided the owner has the god-bit set.

Additional

Constant groups Link 2Links 5

See also Page Guide: working with link numbersPage Guide: linkset resources (reusable prims)

Constant groups ObjectDetailsParam 56

See also Category Object Target

Constant groups RezParam 13RezFlag 8DerezMode 3

See also Category RezSL Wiki LSL RezSL Wiki Script library: rezzers

See also Category Linkset TargetFeature PrimsFeature Inventory