Jump to content

Adding a timer into a texture change script...


Talitha Midal
 Share

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

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

Recommended Posts

Hi. I am trying to add a timer element to a texture change script I have. So that rather than being a touch change, it becomes a change every Xseconds. The script below saved successfully but doesn't work. This section of script* hasn't been added in yet but when I try to place it... the whole script complains and won't save. I have played with different ways but now I am unsure what I am doing wrong. Can anyone help?

* {
      textures_number = llGetListLength(textures);
    }*

 

 

list textures = ["d495d72a-b17f-3042-c326-5e0b143acda1",
"1f2989c3-08df-e376-ee74-7ee625fe30ef",
"c6ce3ff0-e468-7b7c-8275-ff04b49ffef6"];

integer textures_number;
integer current_index;

default
{state_entry()
    {
        llSetTimerEvent(30);
      textures_number = llGetListLength(textures);
    }
    timer()

{
    llSetTexture(llList2String(textures,current_index),0);
      if(++current_index >= textures_number)
        current_index = 0;
    }

}

Link to comment
Share on other sites

The * * around that section of script were to highlight the section that I hadn't been able to add in, as it keeps telling me I have an error. The part beneath that section is the script as I have it currently - saved successfully but not working.

 

list textures = ["d495d72a-b17f-3042-c326-5e0b143acda1",
"1f2989c3-08df-e376-ee74-7ee625fe30ef",
"c6ce3ff0-e468-7b7c-8275-ff04b49ffef6"];

integer textures_number;
integer current_index;

default
{state_entry()
    {
        llSetTimerEvent(30);
      textures_number = llGetListLength(textures);
    }
    timer()

{
    llSetTexture(llList2String(textures,current_index),0);
      if(++current_index >= textures_number)
        current_index = 0;
    }

}

Link to comment
Share on other sites

Oh! I am so so sorry... The prim I had it on was a flat square and I hadn't realised that the surface it was working on was therefore not visible. After your last post, I went Inworld and expanded the cube and found that it is all fine. Thank you so much for highlighting that point and sorry again for having wasted anyone's time... Ooops!

Link to comment
Share on other sites

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...