Jump to content

How to make a texture changer loop?


Naiman Broome
 Share

You are about to reply to a thread that has been inactive for 1101 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

3 hours ago, Naiman Broome said:

Hello I know how to make a texture selector on menu but how can be done a texture changer randomly on a loop with a set of textures ?

Especially only on one face of a mesh?

Imagine a tv screen or the like .

what you want is a texture slide viewer

to get you started try this one from Sendao and Rolig.

 

  • Like 1
Link to comment
Share on other sites

I guess I'll also suggest the obvious solution, which all the people in the know will complain about being blurry and such because it doesn't preload the textures:

// change 10.0 to the texture change interval (in seconds) and 0 to the face number 
default
{
    state_entry()
    {   llSetTimerEvent(10.0);
    }
    timer()
    {
        llSetTexture(0,llGetInventoryName(INVENTORY_TEXTURE, llFloor(llFrand(llGetInventoryNumber(INVENTORY_TEXTURE)))));
    }
}

or to do things in order (and mix in-script and in-object textures)

//list of texture UUIDs. Textures in the same prim will be included automatically.
list gTextures = 
[  //remove or replace the next few lines
   "5748decc-f629-461c-9a36-a35a221fe21f", // TEXTUTE_BLANK
   "38b86f85-2575-52a9-a531-23108d8da837" //(invisiprim) // no final comma. 
];
integer gNtextures; // = llGetListLength(gTextures);
integer gIndex=-1;
default
{
  state_entry()
  {  gNTextures=llGetListLength(gTextures);
     llSetTimerEvent(10.0);
  }
  timer()
  {  integer invN = llGetInventoryNumber(INVENTORY_TEXTURE);
     ++gIndex;
     if(gTextureIndex<gNtextures)
     {  llSetTexture(ALL_SIDES,llList2String(gTextures,gIndex));
     }else if(gTexture<gNtextures+invN)
     {	llSetTexture(ALL_SIDES,llGetInventoryName(INVENTORY_TEXTURE,gIndex-invN);
     }else
     {  llSetTexture(ALL_SIDES,llList2String(gTextures,gIndex=0));
     }
  }
}

 

  • Like 1
Link to comment
Share on other sites

6 hours ago, Naiman Broome said:

That is requiring me to make two more prims, my item is a simple phone screen with 1 prim and two faces.

No, you only need those two extra prims if you want buttons to advance the slides manually.  If you always want them to advance automatically, you don't need the extra prims.  All you need is something with two faces -- one to display on and the other to preload the next slide on.

  • Like 2
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1101 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...