Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Default texture using llSetTexture

MadamG Zagato
means business
Join date: 17 Sep 2005
Posts: 1,402
03-14-2006 08:13
Is there a way to tell this child prim via link message that if the specified texture is not in the objects inventory then to display another texture (i.e. DefaultTexture.jpg)?

Right now, if the texture is not in there, then it just gives the error:
Bottom Bar: Couldn't find texture yourTexture

CODE

default {
link_message(integer sender, integer side, string textureKey, key methodName) {
if (methodName == "setTexture") {
llSetTexture(textureKey, side); //if it's not there, then show something else!
}
}
}
_____________________
Leonard Churchill
Just a Horse
Join date: 19 Oct 2005
Posts: 59
03-14-2006 08:22
http://secondlife.com/badgeo/wakka.php?wakka=llGetInventoryType

Use this LSL command to add in a detection step before calling llSetTexture.
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
03-14-2006 08:25
You can use llGetInventoryType to check whether the texture exists first using the name....

e.g.
CODE

if (llGetInventoryType(textureName) == -1) textureName = "Default Texture";
llSetTexture(textureName, side);

but if you're referring to textures by UUID, why do you care whether they're in the inventory or not? Or is textureKey actually the texture name?
MadamG Zagato
means business
Join date: 17 Sep 2005
Posts: 1,402
03-14-2006 10:26
Yep, it's the texture name :)
I'm logging in to try out your solution. I'll post back in a few. Thanks!!!
_____________________
MadamG Zagato
means business
Join date: 17 Sep 2005
Posts: 1,402
03-14-2006 10:47
Works beautifully hun! Thanks!!