Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llSetTexture and lists

Deimos Damone
DMI Principal Partner
Join date: 6 Mar 2006
Posts: 27
04-25-2006 23:30
Apologies ahead of time as I'm sure this has been discussed somewhere, but wasn't able to find this specific question. I'm trying to set the texture on a prim where the textures UUIDs are stored in a list and activated by a touch. My problem is that I'm getting texture not found errors.

CODE
 
// Texture list
list texture_name = ["79f527b7-37b5-8012-aec9-eccaff4c5bd9",
"d44beb14-2d89-1302-9d2c-ade0d2bfef79",
"9910c613-a6c7-a14a-af63-96f24b30c258",
"ce771567-76d0-a903-b978-0dacc5019856",
"f72dc308-fd8e-5a28-06db-cf53a4b2f77b",
"c7a9c9a4-afa8-127e-f9f2-0ef4b8d5c417",
"4bfa117e-f0cd-000a-b1f1-47dfd81fbd88",
"01b5fae0-8925-7528-77fe-f9830ed4e76d",
"c2abc13a-f4ab-0496-738b-b7d1b7f05d3f",
"fa1d0a6c-3048-ae88-18c6-37081eaff46a"];

integer list_total; // Total number of textures
integer list_pos; // Current Position

user_func() // Workhorse user function
{
llSetTexture((llList2String(texture_name, list_total)), 0);
llSay(0, llList2String(texture_name, list_pos));
}
default
{
state_entry()
{
list_total = llGetListLength(texture_name);
}
touch_start(integer total_number)
{
user_func();
++list_pos;

if (list_pos >= list_total) list_pos = 0;
}
}


The llSay in the user function returns the proper UUID. The only thing I can think of is that the UUID isn't surrounded by quotes when it's passed to the llSetTexture function. Anyone have any ideas on how to do this?
Jigsaw Partridge
A man of parts
Join date: 3 Apr 2005
Posts: 69
04-25-2006 23:46
You have list_total as the index of the list item to convert to a string in the call to llSetTexture() ;)
Deimos Damone
DMI Principal Partner
Join date: 6 Mar 2006
Posts: 27
04-25-2006 23:53
DOH :o