Skip to content
lsl.devlsl.devLSL Dev

PRIM_LINK_TARGET

constant
Constant
integer PRIM_LINK_TARGET = 34;

Prim parameter [PRIM_LINK_TARGET, integer link_target] used to get or set properties for multiple linked prims within a single primitive parameters call.

Constant groups

PrimParam

Other PrimParam values (42)

Used to get or set multiple links with a single PrimParameters call.

Example 1
5 collapsed lines
default
{
touch_start(integer num_detected)
{
// color the root prim red and the first linked-prim green
llSetLinkPrimitiveParamsFast(LINK_ROOT,
[PRIM_COLOR, ALL_SIDES, <1.0, 0.0, 0.0>, (float)TRUE,
PRIM_LINK_TARGET, 2,
PRIM_COLOR, ALL_SIDES, <0.0, 1.0, 0.0>, (float)TRUE]);
7 collapsed lines
// instead of:
// llSetLinkPrimitiveParamsFast(LINK_ROOT,
// [PRIM_COLOR, ALL_SIDES, <1.0, 0.0, 0.0>, (float)TRUE]);
// llSetLinkPrimitiveParamsFast(2,
// [PRIM_COLOR, ALL_SIDES, <0.0, 1.0, 0.0>, (float)TRUE]);
}
}
Example 2
21 collapsed lines
// assume that you have a global list "gPanels" loaded with the link numbers of prims
// named "panel" and that the global integer parameter "gON" has been defined ....
touch_start(integer num)
{
// basic on/off switch
gON = !gON;
// conditions which will change on touch
// white panel
list WhichWay = [PRIM_COLOR, ALL_SIDES, <1.0, 1.0, 1.0>, (float)TRUE];
if (gON)// red panel
WhichWay = [PRIM_COLOR, ALL_SIDES, <1.0, 0.0, 0.0>, (float)TRUE];
// to accumulate the parameter list that will be affected by SLPPF in this event
list params;
integer numberOfPrims = llGetNumberOfPrims();
// Links in a linkset start numbering with 1
integer index = 1;
do
{
// build the parameters list, in the format PRIM_LINK_TARGET, link number, parameters
params += [PRIM_LINK_TARGET, llList2Integer(gPanels, index)] + WhichWay;
}
while (++index < numberOfPrims);
// apply the parameters to all "panel" prims
llSetLinkPrimitiveParamsFast(LINK_SET, params);
}
Original wiki source

Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.