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

LSL Wiki : llSetLinkTexture

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl809.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
Comments [Hide comments/form]
unless you got this info from a reliable source please remove :P
lindens don't really count unless they say it exactly; but don't add pages if it's heard from a linden, add it to the future feature page.
reliable sources are preview and hacking them out of the client.
-- BlindWanderer (2005-03-24 15:54:04)
It's worth keeping this page. So many people assume the function exists that it is useful to let them know it doesn't.
-- OlmySeraph (2005-03-31 10:22:52)
The original purpose of the page was a stub. I'm surprised it was found to begin with - yay, wiki tools.

I think the current text for it is fine.
-- JeffreyGomez (2005-05-31 19:55:50)
I like this page now, it has examples of how to workaround not having llSetLinkTexture.
-- ChristopherOmega (2005-08-17 14:27:12)
Stop removing the proposed syntax, BW!
-- EepQuirk (2006-03-15 12:16:14)
The above says, "llSetTexture does not exist."

Shouldn't it be, "llSetLinkTexture does not exist"?
-- DrDrebin (2006-08-19 18:11:40)
arghh...

I found myself on an old revision page... Sorry all.

(http:secondlife.com/badgeo/wakka.php?wakka=llSetLinkTexture/show&time=2005-08-18+02%3A01%3A26)
-- DrDrebin (2006-08-19 18:13:44)
</i>
-- KeknehvPsaltery (2006-08-21 17:08:31)
Well as of 1.14.0(0) March 27, 2007 we have this function now. Looks like this page needs an overhaul.
-- ZenMondo (2007-03-27 13:36:23)
Attach a comment to this page: