Shortnote

The following script is a simple player for books that need to loop textures. To use the script, drop textures in a primitive and then place the script in the same primitive. By touching the screen, the textures are cycled and displayed in order.

Code

This script was tested and works on OpenSim version 0.7.4!

simple_forward_cycler.lsl
///////////////////////////////////////////////////////////////////////////
//  Copyright (C) Wizardry and Steamworks 2013 - License: GNU GPLv3      //
//  Please see: http://www.gnu.org/licenses/gpl.html for legal details,  //
//  rights of fair usage, the disclaimer and warranty conditions.        //
///////////////////////////////////////////////////////////////////////////
 
list pList = [];
 
default
{
    state_entry()
    {
        integer i = llGetInventoryNumber(INVENTORY_TEXTURE)-1;
        do {
            pList += llGetInventoryName(INVENTORY_TEXTURE, i);
        } while(--i>-1);
    }
    on_rez(integer num) {
        llResetScript();
    }
    touch_start(integer num) {
        if(llGetListLength(pList) == 0) return;
        string tex = llList2String(pList, 0);
        pList = llDeleteSubList(pList, 0, 0);
        // change to correct face.
        llSetTexture(tex, 0);
        pList += tex;
    }
    changed(integer change) {
        if(change & CHANGED_INVENTORY) llResetScript();
    }
}

secondlife/texture_book/simple_forward_cycler.txt ยท Last modified: 2022/11/24 07:46 by 127.0.0.1

Access website using Tor Access website using i2p Wizardry and Steamworks PGP Key


For the contact, copyright, license, warranty and privacy terms for the usage of this website please see the contact, license, privacy, copyright.