Slideshow

Expired

integer counter;
 
default
{
    state_entry()
    {
        llAllowInventoryDrop(TRUE);
    }
 
    touch_start(integer total_number)
    {
        llSetTexture(llGetInventoryName(INVENTORY_TEXTURE, counter),1);
        counter += 1;
        if (counter >= llGetInventoryNumber(INVENTORY_TEXTURE))
        {
            counter = 0;
        }
    }
}

 

llSetTextureAnim

Expired

default
{
    state_entry()
    {
        llSetText("llSetTextureAnim()\nThis is a texture animation",<1 ,1,1>,1);
        llSetTextureAnim(ANIM_ON|LOOP, ALL_SIDES,7,4,1, 28,10);
    }
}

 

Slide Show

Expired

// Bromley College 
// Linden Script Exhibition
 
// Code for Step 30 Poster
 
integer counter = 0;
 
default
{
  state_entry()
  {
        llSetText("Touch for next slide", <0,1,0>, 3);
        //Set floating text
 
        llAllowInventoryDrop(FALSE); 
        //stop users from dropping their own textures onto the object
   }
 
        touch_start(integer total_number)          //when user touches object
        {
        llSay ( 0, "Texture identifier is:  " + (string)counter);
        //Output the contents of the counter on ch0
 
        string texture = llGetInventoryName(INVENTORY_TEXTURE, counter);
        //Get name of indexed texture
 
        llSay ( 0, "Texture name is: " + (string)texture);
        //Output the name of the texture on ch0
 
        llSetTexture(texture,3);
      // Display the texture on the front (side 3) of the object
 
      counter = counter + 1;
      // Point to the next texture in the object's inventory
 
      if (counter >= llGetInventoryNumber(INVENTORY_TEXTURE)) 
      // If all textures have been displayed
      {
          counter = 0; 
          // reset counter index and restart loop
      }
  }
}
 
// End of code;

 

Animated Shark Head

Expired

default
{
 state_entry()
 {
 llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_SCULPT, "f2151490-db9c-bb10-2048-c423b43aa5d1", PRIM_SCULPT_TYPE_SPHERE]);
 }
 on_rez(integer start_param)
 {
 state default;
 }
 link_message(integer from, integer num, string action, key id)
 {
 if(action == "talk")
 {
 state Toggled;
 }
 }
}
 
state Toggled
{
 state_entry()
 {
 llSetTimerEvent(0.1);
 }
 on_rez(integer start_param)
 {
 state default;
 }
 link_message(integer from, integer num, string action, key id)
 {
 if(action == "stop")
 {
 llSetTimerEvent(0);
 state default;
 }
 }
 timer()
 {
 llMessageLinked(LINK_SET, 0, "anim", NULL_KEY);
 llSetTimerEvent(0.9);
 }
 
}