PRIM LINK TARGET
Looking for the current API? Open the PRIM_LINK_TARGET reference →
Wiki description
Used to get or set multiple links with a single PrimParameters call.
Examples
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]);
// 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]);
}
}// 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);
}See also: functions
Shared wiki helpers
The original page also injects shared parameter notes, caveats or issue information through these helpers. Their conditional MediaWiki logic is not reproduced here; inspect the preserved helper source for additional material.
Template:LSL PrimitiveParam Categorize
Original shared helper source (conditional wiki logic is not evaluated)
{{#if:{{#pos:{{#var:moded}}|r}}{{#pos:{{#var:moded}}|u}}||{{#vardefine:hidden-text|{{#var:hidden-text}}
{{#ifexist:Template:LSLC{{#var:lang}}|
{{LSLC{{#var:lang}}|PrimitiveParams}}
{{LSLC{{#var:lang}}|PrimitiveParams/{{{1}}}}}
{{LSLC{{#var:lang}}|{{{1}}}}}
|
{{LSLC|PrimitiveParams{{#var:lang}}}}
{{LSLC|PrimitiveParams/{{{1}}}{{#var:lang}}}}
{{LSLC|{{{1}}}{{#var:lang}}}}
}}
}}}}Caveats
- If PRIM_LINK_TARGET's
link_targetdescribes a seated avatar...- Flags not explicitly mentioned have obvious values.
- PRIM_NAME will return the avatar's legacy name.
- PRIM_DESC will return
."" - PRIM_TYPE will return
[PRIM_TYPE_BOX, PRIM_HOLE_DEFAULT, <0., 1., 0.>, 0., ZERO_VECTOR, <1., 1., 0.>, ZERO_VECTOR] - PRIM_SLICE will return
[<0., 1., 0.>] - PRIM_MATERIAL will return
PRIM_MATERIAL_FLESH. - PRIM_TEMP_ON_REZ will return
FALSE. - PRIM_PHANTOM will return
FALSE. - PRIM_SIZE will return
llGetAgentSize(llGetLinkKey(.link)) - PRIM_TEXT will return
["", ZERO_VECTOR, 1.]. - PRIM_POINT_LIGHT will return
[FALSE, ZERO_VECTOR, 0., 0., 0.]. - PRIM_FLEXIBLE will return
[FALSE, 0, 0., 0., 0., 0., ZERO_VECTOR]. - PRIM_COLOR, PRIM_TEXTURE, PRIM_GLOW, PRIM_FULLBRIGHT, PRIM_BUMP_SHINY, PRIM_TEXGEN
- will return
[]and report a script error to the owner: "texture info cannot be accessed for avatars."
- will return
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.