Skip to content
lsl.devlsl.devLSL Dev

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

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.