Texture Changer

Expired

Drop up to 10 different textures into an object and this script. It will change to the next texture automatically. 

It will change textures in the order that they appear in the object's contents, (alphabetical,) so rename them to choose the order.

Currently it will change the texture on all sides. For just one side change "ALL_SIDES" whenver it appears to the side number you want. llSetTexture(name, 1) for example.

 

 

integer number;
string name;
integer choice = 0;

default
{
    state_entry()
    {
        llSetTimerEvent(2.5); //How many seconds inbetween textures
        number = llGetInventoryNumber(INVENTORY_TEXTURE);
    }
    timer()
    {
        if (choice 

 

 

 

Scrolling Texture Smooth

Expired

Will make textures on all sides of prim scroll, like a news ticker or a waterfall.

 

default
{
    state_entry()
    {
        llSetTextureAnim(ANIM_ON | SMOOTH | LOOP, ALL_SIDES,1,1,1.0, 1,0.25);
    }
}

 

Change Texture Menu

Expired

Drop this script and up to 22 textures into a prim. Users select texture by touch menu. Can change on single face or all sides at once.

 

//Drop this script into an object with up to 22 textures inside.

//When anyone Touches they will get a menu with all the textures available. Button names in menu will be first 10 characters from that item's name. 

//NOTE: Texture Names may not exceed 24 characters or script error and menu fails.


integer side = ALL_SIDES; //ALL_SIDES or any face number 0 through 5

list texture_list;
list texture_list2;
key user = NULL_KEY;

composelist()
{
    integer currenttexture = 0;
    integer totaltextures = llGetInventoryNumber(INVENTORY_TEXTURE);
    
    if(totaltextures > 0 & totaltextures <= 12)
    {
        texture_list = [];
        do
        {
            texture_list = texture_list + llGetInventoryName(INVENTORY_TEXTURE, currenttexture);
            currenttexture++;
        }
        while (currenttexture > 0 & currenttexture  12 & totaltextures <= 22)
    {
        texture_list = ["Next Page"];
        do
        {
            texture_list = texture_list + llGetInventoryName(INVENTORY_TEXTURE, currenttexture);
            currenttexture++;
        }
        while (currenttexture > 0 & currenttexture <11);
        
        texture_list2 = ["Last Page"];
        do
        {
            texture_list2 = texture_list2 + llGetInventoryName(INVENTORY_TEXTURE, currenttexture);
            currenttexture++;
        }
        while (currenttexture >= 11 & currenttexture  22)
    {
        llWhisper(0, "You may only have a maximimum of 22 Textures. Please remove any extra ones.");
    }
    if(totaltextures == 0)
    {
        llWhisper(0, "Please add up to 22 Textures inside this object.");
    }
}


//The Menu
integer menu_handler;
integer menu_channel;
menu(key user,string title,list texture_list)
{
    menu_channel = (integer)(llFrand(99999.0) * -1); //random channel
    menu_handler = llListen(menu_channel,"","","");
    llDialog(user,title,texture_list,menu_channel);
    llSetTimerEvent(30.0); //menu channel open for 30 seconds
}

default
{
    state_entry()
    {
        composelist(); //make list from inventory textures
    }

    touch_start(integer total_number)
    {
        user = llDetectedKey(0);
        menu(user,"\n\nPlease select one below.",texture_list);
    }
    
    listen(integer channel,string name,key id,string message)
    {
        if (channel == menu_channel)
        {
            llSetTimerEvent(0.0);
            llListenRemove(menu_handler);
            if(message == "Next Page")
            {
                menu(user,"\n\nPlease select one below.",texture_list2);
            }
            else if(message == "Last Page")
            {
                menu(user,"\n\nPlease select one below.",texture_list);
            }
            else
            {
                llSetTexture(message, side);
            }
        }
    }
    
    timer() //Close the Menu Listen or we'll get laggy
    {
        llSetTimerEvent(0.0); 
        llListenRemove(menu_handler);
    }
    
    changed(integer change) 
    {
        if (change & CHANGED_INVENTORY) //inventory has changed
        {
            llSleep(0.5);
            composelist(); //rebuild the list
        }
    }
}

 

Basic Alpha (transparency) SHOW/HIDE ( V1 )

Expired

/ V1 //
 
string command = "switch"; // Place the command to chat here. The same command will switch on and off.
 
integer channel = 1; // Place channel to use here (must be a positive if an avatar is chatting on it).
 
//////////////////////////////////////////////////////////////////////////////////////////////////////
 
integer on; // Store the state of transparency.
 
Switch()
{
    llSetLinkAlpha(LINK_SET, ((float)on), ALL_SIDES); // This setting will turn a whole link_set transparent or visible.
    on = (!on);
}
 
default
{
    state_entry()
    {
        llListen(channel, "", "", command); // This script is listening to everyone all the time.
//        llListen(channel, "", llGetOwner(), command); // Delete the "//" at the beginning of this line...
                                                        // ...and add "//" at the beginning of the line above...
                                                        // ...to make This script listen to only the owner.
    }   // Switching the listen off at times would be better to reduce lag. But when??
    touch_end(integer nd)
    {
//        if(llDetectedKey(0) == llGetOwner()) // Delete the "//" at the beginning of this line to make touches only respond to owner.
        Switch(); // Call the switching function.
    }
    listen(integer chan, string name, key id, string msg)
    {
        Switch(); // Call the switching function.
    }
}
[edit]