Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

switching textures of individual prims in a linked set.

Rocky Rutabaga
isn't wearing underwearâ„¢
Join date: 14 Apr 2006
Posts: 291
06-29-2008 13:41
I'm using the freebie texture switcher in some walls of my house. I don't want to be able to change every wall's texture, so I only have the script in a few walls. However, I've found this weirdness:

I have 4 linked prims. A and C have no texture script. B and D have three textures and switcher scripts in their contents. If I touch B or D, they change textures without a problem and only change themselve, no others in the linked set. However, if I touch C, which has no script, it will change D's textures. I've relinked many ways with different parents and children, but I always have the problem.

I did discover that putting the switcher script in all the prims, but only textures in prims I want to change fixes the problem.

Now I have a house with 98 prims, and I don't want to install the switcher in each prim individually. Is there a way to do it in bulk? Is this a good solution to my problem?
_____________________
Django Yifu
Beat Island Gaffer
Join date: 7 May 2007
Posts: 189
06-29-2008 13:46
Try http://www.lslwiki.net/lslwiki/wakka.php?wakka=llPassTouches
_____________________
Tread softly upon the Earth for you walk on my face.
Rocky Rutabaga
isn't wearing underwearâ„¢
Join date: 14 Apr 2006
Posts: 291
06-29-2008 13:50
Thanks. So I do have to put a script into every child prim... Eesh.
_____________________
Beverly Ultsch
Registered User
Join date: 6 Sep 2007
Posts: 229
06-29-2008 14:01
From: Rocky Rutabaga
Thanks. So I do have to put a script into every child prim... Eesh.


No, just make sure there are no scripts in the root prim.

Edit: To expand on that, if there is a script in the root prim then yes, you have to put a script in all the child prims to prevent the touch been passed. But if the root prim has no script in it then there is nothing to pass the touch to, so scripts are not required in all child prims.
Squirrel Wood
Nuteater. Beware!
Join date: 14 Jun 2006
Posts: 471
06-30-2008 01:34
Solution:

One script in the root prim.
Give all the prims you want to change the texture on the same name.

On touch (of any prim in the linkset) loop through all prims in the linkset (llgetNumberofPrims()) look at the name of each prim in the linkset and if the prims name matches your criteria, use llSetLinkTexture() to change the texture(s) on the desired faces of the prim.

Benefits:
Requires just *one* script in the objects root prim.
You can expand this to change different prims based on parts of the prims names.
Rocky Rutabaga
isn't wearing underwearâ„¢
Join date: 14 Apr 2006
Posts: 291
06-30-2008 09:15
thank you all!
_____________________