Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

texture rotation doesn't find the files

Azul Wilder
Registered User
Join date: 29 Jan 2007
Posts: 87
02-24-2007 12:47
I want to make a display that changes the pictures every 3 seconds in face 1. I wrote this code but it says that don't find the files

CODE

integer i = 0;

default
{
state_entry()
{
llSetTimerEvent(3);
}

timer()
{
if(i<llGetInventoryNumber(INVENTORY_TEXTURE))
{
i++;
}
else
{
i = 0;
}
llSetTexture(llGetInventoryName(INVENTORY_TEXTURE, i), 0);
}
}



Do you know what is wrong with it?

Thanks.
_____________________
First goes before
AW Devices
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
02-24-2007 13:18
llGetInventoryNumber will return a one based size where as llGetInventoryName is zero based, i.e. You are trying to get the count sized item where it should be count - 1.
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
02-24-2007 13:18
Try this and watch what i does...

CODE
integer i = 0;

default
{
state_entry()
{
llSetTimerEvent(3);
}

timer()
{
if(i < llGetInventoryNumber(INVENTORY_TEXTURE))
{
i++;
}
else
{
i = 0;
}
llOwnerSay((string)i);
//llSetTexture(llGetInventoryName(INVENTORY_TEXTURE, i), 0);
}
}
If you have for example 3 textures, I predict it will go: 1, 2, 3, 0, 1, etc.
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
02-24-2007 13:22
He He He, we meet again Pale!
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
02-24-2007 13:28
...I demand a steward's inquiry! :p
Azul Wilder
Registered User
Join date: 29 Jan 2007
Posts: 87
02-24-2007 13:34
Thanks, I will try it and let you know about it
_____________________
First goes before
AW Devices
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
02-24-2007 14:47
From: Pale Spectre
...I demand a steward's inquiry! :p



I just demand a shrubbery