Ela Talaj wrote:
In situations like this using a strided list is more efficient. It would look like something like this
list sides = [0, "", 1, "89556747-24cb-43ed-920b-47caed15465f", 2, "89556747-24cb-43ed-920b-47caed15465f", 3, "",...]
The idea is you list both side and texture to assign to it in the same list next to each other and for those sides that do not have textures just put an empty string "".
Then your code would look like this:
integer length = llGetListLength(sides);
integer i;
for (i =1; i < length; i+=2)
{
if(llList2String(sides,i) ! = "")
llSetTexture(llList2String(sides,i),llList2Integer(sides, i-1));
}
Please also note that defining a loop index variable as "x" is a bad programming style. Commonly, letters, i, j,k are used.
Im pretty new to programming and only been trying to do things since a few weeks, thanks for the advice on the loop, and well i made the hud with a lot of reading and seeing examples and a some help as well of people, and yes i thought of strided list when i read about them, but since the users are selecting which face will change and that list of sides will be send to the receiver and parsed there to a new list i thought it was better this way, also because of the many color lists, im sure there would be better ways to do it, but i dont know how lol, it seems to be working fine
And Thanks for the example, i'm sure i will be using it for something at some point