Don't click here unless you want to be banned.

LSL Wiki : llSetLinkTexture

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl423.us.archive.org
llSetLinkTexture(integer link_pos, string texture, integer face)

Sets the texture of linked prims. The ruleset is the same as used in llSetTexture.
When using a named texture, the texture in the calling prim's inventory is used.

Also see:
llSetLinkAlpha
llSetLinkColor
llSetLinkPrimitiveParams


Q: How do I simultaneously set the texture of prims 1 and 2, but not 3 and 4? llSetLinkTexture doesn't seem to be able to do that.
A: It's true; you can only specify the specific link number of a target prim, or set the texture of all prims in the linkset, all child prims, or all other prims. There's no way to either specify a range of link numbers, or to specify several link numbers.
A workaround for this is to place scripts in every prim in your object and to use link messages to communicate:
// Call this function instead of llSetLinkTexture in your main script.
setLinkTexture(integer linkNum, string tex_name_or_key, integer face) {
    llMessageLinked(linkNum, face, "setLinkTexture", tex_name_or_key);
}

// Put this script in every prim of the link set
default {
    link_message(integer sender, integer side, string msgname, key tex_name_or_key) {
        if (msgname == "setLinkTexture") {
            llSetTexture(tex_name_or_key, side);
        }
    }
}

A: But with this solution you still can't use several link numbers, only by iteration. And if we go there, we might as well call llSetLinkTexture more then once, for example with a loop, and avoid putting scripts in linked prims.
Or you can fill a list and iterate through it. In that case this code would go in your main script:
// Call this function instead of llSetLinkTexture in your main script.
setLinkTexture(list linkNums, string texture, integer face) {
    integer i;
    for (i = 0; i<llGetListLength(linkNums); i++)
        llSetLinkTexture(llList2Integer(linkNums, i), texture, face);
}
Then you would call the function like this:
list linkNums = [1, 3, 4];
setLinkTexture(linkNums, texture, face);


This article wasn't helpful for you? Maybe the related article at the LSL Portal is able to bring enlightenment.

Functions | Link | Texture
There are 9 comments on this page. [Display comments/form]