Myriad Lite Region Settings Editor

// Myriad_Lite_Region_Settings_Editor-P7a1-v0.0.0-20130928.lsl
// Copyright (c) 2012-2013 by Allen Kerensky (OSG/SL) All Rights Reserved.
// This work is dual-licensed under
// Creative Commons Attribution (CC BY) 3.0 Unported
// http://creativecommons.org/licenses/by/3.0/
// - or -
// Modified BSD License (3-clause)
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// * Redistributions of source code must retain the above copyright notice, 
//   this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
//   this list of conditions and the following disclaimer in the documentation
//   and/or other materials provided with the distribution.
// * Neither the name of Myriad Lite nor the names of its contributors may be
//   used to endorse or promote products derived from this software without
//   specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
// NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// The Myriad RPG System was designed, written, and illustrated by Ashok Desai
// Myriad RPG System licensed under:
// Creative Commons Attribution (CC BY) 2.0 UK: England and Wales
// http://creativecommons.org/licenses/by/2.0/uk/
 
// FIXME
// Fix button and view prim names to align to functions called
// HELP BUTTON to give user manual
// WIZARD BUTTON to give guided tour
 
// VERSION CONTROL
string VERSION = "0.0.0"; // Allen Kerensky's script version
string VERSIONDATE = "20130928"; // Allen Kerensky's script yyyymmdd
 
integer RENDEZVOUS2; // the dynamic rendezvous channel the server will be listening on
integer CHANNEL; // our dynamic channel where the server can talk back to us
integer HANDLE; // listener control handle
 
string BUTTON;
 
list PRIMS = [];
 
string ASPECT; // singular aspect for record functions
list RECORDLIST;
integer CURRENTRECORD;
 
// Field names for records
string NAME;
string GENERATOR;
string UPDATER;
string STATMIN;
string SKILLMIN;
string STATMAX;
string SKILLMAX;
string SUMMARY;
string DESCRIPTION;
string GENRES;
string TYPE;
string ACTIVATION;
string ACTIONLIST;
string BASESTAT;
string ACTION;
string GPPERLEVEL;
string BOONMAX;
string FLAWMAX;
string STATPOOL;
string SKILLPOOL;
string PERSKILLS;
string SFXPOOL;
string HEALTHPOOL;
string GPPOOL;
string RESOURCES;
string GPCOST;
string STATLIST;
string BOONLIST;
string FLAWLIST;
string SKILLLIST;
string SFXLIST;
string ITEMLIST;
string RANGE;
string DAMAGE;
string RPCOST;
string PERIOD;
string BONUS;
string RATING;
 
integer FLAG_DEBUG;
 
// SWITCH USER INTERFACE BUTTONS FOR EACH ASPECT TO EDIT
// INPUT: 12 item list of texture names ["button1","button2",...,"button12"]
// NOTE: a texture name of "" will remain blank
SWITCHBUTTONS(list textures) {
    integer i = 0;
    for ( i = 0; i < 11; i++) {
        llSetLinkPrimitiveParamsFast(llListFindList(PRIMS,["BUTTON"+(string)(i+1)]),[PRIM_TEXTURE,2,"Blank",<1,1,1>,<0,0,0>,0.0]);
        llSetLinkPrimitiveParamsFast(llListFindList(PRIMS,["TEXT"+(string)(i+1)]),[PRIM_TEXT,"",<1,1,1>,1]);
        llSetLinkPrimitiveParamsFast(llListFindList(PRIMS,["BUTTON"+(string)(i+1)]),[PRIM_TEXTURE,2,llList2String(textures,i),<1,1,1>,<0,0,0>,0.0]);
    }
}
 
// break down the attribute names and values for each incoming aspect record
TOKENPARSE(string msg) {
    // MSG FORMAT: COMMAND[|ATTRIBUTE=VALUE[|ATTRIBUTE=VALUE[|...]]]
    list tokens = llParseString2List(msg,["|"],[]);
    integer tokencount = llGetListLength(tokens);                
 
    // process each attrib=value pair
    integer j;
    for ( j = 0; j <= tokencount; j++) {
        string currenttoken = llList2String(tokens,j);
        list attribvalpair = llParseString2List(currenttoken,["="],[]);
        string attrib = llToLower(llList2String(attribvalpair,0));
        string sdata = llList2String(attribvalpair,1);
        if ( attrib == "name" ) NAME = sdata;
        if ( attrib == "generator" ) GENERATOR = sdata;
        if ( attrib == "updater" ) UPDATER = sdata;
        if ( attrib == "statmin" ) STATMIN = sdata;
        if ( attrib == "statmax" ) STATMAX = sdata;
        if ( attrib == "summary" ) SUMMARY = sdata;
        if ( attrib == "description" ) DESCRIPTION = sdata;
        if ( attrib == "skillmin" ) SKILLMIN = sdata;
        if ( attrib == "skillmax" ) SKILLMAX = sdata;
        if ( attrib == "genres" ) GENRES = sdata;
        if ( attrib == "type" ) TYPE = sdata;
        if ( attrib == "activation" ) ACTIVATION = sdata;
        if ( attrib == "actionlist" ) ACTIONLIST = sdata;
        if ( attrib == "basestat" ) BASESTAT = sdata;
        if ( attrib == "action" ) ACTION = sdata;
        if ( attrib == "gpperlevel" ) GPPERLEVEL = sdata;
        if ( attrib == "boonmax" ) BOONMAX = sdata;
        if ( attrib == "flawmax" ) FLAWMAX = sdata;
        if ( attrib == "statpool" ) STATPOOL = sdata;
        if ( attrib == "skillpool" ) SKILLPOOL = sdata;
        if ( attrib == "perskills" ) PERSKILLS = sdata;
        if ( attrib == "sfxpool" ) SFXPOOL = sdata;
        if ( attrib == "healthpool" ) HEALTHPOOL = sdata;
        if ( attrib == "gppool" ) GPPOOL = sdata;
        if ( attrib == "resources" ) RESOURCES = sdata;
        if ( attrib == "gpcost" ) GPCOST = sdata;
        if ( attrib == "statlist" ) STATLIST = sdata;
        if ( attrib == "boonlist" ) BOONLIST = sdata;
        if ( attrib == "flawlist" ) FLAWLIST = sdata;
        if ( attrib == "skilllist" ) SKILLLIST = sdata;
        if ( attrib == "sfxlist" ) SFXLIST = sdata;
        if ( attrib == "itemlist" ) ITEMLIST = sdata;
        if ( attrib == "range" ) RANGE = sdata;
        if ( attrib == "damage" ) DAMAGE = sdata;
        if ( attrib == "rpcost" ) RPCOST = sdata;
        if ( attrib == "period" ) PERIOD = sdata;
        if ( attrib == "bonus" ) BONUS = sdata;                
        if ( attrib == "rating" ) RATING = sdata;
    }
    if ( ASPECT == "STATISTIC" )  UPDATEVIEW([NAME,GENERATOR,UPDATER,STATMIN,STATMAX,SUMMARY,DESCRIPTION,"","","",""]);
    if ( ASPECT == "SKILL" )      UPDATEVIEW([NAME,GENERATOR,UPDATER,SKILLMIN,SKILLMAX,SUMMARY,GENRES,DESCRIPTION,"","",""]);            
    if ( ASPECT == "EFFECT" )     UPDATEVIEW([NAME,TYPE,ACTIVATION,ACTIONLIST,DESCRIPTION,"","","","","",""]);
    if ( ASPECT == "RESILIENCE")  UPDATEVIEW([NAME,BASESTAT,TYPE,ACTION,DESCRIPTION,"","","","","",""]);
    if ( ASPECT == "BOON")        UPDATEVIEW([NAME,TYPE,GPPERLEVEL,BOONMAX,DESCRIPTION,"","","","","",""]);
    if ( ASPECT == "FLAW")        UPDATEVIEW([NAME,TYPE,GPPERLEVEL,FLAWMAX,DESCRIPTION,"","","","","",""]);
    if ( ASPECT == "CAMPAIGN")    UPDATEVIEW([NAME,STATPOOL,SKILLPOOL,PERSKILLS,SFXPOOL,HEALTHPOOL,GPPOOL,STATMAX,SKILLMAX,RESOURCES,""]);
    if ( ASPECT == "SPECIE" )     UPDATEVIEW([NAME,GPCOST,STATLIST,BOONLIST,FLAWLIST,SFXLIST,SKILLLIST,ITEMLIST,DESCRIPTION,""]);
    if ( ASPECT == "BACKGROUND" ) UPDATEVIEW([NAME,GPCOST,STATLIST,BOONLIST,FLAWLIST,SFXLIST,SKILLLIST,ITEMLIST,DESCRIPTION,""]);
    if ( ASPECT == "CAREER" )     UPDATEVIEW([NAME,GPCOST,STATLIST,BOONLIST,FLAWLIST,SFXLIST,SKILLLIST,ITEMLIST,DESCRIPTION,""]);
    if ( ASPECT == "ITEM" )       UPDATEVIEW([NAME,TYPE,RANGE,DAMAGE,RPCOST,PERIOD,BONUS,RATING,ACTIVATION,ACTIONLIST,DESCRIPTION]);
}
 
// UPDATE HOVERTEXT PRIMS WITH CURRENT VALUES BY RECORD
// INPUT: 12 item list of text values ["value1","value2",...,"value12"]
// NOTE: use "" for empty values
UPDATEVIEW(list values) {
    integer i = 0;
    for ( i = 0; i < 11; i++) {
        llSetLinkPrimitiveParamsFast(llListFindList(PRIMS,["TEXT"+(string)(i+1)]),[PRIM_TEXT,"",<1,1,1>,1]);
        llSetLinkPrimitiveParamsFast(llListFindList(PRIMS,["TEXT"+(string)(i+1)]),[PRIM_TEXT,llList2String(values,i),<1,1,1>,1]);        
    }
}
 
default {
 
    state_entry() {
        FLAG_DEBUG = FALSE;
 
        list details = llGetParcelDetails(<0,0,0>,[PARCEL_DETAILS_ID]);
        string parcelid = llList2String(details,0);
        RENDEZVOUS2 = (integer)("0x"+llGetSubString(parcelid,0,7));
        llSay(PUBLIC_CHANNEL,"Rendezvous channel is "+(string)RENDEZVOUS2);
 
        integer prims = llGetNumberOfPrims();
        integer i;
        for ( i = 0; i <= prims; i++ ) {
            string name = llList2String(llGetLinkPrimitiveParams(i,[PRIM_NAME]),0);
            PRIMS = PRIMS + [ name ]; // store name of prim in list to find its prim number fast later
            llSetLinkPrimitiveParamsFast(i,[PRIM_TEXT,"",<0,0,0>,0]); // clear any set hovertext
        }
 
        CHANNEL = (integer)("0x"+llGetSubString(llGetKey(),0,6));
        if ( HANDLE != 0 ) llListenRemove(HANDLE);
        HANDLE = llListen(CHANNEL,"",NULL_KEY,"");
 
        ASPECT = "STATISTIC";
        SWITCHBUTTONS(["Statistic_Name","Statistic_Generator","Statistic_Updater","Statistic_Minimum","Statistic_Maximum","Statistic_Summary","Statistic_Description","","","",""]);
        llRegionSay(RENDEZVOUS2,"LIST_"+ASPECT+"S");
 
        llSay(PUBLIC_CHANNEL,llGetScriptName()+" (version "+VERSION+"-"+VERSIONDATE+") ready.");
 
    }
 
    //------------------------------------------------------------------------
    listen(integer channel,string name,key id,string msg) {
        if ( FLAG_DEBUG == TRUE ) llSay(PUBLIC_CHANNEL,"DEBUG: channel=["+(string)channel+"] name=["+name+"] id=["+(string)id+"] msg=["+msg+"]");
        if ( llGetSubString(msg,0,8) == "RESPONSE=" ) {
            llSay(PUBLIC_CHANNEL,"RESPONSE: "+llGetSubString(msg,9,-1));
            return;
        }
 
        // check for empty list and record messages from server and ignore - this check saves lots of other if thens...
        list badmsgs = [ "STATISTICS|","STATISTIC|","SKILLS|","SKILL|","EFFECTS|","EFFECT|","RESILIENCES|","RESILIENCE|","BOONS|","BOON|","FLAWS|","FLAW|","CAMPAIGNS|","CAMPAIGN|","SPECIES|","SPECIE|","BACKGROUNDS|","BACKGROUND|","CAREERS|","CAREER|","ITEMS|","ITEM|"];
        if ( llListFindList(badmsgs,[msg]) != -1 ) {
            RECORDLIST = [];
            CURRENTRECORD = 0;
            llSetLinkPrimitiveParamsFast(llListFindList(PRIMS,["TEXT_LIST"]),[PRIM_TEXT,"Empty List",<1,1,1>,1]);
            return;
        }
        if ( llGetSubString(msg,0,10) == "STATISTICS|" ) {            
            RECORDLIST = llCSV2List(llGetSubString(msg,11,-1));
            string current = llList2String(RECORDLIST,CURRENTRECORD)+"\nSTATISTIC "+((string)(CURRENTRECORD+1))+" of "+(string)llGetListLength(RECORDLIST);
            llSetLinkPrimitiveParamsFast(llListFindList(PRIMS,["TEXT_LIST"]),[PRIM_TEXT,current,<1,1,1>,1]);
            llRegionSay(RENDEZVOUS2,"GET_STATISTIC|"+llStringTrim(llList2String(RECORDLIST,CURRENTRECORD),STRING_TRIM));
            return;
        }
        if ( llGetSubString(msg,0,6) == "SKILLS|" ) {
            RECORDLIST = llCSV2List(llGetSubString(msg,7,-1));
            string current = llList2String(RECORDLIST,CURRENTRECORD)+"\nSKILL "+((string)(CURRENTRECORD+1))+" of "+(string)llGetListLength(RECORDLIST);
            llSetLinkPrimitiveParamsFast(llListFindList(PRIMS,["TEXT_LIST"]),[PRIM_TEXT,current,<1,1,1>,1]);
            llRegionSay(RENDEZVOUS2,"GET_SKILL|"+llStringTrim(llList2String(RECORDLIST,CURRENTRECORD),STRING_TRIM));
            return;
        }
        if ( llGetSubString(msg,0,7) == "EFFECTS|" ) {
            RECORDLIST = llCSV2List(llGetSubString(msg,8,-1));
            string current = llList2String(RECORDLIST,CURRENTRECORD)+"\nSFX "+((string)(CURRENTRECORD+1))+" of "+(string)llGetListLength(RECORDLIST);
            llSetLinkPrimitiveParamsFast(llListFindList(PRIMS,["TEXT_LIST"]),[PRIM_TEXT,current,<1,1,1>,1]);
            llRegionSay(RENDEZVOUS2,"GET_EFFECT|"+llStringTrim(llList2String(RECORDLIST,CURRENTRECORD),STRING_TRIM));
            return;
        }
        if ( llGetSubString(msg,0,11) == "RESILIENCES|" ) {
            RECORDLIST = llCSV2List(llGetSubString(msg,12,-1));
            string current = llList2String(RECORDLIST,CURRENTRECORD)+"\nRESILIENCE "+((string)(CURRENTRECORD+1))+" of "+(string)llGetListLength(RECORDLIST);
            llSetLinkPrimitiveParamsFast(llListFindList(PRIMS,["TEXT_LIST"]),[PRIM_TEXT,current,<1,1,1>,1]);
            llRegionSay(RENDEZVOUS2,"GET_RESILIENCE|"+llStringTrim(llList2String(RECORDLIST,CURRENTRECORD),STRING_TRIM));
            return;
        }
        if ( llGetSubString(msg,0,5) == "BOONS|" ) {
            RECORDLIST = llCSV2List(llGetSubString(msg,6,-1));
            string current = llList2String(RECORDLIST,CURRENTRECORD)+"\nBOON "+((string)(CURRENTRECORD+1))+" of "+(string)llGetListLength(RECORDLIST);
            llSetLinkPrimitiveParamsFast(llListFindList(PRIMS,["TEXT_LIST"]),[PRIM_TEXT,current,<1,1,1>,1]);
            llRegionSay(RENDEZVOUS2,"GET_BOON|"+llStringTrim(llList2String(RECORDLIST,CURRENTRECORD),STRING_TRIM));
            return;
        }
        if ( llGetSubString(msg,0,5) == "FLAWS|" ) {
            RECORDLIST = llCSV2List(llGetSubString(msg,6,-1));
            string current = llList2String(RECORDLIST,CURRENTRECORD)+"\nFLAW "+((string)(CURRENTRECORD+1))+" of "+(string)llGetListLength(RECORDLIST);
            llSetLinkPrimitiveParamsFast(llListFindList(PRIMS,["TEXT_LIST"]),[PRIM_TEXT,current,<1,1,1>,1]);
            llRegionSay(RENDEZVOUS2,"GET_FLAW|"+llStringTrim(llList2String(RECORDLIST,CURRENTRECORD),STRING_TRIM));
            return;
        }
        if ( llGetSubString(msg,0,9) == "CAMPAIGNS|" ) {
            RECORDLIST = llCSV2List(llGetSubString(msg,10,-1));
            string current = llList2String(RECORDLIST,CURRENTRECORD)+"\nCAMPAIGN "+((string)(CURRENTRECORD+1))+" of "+(string)llGetListLength(RECORDLIST);
            llSetLinkPrimitiveParamsFast(llListFindList(PRIMS,["TEXT_LIST"]),[PRIM_TEXT,current,<1,1,1>,1]);
            llRegionSay(RENDEZVOUS2,"GET_CAMPAIGN|"+llStringTrim(llList2String(RECORDLIST,CURRENTRECORD),STRING_TRIM));
            return;
        }
        if ( llGetSubString(msg,0,7) == "SPECIES|" ) {
            RECORDLIST = llCSV2List(llGetSubString(msg,8,-1));
            string current = llList2String(RECORDLIST,CURRENTRECORD)+"\nSPECIE "+((string)(CURRENTRECORD+1))+" of "+(string)llGetListLength(RECORDLIST);
            llSetLinkPrimitiveParamsFast(llListFindList(PRIMS,["TEXT_LIST"]),[PRIM_TEXT,current,<1,1,1>,1]);
            llRegionSay(RENDEZVOUS2,"GET_SPECIE|"+llStringTrim(llList2String(RECORDLIST,CURRENTRECORD),STRING_TRIM));
            return;
        }
        if ( llGetSubString(msg,0,11) == "BACKGROUNDS|" ) {
            RECORDLIST = llCSV2List(llGetSubString(msg,12,-1));
            string current = llList2String(RECORDLIST,CURRENTRECORD)+"\nBACKGROUND "+((string)(CURRENTRECORD+1))+" of "+(string)llGetListLength(RECORDLIST);
            llSetLinkPrimitiveParamsFast(llListFindList(PRIMS,["TEXT_LIST"]),[PRIM_TEXT,current,<1,1,1>,1]);
            llRegionSay(RENDEZVOUS2,"GET_BACKGROUND|"+llStringTrim(llList2String(RECORDLIST,CURRENTRECORD),STRING_TRIM));
            return;
        }
        if ( llGetSubString(msg,0,7) == "CAREERS|" ) {
            RECORDLIST = llCSV2List(llGetSubString(msg,8,-1));
            string current = llList2String(RECORDLIST,CURRENTRECORD)+"\nCAREER "+((string)(CURRENTRECORD+1))+" of "+(string)llGetListLength(RECORDLIST);
            llSetLinkPrimitiveParamsFast(llListFindList(PRIMS,["TEXT_LIST"]),[PRIM_TEXT,current,<1,1,1>,1]);
            llRegionSay(RENDEZVOUS2,"GET_CAREER|"+llStringTrim(llList2String(RECORDLIST,CURRENTRECORD),STRING_TRIM));
            return;
        }
        if ( llGetSubString(msg,0,5) == "ITEMS|" ) {
            RECORDLIST = llCSV2List(llGetSubString(msg,6,-1));
            string current = llList2String(RECORDLIST,CURRENTRECORD)+"\nITEM "+((string)(CURRENTRECORD+1))+" of "+(string)llGetListLength(RECORDLIST);
            llSetLinkPrimitiveParamsFast(llListFindList(PRIMS,["TEXT_LIST"]),[PRIM_TEXT,current,<1,1,1>,1]);
            llRegionSay(RENDEZVOUS2,"GET_ITEM|"+llStringTrim(llList2String(RECORDLIST,CURRENTRECORD),STRING_TRIM));
            return;
        }
 
        // Break down incoming messages that are individual records
        if ( llGetSubString(msg,0,9) == "STATISTIC|" ) { TOKENPARSE(msg); return;}
        if ( llGetSubString(msg,0,5) == "SKILL|" ) { TOKENPARSE(msg); return;}
        if ( llGetSubString(msg,0,6) == "EFFECT|" ) { TOKENPARSE(msg); return;}
        if ( llGetSubString(msg,0,10) == "RESILIENCE|" ) { TOKENPARSE(msg); return;}
        if ( llGetSubString(msg,0,4) == "BOON|" ) { TOKENPARSE(msg); return;}
        if ( llGetSubString(msg,0,4) == "FLAW|" ) { TOKENPARSE(msg); return;}
        if ( llGetSubString(msg,0,8) == "CAMPAIGN|" ) { TOKENPARSE(msg); return;}
        if ( llGetSubString(msg,0,6) == "SPECIE|" ) { TOKENPARSE(msg); return;}
        if ( llGetSubString(msg,0,10) == "BACKGROUND|" ) { TOKENPARSE(msg); return;}
        if ( llGetSubString(msg,0,6) == "CAREER|" ) { TOKENPARSE(msg); return;}
        if ( llGetSubString(msg,0,4) == "ITEM|" ) { TOKENPARSE(msg); return;}
 
        //
        // DELETE
        //
        if ( msg == "DELETE" ) {
            string currecord;
            list aspectlist = [ "STATISTIC","SKILL","EFFECT","RESILIENCE","BOON","FLAW","CAMPAIGN","SPECIE","BACKGROUND","CAREER","ITEM"];
            if ( llListFindList(aspectlist,[ASPECT]) != -1 ) currecord = llStringTrim(llList2String(RECORDLIST,CURRENTRECORD),STRING_TRIM);
            if ( currecord != "" ) {
                llSay(PUBLIC_CHANNEL,"Sending DELETE_"+ASPECT+" command to server:\n"+currecord);
                llRegionSay(RENDEZVOUS2,"DELETE_"+ASPECT+"|"+currecord);
                CURRENTRECORD=0;
                RECORDLIST=[];
            }
            return;
        }
        if ( msg == "CLOSE" || msg == "CANCEL" || msg == "NO" ) {
            return;
        }
        if ( msg == "YES" ) { // save = yes
            string record;
            if ( ASPECT == "STATISTIC" )  record = "REQUEST=CREATE|ASPECT="+ASPECT+"|NAME="+NAME+"|GENERATOR="+GENERATOR+"|UPDATER="+UPDATER+"|STATMIN="+STATMIN+"|STATMAX="+STATMAX+"|SUMMARY="+SUMMARY+"|DESCRIPTION="+DESCRIPTION;
            if ( ASPECT == "SKILL" )      record = "REQUEST=CREATE|ASPECT="+ASPECT+"|NAME="+NAME+"|GENERATOR="+GENERATOR+"|UPDATER="+UPDATER+"|SKILLMIN="+SKILLMIN+"|SKILLMAX="+SKILLMAX+"|SUMMARY="+SUMMARY+"|GENRES="+GENRES+"|DESCRIPTION="+DESCRIPTION;
            if ( ASPECT == "EFFECT" )     record = "REQUEST=CREATE|ASPECT="+ASPECT+"|NAME="+NAME+"|TYPE="+TYPE+"|ACTIVATION="+ACTIVATION+"|ACTIONLIST="+ACTIONLIST+"|DESCRIPTION="+DESCRIPTION;
            if ( ASPECT == "RESILIENCE" ) record = "REQUEST=CREATE|ASPECT="+ASPECT+"|NAME="+NAME+"|BASESTAT="+BASESTAT+"|TYPE="+TYPE+"|ACTION="+ACTION+"|DESCRIPTION="+DESCRIPTION;
            if ( ASPECT == "BOON" )       record = "REQUEST=CREATE|ASPECT="+ASPECT+"|NAME="+NAME+"|TYPE="+TYPE+"|GPPERLEVEL="+GPPERLEVEL+"|BOONMAX="+BOONMAX+"|DESCRIPTION="+DESCRIPTION;
            if ( ASPECT == "FLAW" )       record = "REQUEST=CREATE|ASPECT="+ASPECT+"|NAME="+NAME+"|TYPE="+TYPE+"|GPPERLEVEL="+GPPERLEVEL+"|FLAWMAX="+FLAWMAX+"|DESCRIPTION="+DESCRIPTION;
            if ( ASPECT == "CAMPAIGN" )   record = "REQUEST=CREATE|ASPECT="+ASPECT+"|NAME="+NAME+"|STATPOOL="+STATPOOL+"|SKILLPOOL="+SKILLPOOL+"|PERSKILLS="+PERSKILLS+"|SFXPOOL="+SFXPOOL+"|HEALTHPOOL="+HEALTHPOOL+"|GPPOOL="+GPPOOL+"|STATMAX="+STATMAX+"|SKILLMAX="+SKILLMAX+"|RESOURCES="+RESOURCES;
            if ( ASPECT == "SPECIE" )     record = "REQUEST=CREATE|ASPECT="+ASPECT+"|NAME="+NAME+"|GPCOST="+GPCOST+"|STATLIST="+STATLIST+"|BOONLIST="+BOONLIST+"|FLAWLIST="+FLAWLIST+"|SFXLIST="+SFXLIST+"|SKILLLIST="+SKILLLIST+"|ITEMLIST="+ITEMLIST+"|DESCRIPTION="+DESCRIPTION;
            if ( ASPECT == "BACKGROUND" ) record = "REQUEST=CREATE|ASPECT="+ASPECT+"|NAME="+NAME+"|GPCOST="+GPCOST+"|STATLIST="+STATLIST+"|BOONLIST="+BOONLIST+"|FLAWLIST="+FLAWLIST+"|SFXLIST="+SFXLIST+"|SKILLLIST="+SKILLLIST+"|ITEMLIST="+ITEMLIST+"|DESCRIPTION="+DESCRIPTION;
            if ( ASPECT == "CAREER" )     record = "REQUEST=CREATE|ASPECT="+ASPECT+"|NAME="+NAME+"|GPCOST="+GPCOST+"|STATLIST="+STATLIST+"|BOONLIST="+BOONLIST+"|FLAWLIST="+FLAWLIST+"|SFXLIST="+SFXLIST+"|SKILLLIST="+SKILLLIST+"|ITEMLIST="+ITEMLIST+"|DESCRIPTION="+DESCRIPTION;
            if ( ASPECT == "ITEM" )       record = "REQUEST=CREATE|ASPECT="+ASPECT+"|NAME="+NAME+"|TYPE="+TYPE+"|RANGE="+RANGE+"|DAMAGE="+DAMAGE+"|RPCOST="+RPCOST+"|PERIOD="+PERIOD+"|BONUS="+BONUS+"|RATING="+RATING+"|ACTIVATION="+ACTIVATION+"|ACTIONLIST="+ACTIONLIST+"|DESCRIPTION="+DESCRIPTION;
            if ( record != "" ) {
                llSay(PUBLIC_CHANNEL,"Sending CREATE_"+ASPECT+" request to server:\n"+record);
                llRegionSay(RENDEZVOUS2,record);
            }
            return;
        }
        if ( msg == "RESET" ) { // reset confirmed
            llResetScript();
            return;
        }
        integer i;
        if ( BUTTON == "BUTTON1" ) {
            i = llListFindList(PRIMS,["TEXT1"]);
            NAME = msg;
            llSay(PUBLIC_CHANNEL,ASPECT+" NAME set to "+NAME);
        }
        if ( BUTTON == "BUTTON2" ) {
            i = llListFindList(PRIMS,["TEXT2"]);
            if ( ASPECT == "STATISTIC" ) {
                GENERATOR = llToUpper(msg);
                if ( GENERATOR != "POINTBUY" && GENERATOR != "TEMPLATE" && GENERATOR != "RANDOM" ) {
                    llSay(PUBLIC_CHANNEL,"Invalid STATISTIC GENERATOR specified. Please re-enter.");
                    return;
                }
                llSay(PUBLIC_CHANNEL,"STATISTIC GENERATOR set to "+GENERATOR);
            }
            if ( ASPECT == "SKILL" ) {
                GENERATOR = llToUpper(msg);
                if ( GENERATOR != "POINTBUY" && GENERATOR != "TEMPLATE" && GENERATOR != "RANDOM" ) {
                    llSay(PUBLIC_CHANNEL,"Invalid SKILL GENERATOR specified. Please re-enter.");
                    return;
                }
                llSay(PUBLIC_CHANNEL,"SKILL GENERATOR set to "+GENERATOR);        
            }
            if ( ASPECT == "EFFECT" ) {
                TYPE = llToUpper(msg);
                if ( TYPE != "MORTAL" && TYPE != "SOCIAL" && TYPE != "MAGIC" && TYPE != "VEHICLE" && TYPE != "ITEM" ) {
                    llSay(PUBLIC_CHANNEL,"Invalid EFFECT TYPE specified. Please re-enter.");
                    return;
                }
                llSay(PUBLIC_CHANNEL,"EFFECT TYPE set to "+TYPE);
            }
            if ( ASPECT == "RESILIENCE" ) { BASESTAT = msg; llSay(PUBLIC_CHANNEL,"RESILIENCE BASESTAT set to "+BASESTAT);}
            if ( ASPECT == "BOON" ) {
                TYPE = llToUpper(msg);
                if ( TYPE != "GENERAL" && TYPE != "RACIAL" ) {
                    llSay(PUBLIC_CHANNEL,"Invalid BOON TYPE specified. Please re-enter.");
                    return;
                }
                llSay(PUBLIC_CHANNEL,"BOON TYPE set to "+TYPE);
            }
            if ( ASPECT == "FLAW" ) {
                TYPE = llToUpper(msg);
                if ( TYPE != "GENERAL" && TYPE != "RACIAL" ) {
                    llSay(PUBLIC_CHANNEL,"Invalid FLAW TYPE specified. Please re-enter.");
                    return;
                }
                llSay(PUBLIC_CHANNEL,"FLAW TYPE set to "+TYPE);
            }
            if ( ASPECT == "CAMPAIGN" ) { STATPOOL = msg; llSay(PUBLIC_CHANNEL,"CAMPAIGN STATPOOL set to "+STATPOOL);}
            if ( ASPECT == "SPECIE" ) { GPCOST = msg; llSay(PUBLIC_CHANNEL,"SPECIE GPCOST set to "+GPCOST);}
            if ( ASPECT == "BACKGROUND" ) { GPCOST = msg; llSay(PUBLIC_CHANNEL,"BACKGROUND GPCOST set to "+GPCOST);}
            if ( ASPECT == "CAREER" ) { GPCOST = msg; llSay(PUBLIC_CHANNEL,"CAREER GPCOST set to "+GPCOST);}
            if ( ASPECT == "ITEM" ) { TYPE = msg; llSay(PUBLIC_CHANNEL,"ITEM TYPE set to "+TYPE);}    
        }
        if ( BUTTON == "BUTTON3" ) {
            i = llListFindList(PRIMS,["TEXT3"]);
            if ( ASPECT == "STATISTIC" ) {
                UPDATER = llToUpper(msg);
                if ( UPDATER != "LEVEL" && UPDATER != "GRADUAL" && UPDATER != "RANDOM" ) {
                    llSay(PUBLIC_CHANNEL,"Invalid STATISTIC UPDATER specified. Please re-enter.");
                    return;
                }            
                llSay(PUBLIC_CHANNEL,"STATISTIC UPDATER set to "+UPDATER);
            }
            if ( ASPECT == "SKILL" ) {
                UPDATER = llToUpper(msg);
                if ( UPDATER != "LEVEL" && UPDATER != "GRADUAL" && UPDATER != "RANDOM" ) {
                    llSay(PUBLIC_CHANNEL,"Invalid SKILL UPDATER specified. Please re-enter.");
                    return;
                }            
                llSay(PUBLIC_CHANNEL,"SKILL UPDATER set to "+UPDATER);            
            }
            if ( ASPECT == "EFFECT" ) { ACTIVATION = msg; llSay(PUBLIC_CHANNEL,"EFFECT ACTIVATION set to "+ACTIVATION);}
            if ( ASPECT == "RESILIENCE") {
                TYPE = llToUpper(msg);
                if ( TYPE != "NONCRITICAL" && TYPE != "CRITICAL" ) {
                    llSay(PUBLIC_CHANNEL,"Invalid RESILIENCE TYPE specified. Please re-enter.");
                    return;
                }
                llSay(PUBLIC_CHANNEL,"RESILIENCE TYPE set to "+TYPE);
            }
            if ( ASPECT == "BOON" ) { GPPERLEVEL = msg; llSay(PUBLIC_CHANNEL,"BOON GPPERLEVEL set to "+GPPERLEVEL);}
            if ( ASPECT == "FLAW" ) { GPPERLEVEL = msg; llSay(PUBLIC_CHANNEL,"FLAW GPPERLEVEL set to "+GPPERLEVEL);}
            if ( ASPECT == "CAMPAIGN" ) { SKILLPOOL = msg; llSay(PUBLIC_CHANNEL,"CAMPAIGN SKILLPOOL set to "+SKILLPOOL);}
            if ( ASPECT == "SPECIE" ){ STATLIST = msg; llSay(PUBLIC_CHANNEL,"SPECIE STATLIST set to "+STATLIST); }
            if ( ASPECT == "BACKGROUND" ){ STATLIST = msg; llSay(PUBLIC_CHANNEL,"BACKGROUND STATLIST set to "+STATLIST); }
            if ( ASPECT == "CAREER" ){ STATLIST = msg; llSay(PUBLIC_CHANNEL,"CAREER STATLIST set to "+STATLIST); }
            if ( ASPECT == "ITEM" ) { RANGE = msg; llSay(PUBLIC_CHANNEL,"ITEM RANGE set to "+RANGE);}
        }
        if ( BUTTON == "BUTTON4" ) {
            i = llListFindList(PRIMS,["TEXT4"]);
            if ( ASPECT == "STATISTIC" ) { STATMIN = msg; llSay(PUBLIC_CHANNEL,"STATISTIC MINIMUM set to "+STATMIN); }
            if ( ASPECT == "SKILL" ){ SKILLMIN = msg; llSay(PUBLIC_CHANNEL,"SKILL MINIMUM set to "+SKILLMIN); }
            if ( ASPECT == "EFFECT" ){ ACTIONLIST = msg; llSay(PUBLIC_CHANNEL,"EFFECT ACTIONLIST set to "+ACTIONLIST); }
            if ( ASPECT == "RESILIENCE" ){ ACTION = msg; llSay(PUBLIC_CHANNEL,"RESILIENCE ACTION set to "+ACTION); }
            if ( ASPECT == "BOON" ){ BOONMAX = msg; llSay(PUBLIC_CHANNEL,"BOON BOONMAX set to "+BOONMAX); }
            if ( ASPECT == "FLAW" ){ FLAWMAX = msg; llSay(PUBLIC_CHANNEL,"FLAW FLAWMAX set to "+FLAWMAX); }
            if ( ASPECT == "CAMPAIGN" ){ PERSKILLS = msg; llSay(PUBLIC_CHANNEL,"CAMPAIGN PERSKILLS set to "+PERSKILLS); }
            if ( ASPECT == "SPECIE" ){ BOONLIST = msg; llSay(PUBLIC_CHANNEL,"SPECIE BOONLIST set to "+BOONLIST); }
            if ( ASPECT == "BACKGROUND" ){ BOONLIST = msg; llSay(PUBLIC_CHANNEL,"BACKGROUND BOONLIST set to "+BOONLIST); }
            if ( ASPECT == "CAREER" ){ BOONLIST = msg; llSay(PUBLIC_CHANNEL,"CAREER BOONLIST set to "+BOONLIST); }
            if ( ASPECT == "ITEM" ){ DAMAGE = msg; llSay(PUBLIC_CHANNEL,"ITEM DAMAGE set to "+DAMAGE); }        
        }
        if ( BUTTON == "BUTTON5" ) {
            i = llListFindList(PRIMS,["TEXT5"]);
            if ( ASPECT == "STATISTIC" ) { STATMAX = msg; llSay(PUBLIC_CHANNEL,"STATISTIC MAXIMUM set to "+STATMAX); }
            if ( ASPECT == "SKILL" ) { SKILLMAX = msg; llSay(PUBLIC_CHANNEL,"SKILL MAXIMUM set to "+SKILLMAX); }
            if ( ASPECT == "EFFECT" ){ DESCRIPTION = msg; llSay(PUBLIC_CHANNEL,"EFFECT DESCRIPTION set to "+DESCRIPTION); }
            if ( ASPECT == "RESILIENCE" ){ DESCRIPTION = msg; llSay(PUBLIC_CHANNEL,"RESILIENCE DESCRIPTION set to "+DESCRIPTION); }
            if ( ASPECT == "BOON" ){ DESCRIPTION = msg; llSay(PUBLIC_CHANNEL,"BOON DESCRIPTION set to "+DESCRIPTION); }
            if ( ASPECT == "FLAW" ){ DESCRIPTION = msg; llSay(PUBLIC_CHANNEL,"FLAW DESCRIPTION set to "+DESCRIPTION); }
            if ( ASPECT == "CAMPAIGN" ){ SFXPOOL = msg; llSay(PUBLIC_CHANNEL,"CAMPAIGN SFXPOOL set to "+SFXPOOL); }
            if ( ASPECT == "SPECIE" ){ FLAWLIST = msg; llSay(PUBLIC_CHANNEL,"SPECIE FLAWLIST set to "+FLAWLIST); }
            if ( ASPECT == "BACKGROUND" ){ FLAWLIST = msg; llSay(PUBLIC_CHANNEL,"BACKGROUND FLAWLIST set to "+FLAWLIST); }
            if ( ASPECT == "CAREER" ){ FLAWLIST = msg; llSay(PUBLIC_CHANNEL,"CAREER FLAWLIST set to "+FLAWLIST); }
            if ( ASPECT == "ITEM" ){ RPCOST = msg; llSay(PUBLIC_CHANNEL,"ITEM RPCOST set to "+RPCOST); }
        }
        if ( BUTTON == "BUTTON6" ) {
            i = llListFindList(PRIMS,["TEXT6"]);
            if ( ASPECT == "STATISTIC" ) { SUMMARY = msg; llSay(PUBLIC_CHANNEL,"STATISTIC SUMMARY set to "+SUMMARY); }
            if ( ASPECT == "SKILL" ) { SUMMARY = msg; llSay(PUBLIC_CHANNEL,"SKILL SUMMARY set to "+SUMMARY); }
            if ( ASPECT == "CAMPAIGN" ){ HEALTHPOOL = msg; llSay(PUBLIC_CHANNEL,"CAMPAIGN HEALTHPOOL set to "+HEALTHPOOL); }
            if ( ASPECT == "SPECIE" ){ SFXLIST = msg; llSay(PUBLIC_CHANNEL,"SPECIE SFXLIST set to "+SFXLIST); }
            if ( ASPECT == "BACKGROUND" ){ SFXLIST = msg; llSay(PUBLIC_CHANNEL,"BACKGROUND SFXLIST set to "+SFXLIST); }
            if ( ASPECT == "CAREER" ){ SFXLIST = msg; llSay(PUBLIC_CHANNEL,"CAREER SFXLIST set to "+SFXLIST); }
            if ( ASPECT == "ITEM" ){ PERIOD = msg; llSay(PUBLIC_CHANNEL,"ITEM PERIOD set to "+PERIOD); }
        }
        if ( BUTTON == "BUTTON7" ) {
            i = llListFindList(PRIMS,["TEXT7"]);
            if ( ASPECT == "STATISTIC" ) { DESCRIPTION = msg; llSay(PUBLIC_CHANNEL,"STATISTIC DESCRIPTION set to "+DESCRIPTION); }
            if ( ASPECT == "SKILL" ) { GENRES = msg; llSay(PUBLIC_CHANNEL,"SKILL GENRES set to "+GENRES); }
            if ( ASPECT == "CAMPAIGN" ){ GPPOOL = msg; llSay(PUBLIC_CHANNEL,"CAMPAIGN GPPOOL set to "+GPPOOL); }
            if ( ASPECT == "SPECIE" ){ SKILLLIST = msg; llSay(PUBLIC_CHANNEL,"SPECIE SKILLLIST set to "+SKILLLIST); }
            if ( ASPECT == "BACKGROUND" ){ SKILLLIST = msg; llSay(PUBLIC_CHANNEL,"BACKGROUND SKILLLIST set to "+SKILLLIST); }
            if ( ASPECT == "CAREER" ){ SKILLLIST = msg; llSay(PUBLIC_CHANNEL,"CAREER SKILLLIST set to "+SKILLLIST); }
            if ( ASPECT == "ITEM" ){ BONUS = msg; llSay(PUBLIC_CHANNEL,"ITEM BONUS set to "+BONUS); }
        }
        if ( BUTTON == "BUTTON8" ) {
            i = llListFindList(PRIMS,["TEXT8"]);
            if ( ASPECT == "SKILL" ) { DESCRIPTION = msg; llSay(PUBLIC_CHANNEL,"SKILL DESCRIPTION set to "+DESCRIPTION); }
            if ( ASPECT == "CAMPAIGN" ){ STATMAX = msg; llSay(PUBLIC_CHANNEL,"CAMPAIGN STATMAX set to "+STATMAX); }
            if ( ASPECT == "SPECIE" ){ ITEMLIST = msg; llSay(PUBLIC_CHANNEL,"SPECIE ITEMLIST set to "+ITEMLIST); }
            if ( ASPECT == "BACKGROUND" ){ ITEMLIST = msg; llSay(PUBLIC_CHANNEL,"BACKGROUND ITEMLIST set to "+ITEMLIST); }
            if ( ASPECT == "CAREER" ){ ITEMLIST = msg; llSay(PUBLIC_CHANNEL,"CAREER ITEMLIST set to "+ITEMLIST); }
            if ( ASPECT == "ITEM" ){ RATING = msg; llSay(PUBLIC_CHANNEL,"ITEM RATING set to "+RATING); }
        }
        if ( BUTTON == "BUTTON9" ) {
            i = llListFindList(PRIMS,["TEXT9"]);
            if ( ASPECT == "CAMPAIGN" ){ SKILLMAX = msg; llSay(PUBLIC_CHANNEL,"CAMPAIGN SKILLMAX set to "+SKILLMAX); }
            if ( ASPECT == "SPECIE" ){ DESCRIPTION = msg; llSay(PUBLIC_CHANNEL,"SPECIE DESCRIPTION set to "+DESCRIPTION); }
            if ( ASPECT == "BACKGROUND" ){ DESCRIPTION = msg; llSay(PUBLIC_CHANNEL,"BACKGROUND DESCRIPTION set to "+DESCRIPTION); }
            if ( ASPECT == "CAREER" ){ DESCRIPTION = msg; llSay(PUBLIC_CHANNEL,"CAREER DESCRIPTION set to "+DESCRIPTION); }
            if ( ASPECT == "ITEM" ){ ACTIVATION = msg; llSay(PUBLIC_CHANNEL,"ITEM ACTIVATION set to "+ACTIVATION); }
        }
        if ( BUTTON == "BUTTON10" ) {
            i = llListFindList(PRIMS,["TEXT10"]);
            if ( ASPECT == "CAMPAIGN" ){ RESOURCES = msg; llSay(PUBLIC_CHANNEL,"CAMPAIGN RESOURCES set to "+RESOURCES); }
            if ( ASPECT == "ITEM" ){ ACTIONLIST = msg; llSay(PUBLIC_CHANNEL,"ITEM ACTIONLIST set to "+ACTIONLIST); }            
        }
        if ( BUTTON == "BUTTON11" ) {
            i = llListFindList(PRIMS,["TEXT11"]);
            if ( ASPECT == "ITEM" ){ DESCRIPTION = msg; llSay(PUBLIC_CHANNEL,"ITEM DESCRIPTION set to "+DESCRIPTION); }
        }        
        llSetLinkPrimitiveParamsFast(i,[PRIM_TEXT,msg,<1,1,1>,1]);
    }
 
    //------------------------------------------------------------------------    
    touch_start(integer touched) {
        if ( FLAG_DEBUG == TRUE ) llSay(PUBLIC_CHANNEL,"DEBUG: touched=["+(string)touched+"]");
        key touchedby = llDetectedKey(0);
        integer primnumber = llDetectedLinkNumber(0);
        string name = llGetLinkName(primnumber);
        BUTTON = name;
        // process the aspect buttons
        if ( name == "STATISTICS" ) {
            ASPECT = "STATISTIC";
            CURRENTRECORD = 0;
            SWITCHBUTTONS(["Statistic_Name","Statistic_Generator","Statistic_Updater","Statistic_Minimum","Statistic_Maximum","Statistic_Summary","Statistic_Description","","","",""]);
            llRegionSay(RENDEZVOUS2,"LIST_STATISTICS");
            return;
        }
        if ( name == "SKILLS" ) { 
            ASPECT = "SKILL";
            CURRENTRECORD = 0;
            SWITCHBUTTONS(["Skill_Name","Skill_Generator","Skill_Updater","Skill_Minimum","Skill_Maximum","Skill_Summary","Skill_Genres","Skill_Description","","",""]);
            llRegionSay(RENDEZVOUS2,"LIST_SKILLS"); return;
        }
        if ( name == "EFFECTS" ) {
            ASPECT = "EFFECT";
            CURRENTRECORD = 0;
            SWITCHBUTTONS(["SFX_Name","SFX_Type","SFX_Activation","SFX_ActionList","SFX_Description","","","","","",""]);        
            llRegionSay(RENDEZVOUS2,"LIST_EFFECTS");
            return;
        }
        if ( name == "RESILIENCES" ) {
            ASPECT = "RESILIENCE";
            CURRENTRECORD = 0;
            SWITCHBUTTONS(["Resilience_Name","Resilience_BaseStat","Resilience_Type","Resilience_Action","Resilience_Description","","","","","",""]);
            llRegionSay(RENDEZVOUS2,"LIST_RESILIENCES");
            return;
        }
        if ( name == "BOONS" ) {
            ASPECT = "BOON";
            CURRENTRECORD = 0;
            SWITCHBUTTONS(["Boon_Name","Boon_Type","Boon_GPperLevel","Boon_Maximum","Boon_Description","","","","","",""]);
            llRegionSay(RENDEZVOUS2,"LIST_BOONS");
            return;
        }
        if ( name == "FLAWS" ) {
            ASPECT = "FLAW";
            CURRENTRECORD = 0;
            SWITCHBUTTONS(["Flaw_Name","Flaw_Type","Flaw_GPperLevel","Flaw_Maximum","Flaw_Description","","","","","",""]);
            llRegionSay(RENDEZVOUS2,"LIST_FLAWS");
            return;
        }
        if ( name == "CAMPAIGNS" ) {
            ASPECT = "CAMPAIGN";
            CURRENTRECORD = 0;
            SWITCHBUTTONS(["Campaign_Name","Campaign_StatPool","Campaign_SkillPool","Campaign_PerSkills","Campaign_SFXPool","Campaign_HealthPool","Campaign_GPPool","Campaign_MaxStat","Campaign_MaxSkill","Campaign_Resources",""]);
            llRegionSay(RENDEZVOUS2,"LIST_CAMPAIGNS"); 
            return;
        }
        if ( name == "SPECIES" ) {
            ASPECT = "SPECIE";
            CURRENTRECORD = 0;
            SWITCHBUTTONS(["Species_Name","Species_GPCost","Species_StatList","Species_BoonList","Species_FlawList","Species_SFXList","Species_SkillList","Species_ItemList","Species_Description","",""]);
            llRegionSay(RENDEZVOUS2,"LIST_SPECIES");
            return;
        }
        if ( name == "BACKGROUNDS" ) {
            ASPECT = "BACKGROUND";
            CURRENTRECORD = 0;
            SWITCHBUTTONS(["Background_Name","Background_GPCost","Background_StatList","Background_BoonList","Background_FlawList","Background_SFXList","Background_SkillList","Background_ItemList","Background_Description","",""]);
            llRegionSay(RENDEZVOUS2,"LIST_BACKGROUNDS");
            return;
        }
        if ( name == "CAREERS" ) {
            ASPECT = "CAREER";
            CURRENTRECORD = 0;
            SWITCHBUTTONS(["Career_Name","Career_GPCost","Career_StatList","Career_BoonList","Career_FlawList","Career_SFXList","Career_SkillList","Career_ItemList","Career_Description","",""]);
            llRegionSay(RENDEZVOUS2,"LIST_CAREERS");
            return;
        }
        if ( name == "ITEMS" ) {
            ASPECT = "ITEM";
            CURRENTRECORD = 0;
            SWITCHBUTTONS(["Item_Name","Item_Type","Item_Range","Item_Damage","Item_RPCost","Item_Period","Item_Bonus","Item_Rating","Item_Activation","Item_Effects","Item_Description"]);
            llRegionSay(RENDEZVOUS2,"LIST_ITEMS");
            return;
        }        
        // process list buttons
        if ( name == "BUTTON_TOP" ) {
            string current;
            integer len;
            string out;
            CURRENTRECORD = 0;
            current = llList2String(RECORDLIST,CURRENTRECORD);
            len = llGetListLength(RECORDLIST);
            if ( len != 0 ) {
                out = current + "\n"+ASPECT+" "+((string)(CURRENTRECORD+1))+" of "+(string)len;
                llSetLinkPrimitiveParamsFast(llListFindList(PRIMS,["TEXT_LIST"]),[PRIM_TEXT,out,<1,1,1>,1]);
                llRegionSay(RENDEZVOUS2,"GET_"+ASPECT+"|"+current);
            }
            return;
        }
        if ( name == "BUTTON_PREV" ) {
            string current;
            integer len;
            string out;            
            CURRENTRECORD--;
            if ( CURRENTRECORD < 0 ) CURRENTRECORD = 0;
            current = llList2String(RECORDLIST,CURRENTRECORD);
            len = llGetListLength(RECORDLIST);
            if ( len != 0 ) {
                out = current + "\n"+ASPECT+" "+((string)(CURRENTRECORD+1))+" of "+(string)len;
                llSetLinkPrimitiveParamsFast(llListFindList(PRIMS,["TEXT_LIST"]),[PRIM_TEXT,out,<1,1,1>,1]);
                llRegionSay(RENDEZVOUS2,"GET_"+ASPECT+"|"+current);
            }
            return;
        }
        if ( name == "BUTTON_NEXT" ) {
            string current;
            integer len;
            string out;
            // split lists like this is ugly but needed due to variable length lists for each aspect
            len = llGetListLength(RECORDLIST);
            if ( len != 0 ) {
                CURRENTRECORD++; // add one to current
                if ( CURRENTRECORD >= len ) CURRENTRECORD = len - 1; // check we didn't run off the end of current list
                if ( CURRENTRECORD < 0 ) CURRENTRECORD = 0;
                // now find list item based on updated record value
                current = llList2String(RECORDLIST,CURRENTRECORD);
                out = current + "\n"+ASPECT+" "+((string)(CURRENTRECORD+1))+" of "+(string)len;
                llSetLinkPrimitiveParamsFast(llListFindList(PRIMS,["TEXT_LIST"]),[PRIM_TEXT,out,<1,1,1>,1]);
                llRegionSay(RENDEZVOUS2,"GET_"+ASPECT+"|"+current);
            }
            return;
        }
        if ( name == "BUTTON_BOTTOM" ) {
            string current;
            integer len;
            string out;
            len = llGetListLength(RECORDLIST);
            if ( len != 0 ) {
                // now set current record to end of current list
                CURRENTRECORD = len - 1;
                // make sure to sanity check the values before looking things up in lists
                if ( CURRENTRECORD >= len ) CURRENTRECORD = len - 1;
                if ( CURRENTRECORD < 0 ) CURRENTRECORD = 0;
                // now that we know the record number, load the specific aspect's record name
                current = llList2String(RECORDLIST,CURRENTRECORD);
                out = current + "\n"+ASPECT+" "+((string)(CURRENTRECORD+1))+" of "+(string)len;
                llSetLinkPrimitiveParamsFast(llListFindList(PRIMS,["TEXT_LIST"]),[PRIM_TEXT,out,<1,1,1>,1]);
                llRegionSay(RENDEZVOUS2,"GET_"+ASPECT+"|"+current);
            }
            return;
        }
        // process action buttons
        if ( name == "BUTTON_NEW" ) {
            llSetLinkPrimitiveParamsFast(llListFindList(PRIMS,["TEXT_LIST"]),[PRIM_TEXT,"CREATING NEW",<1,1,1>,1]);
            integer count = 11;
            while ( count-- ) {
                llSetLinkPrimitiveParamsFast(llListFindList(PRIMS,["TEXT"+(string)count]),[PRIM_TEXT,"",<1,1,1>,1]);
            }
            NAME="";
            GENERATOR="";
            UPDATER="";
            STATMIN="";
            SKILLMIN="";
            STATMAX="";
            SKILLMAX="";
            SUMMARY="";
            DESCRIPTION="";
            GENRES="";
            TYPE="";
            ACTIVATION="";
            ACTIONLIST="";
            BASESTAT="";
            ACTION="";
            GPPERLEVEL="";
            BOONMAX="";
            FLAWMAX="";
            STATPOOL="";
            SKILLPOOL="";
            SFXPOOL="";
            HEALTHPOOL="";
            GPPOOL="";
            RESOURCES="";
            GPCOST="";
            STATLIST="";
            BOONLIST="";
            FLAWLIST="";
            SKILLLIST="";
            SFXLIST="";
            ITEMLIST="";
            RANGE="";
            DAMAGE="";
            RPCOST="";
            PERIOD="";
            BONUS="";
            RATING="";
            llSay(PUBLIC_CHANNEL,"Ready to start creating a new Myriad Lite record using the buttons to the right.");
            return;
        }
        if ( name == "BUTTON_DELETE" ) {
            string currecord;
            currecord = llStringTrim(llList2String(RECORDLIST,CURRENTRECORD),STRING_TRIM);
            if ( currecord != "" ) {
                llDialog(touchedby,"Delete "+ASPECT+" "+currecord+"?",["DELETE","CLOSE"],CHANNEL);
            }
            return;
        }
        if ( name == "SAVE" ) {
            llDialog(llDetectedKey(0),"Are You Sure?",["YES","NO","CLOSE"],CHANNEL);
        }
        if ( name == "RESET" ) {
            llDialog(llDetectedKey(0),"Are You Sure?",["RESET","CANCEL","CLOSE"],CHANNEL);
        }
 
        // process dynamic buttons
        if ( name == "BUTTON1" ) {
            if ( ASPECT == "STATISTIC" ) llTextBox(touchedby,"What Is This Statistic's NAME?",CHANNEL);
            if ( ASPECT == "SKILL" )     llTextBox(touchedby,"What Is This Skill's NAME?",CHANNEL);
            if ( ASPECT == "EFFECT" )    llTextBox(touchedby,"What is this Effect's NAME?",CHANNEL);
            if ( ASPECT == "RESILIENCE") llTextBox(touchedby,"What is this Resilience's NAME?",CHANNEL);
            if ( ASPECT == "BOON" )      llTextBox(touchedby,"What is this Boon's NAME?",CHANNEL);
            if ( ASPECT == "FLAW" )      llTextBox(touchedby,"What is this Flaw's NAME?",CHANNEL);
            if ( ASPECT == "CAMPAIGN" )  llTextBox(touchedby,"What is this Campaign's NAME?",CHANNEL);
            if ( ASPECT == "SPECIE" )    llTextBox(touchedby,"What is this Species' NAME?", CHANNEL);
            if ( ASPECT == "BACKGROUND") llTextBox(touchedby,"What is this Background's NAME?",CHANNEL);
            if ( ASPECT == "CAREER" )    llTextBox(touchedby,"What is this Career's NAME?",CHANNEL);
            if ( ASPECT == "ITEM")       llTextBox(touchedby,"What is this Item's NAME?",CHANNEL);
            return;
        }
        if ( name == "BUTTON2" ) {
            if ( ASPECT == "STATISTIC" ) llDialog(touchedby,"How will players GENERATE this Statistic?",["RANDOM","TEMPLATE","POINTBUY"],CHANNEL);
            if ( ASPECT == "SKILL" )     llDialog(touchedby,"How will players GENERATE this Skill?",["RANDOM","TEMPLATE","POINTBUY"],CHANNEL);
            if ( ASPECT == "EFFECT" )    llDialog(touchedby,"What TYPE of SFX is this?",["MORTAL","SOCIAL","MAGIC","VEHICLE","ITEM"],CHANNEL);
            if ( ASPECT == "RESILIENCE") llTextBox(touchedby,"What is this Resilience's BASESTAT?",CHANNEL);
            if ( ASPECT == "BOON" )      llDialog(touchedby,"What is this Boon's TYPE?",["GENERAL","RACIAL"],CHANNEL);
            if ( ASPECT == "FLAW" )      llDialog(touchedby,"What is this Flaw's TYPE?",["GENERAL","RACIAL"],CHANNEL);
            if ( ASPECT == "CAMPAIGN" )  llTextBox(touchedby,"What is this Campaign's STATPOOL?",CHANNEL);
            if ( ASPECT == "SPECIE" )    llTextBox(touchedby,"What is this Species' GPCOST?", CHANNEL);
            if ( ASPECT == "BACKGROUND") llTextBox(touchedby,"What is this Background's GPCOST?",CHANNEL);
            if ( ASPECT == "CAREER" )    llTextBox(touchedby,"What is this Career's GPCOST?",CHANNEL);
            if ( ASPECT == "ITEM")       llDialog(touchedby,"What is this Item's TYPE?",["WEAPON","ARMOR","ACCESSORY","ESSENTIAL","ENHANCER","SFX"],CHANNEL);
            return;
        }
        if ( name == "BUTTON3" ) {
            if ( ASPECT == "STATISTIC" ) llDialog(touchedby,"How will players UPDATE this Statistic?",["LEVEL","GRADUAL","RANDOM"],CHANNEL);
            if ( ASPECT == "SKILL" )     llDialog(touchedby,"How will players UPDATE this Skill?",["LEVEL","GRADUAL","RANDOM"],CHANNEL);
            if ( ASPECT == "EFFECT" )    llTextBox(touchedby,"What is this Effect's ACTIVATION?",CHANNEL);
            if ( ASPECT == "RESILIENCE") llDialog(touchedby,"What is this Resilience's TYPE?",["NONCRITICAL","CRITICAL"],CHANNEL);
            if ( ASPECT == "BOON" )      llTextBox(touchedby,"What is this Boon's GPPERLEVEL?",CHANNEL);
            if ( ASPECT == "FLAW" )      llTextBox(touchedby,"What is this Flaw's GPPERLEVEL?",CHANNEL);
            if ( ASPECT == "CAMPAIGN" )  llTextBox(touchedby,"What is this Campaign's SKILLPOOL?",CHANNEL);
            if ( ASPECT == "SPECIE" )    llTextBox(touchedby,"What is this Species' STATLIST (CSV)?", CHANNEL);
            if ( ASPECT == "BACKGROUND") llTextBox(touchedby,"What is this Background's STATLIST (CSV)?",CHANNEL);
            if ( ASPECT == "CAREER" )    llTextBox(touchedby,"What is this Career's STATLIST (CSV)?",CHANNEL);
            if ( ASPECT == "ITEM")       llDialog(touchedby,"What is this Item's RANGE?",["MELEE","SHORT","MEDIUM","LONG"],CHANNEL);
            return;
        }
        if ( name == "BUTTON4" ) {
            if ( ASPECT == "STATISTIC" ) llTextBox(touchedby,"Type in the MINIMUM allowed value for this new Statistic:\n1 for Myriad",CHANNEL);
            if ( ASPECT == "SKILL" )     llTextBox(touchedby,"Type in the MINIMUM allowed value for this new Skill:\n1 for Myriad",CHANNEL);
            if ( ASPECT == "EFFECT" )    llTextBox(touchedby,"What is this Effect's ACTIONLIST (CSV)?",CHANNEL);
            if ( ASPECT == "RESILIENCE") llTextBox(touchedby,"What is this Resilience's ACTION?",CHANNEL);
            if ( ASPECT == "BOON" )      llTextBox(touchedby,"What is this Boon's MAXIMUM?",CHANNEL);
            if ( ASPECT == "FLAW" )      llTextBox(touchedby,"What is this Flaw's MAXIMUM?",CHANNEL);
            if ( ASPECT == "CAMPAIGN" )  llTextBox(touchedby,"What is this Campaign's PERSKILLS?",CHANNEL);
            if ( ASPECT == "SPECIE" )    llTextBox(touchedby,"What is this Species' BOONLIST (CSV)?", CHANNEL);
            if ( ASPECT == "BACKGROUND") llTextBox(touchedby,"What is this Background's BOONLIST (CSV)?",CHANNEL);
            if ( ASPECT == "CAREER" )    llTextBox(touchedby,"What is this Career's BOONLIST (CSV)?",CHANNEL);
            if ( ASPECT == "ITEM")       llTextBox(touchedby,"What is this Item's DAMAGE?",CHANNEL);
            return;
        }
        if ( name == "BUTTON5" ) {
            if ( ASPECT == "STATISTIC" ) llTextBox(touchedby,"Type in the MAXIMUM allowed value for this new Statistic:\n10 for Myriad",CHANNEL);
            if ( ASPECT == "SKILL" )     llTextBox(touchedby,"Type in the MAXIMUM allowed value for this new Skill:\n5 for Myriad",CHANNEL);
            if ( ASPECT == "EFFECT" )    llTextBox(touchedby,"What is this Effect's DESCRIPTION?",CHANNEL);
            if ( ASPECT == "RESILIENCE") llTextBox(touchedby,"What is this Resilience's DESCRIPTION?",CHANNEL);
            if ( ASPECT == "BOON" )      llTextBox(touchedby,"What is this Boon's DESCRIPTION?",CHANNEL);
            if ( ASPECT == "FLAW" )      llTextBox(touchedby,"What is this Flaw's DESCRIPTION?",CHANNEL);
            if ( ASPECT == "CAMPAIGN" )  llTextBox(touchedby,"What is this Campaign's SFXPOOL?",CHANNEL);
            if ( ASPECT == "SPECIE" )    llTextBox(touchedby,"What is this Species' FLAWLIST (CSV)?", CHANNEL);
            if ( ASPECT == "BACKGROUND") llTextBox(touchedby,"What is this Background's FLAWLIST (CSV)?",CHANNEL);
            if ( ASPECT == "CAREER" )    llTextBox(touchedby,"What is this Career's FLAWLIST (CSV)?",CHANNEL);
            if ( ASPECT == "ITEM")       llTextBox(touchedby,"What is this Item's RPCOST?",CHANNEL);
            return;
        }
        if ( name == "BUTTON6" ) {
            if ( ASPECT == "STATISTIC" ) llTextBox(touchedby,"Type in a brief SUMMARY of this new Statistic:",CHANNEL);
            if ( ASPECT == "SKILL" )     llTextBox(touchedby,"Type in a brief SUMMARY of this new Skill:",CHANNEL);
            if ( ASPECT == "CAMPAIGN" )  llTextBox(touchedby,"What is this Campaign's HEALTHPOOL?",CHANNEL);
            if ( ASPECT == "SPECIE" )    llTextBox(touchedby,"What is this Species' SFXLIST (CSV)?", CHANNEL);
            if ( ASPECT == "BACKGROUND") llTextBox(touchedby,"What is this Background's SFXLIST (CSV)?",CHANNEL);
            if ( ASPECT == "CAREER" )    llTextBox(touchedby,"What is this Career's SFXLIST (CSV)?",CHANNEL);
            if ( ASPECT == "ITEM")       llDialog(touchedby,"What is this Item's PERIOD?",["ARCHAIC","MODERN","FUTURISTIC"],CHANNEL);
            return;
        }
        if ( name == "BUTTON7" ) {
            if ( ASPECT == "STATISTIC" ) llTextBox(touchedby,"Type in a long DESCRIPTION of this new Statistic:",CHANNEL);
            if ( ASPECT == "SKILL" )     llTextBox(touchedby,"Which GENRES does this skill belong to?\nGENERAL, MEDIEVAL, MODERN, FUTURISTIC, FANTASY, SCIENCE-FICTION, or HORROR\n(CSV List)",CHANNEL);
            if ( ASPECT == "CAMPAIGN" )  llTextBox(touchedby,"What is this Campaign's GPPOOL?",CHANNEL);
            if ( ASPECT == "SPECIE" )    llTextBox(touchedby,"What is this Species' SKILLLIST (CSV)?", CHANNEL);
            if ( ASPECT == "BACKGROUND") llTextBox(touchedby,"What is this Background's SKILLLIST (CSV)?",CHANNEL);
            if ( ASPECT == "CAREER" )    llTextBox(touchedby,"What is this Career's SKILLLIST (CSV)",CHANNEL);
            if ( ASPECT == "ITEM")       llTextBox(touchedby,"What is this Item's BONUS?",CHANNEL);
            return;
        }
        if ( name == "BUTTON8" ) {
            if ( ASPECT == "SKILL" )     llTextBox(touchedby,"Type in a long DESCRIPTION of this new Skill:",CHANNEL);
            if ( ASPECT == "CAMPAIGN" )  llTextBox(touchedby,"What is this Campaign's STATMAX?",CHANNEL);
            if ( ASPECT == "SPECIE" )    llTextBox(touchedby,"What is this Species' ITEMLIST (CSV)?", CHANNEL);
            if ( ASPECT == "BACKGROUND") llTextBox(touchedby,"What is this Background's ITEMLIST (CSV)?",CHANNEL);
            if ( ASPECT == "CAREER" )    llTextBox(touchedby,"What is this Career's ITEMLIST (CSV)?",CHANNEL);
            if ( ASPECT == "ITEM")       llTextBox(touchedby,"What is this Item's RATING?",CHANNEL);
            return;
        }
        if ( name == "BUTTON9" ) {
            if ( ASPECT == "CAMPAIGN" )  llTextBox(touchedby,"What is this Campaign's SKILLMAX?",CHANNEL);
            if ( ASPECT == "SPECIE" )    llTextBox(touchedby,"What is this Species' DESCRIPTION?", CHANNEL);
            if ( ASPECT == "BACKGROUND") llTextBox(touchedby,"What is this Background's DESCRIPTION?",CHANNEL);
            if ( ASPECT == "CAREER" )    llTextBox(touchedby,"What is this Career's DESCRIPTION?",CHANNEL);
            if ( ASPECT == "ITEM")       llTextBox(touchedby,"What is this Item's ACTIVATION?",CHANNEL);
            return;
        }
        if ( name == "BUTTON10" ) {
            if ( ASPECT == "CAMPAIGN" )  llTextBox(touchedby,"What is this Campaign's RESOURCES?",CHANNEL);
            if ( ASPECT == "ITEM")       llTextBox(touchedby,"What is this Item's ACTIONLIST (CSV)?",CHANNEL);
            return;
        }
        if ( name == "BUTTON11" ) {
            if ( ASPECT == "ITEM")       llTextBox(touchedby,"What is this Item's DESCRIPTION?",CHANNEL);
            return;
        }
    }
}