views:

7

answers:

2

I need some help. I am working a script that will listen to a channel, take the message and use it as a texture command (this part i have), than change only the child prims that have the right name (this part i can not figure out). I know it is possible to do, but for the life of me i can not figure out how to filter by name than send the texture to the right child prim. Any help or ideas would be wonderful, Thank you. ps, if a list is needed, i will need help with that too, i cant seem to wrap my brain around them.

A: 

You can use llGetNumberOfPrims to find out how many prims there are in the object (if you don't know that already) and then use llGetLinkName on each of them in for loop to check the child prim name.

Domchi
A: 
set_textures(string name, string texture, integer side) {
    integer i;
    if(llGetLinkNumber() != 0)
        for(i = 0; i < llGetNumberOfPrims(); ++i)
            if(llGetLinkName(i+1) == name)
                llSetLinkTexture(i+1, texture, side);
}
Mimika Oh