Jump to content

Specific menu script


pizzabagel22
 Share

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

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

Recommended Posts

Hello anyone reading this. I've played Second Life for some time now, but stil don't know much about scripting. I've been looking every where for a menu script that when you click on one of the options on the menu, it brings up a second menu with more options to choose from, and those options would display images/textures and be like a slideshow. I'm not expecting there to be a simple one to modify, but would appretiate it if someone knew of a simple script that does this.

Thank you!

Link to comment
Share on other sites

I finally broke down and using the wiki figured out how to script one myself.  They are not  'simple' or one size fits all.    Here is the wiki article about menu scripts.  You need to read and understand this information before even attempting to modify one.  At the bottom are links to some sample menu / submenu scripts but as the listing warns, they have many advanced features and aren't for a beginner scripter.

Link to comment
Share on other sites

If you want a script making, then you should be asking in the Wanted forum rather than here.  

But if you want to learn how to make one, this is the right place.   Hierarchical menus aren't difficult, particularly.   Menu options are in lists, so it's just a matter, when the user chooses something, of checking which list the choice comes from and acting accordingly.  Life can get complicated if the same item appears on two lists -- there are workrounds but it's simplest to avoid that if you can.

Here's a somewhat schematic illustration of how I might do it:

integer chan;integer handle;key toucher="";list CurrentMenu;list FirstMenu = ["Food", "Drink"];list FoodMenu = ["Meat", "Fruit"];list DrinkMenu = ["Soft Drinks", "Alcoholic Drinks"];list meat = ["Beef","Lamb","Chicken"];list fruit = ["Apple","Orange","Pear"];list soft = ["Coke","Pepsi","Irn Bru"];list alcoholic =["Scotch", "Brandy", "Gin"];default{    state_entry()    {        chan = (1000 + (integer)llFrand(1000000.0))*-1;//generate a random and negative number    }    touch_start(integer total_number)    {        key k = llDetectedKey(0);        if(toucher==""||k==toucher){//if there's not an active user, or if it's the active user touching me            toucher =k ; // get the uuid of whoever touched me            llListenRemove(handle);// there shouldn't be any stray listeners but kill any that are lurking            handle = llListen(chan,"",toucher,"");//listen only to the toucher            CurrentMenu = FirstMenu;            llDialog(toucher,"Please choose something",    CurrentMenu+["Finished"],chan); // present menu with first two options            llSetTimerEvent(30.0);        }        else{            llRegionSayTo(k,0,"Sorry, but this device is in use at the moment");            return;        }    }    listen(integer channel, string name, key id, string message)    {        if("Finished"==message){//shut down            llListenRemove(handle);            llSetTimerEvent(0.0);            toucher ="";            return;        }        llSetTimerEvent(30.0);        if ("Main Menu"==message){            CurrentMenu = FirstMenu;            llDialog(toucher,"Please choose something",    CurrentMenu+["Finished"],chan); // present menu with first two options        }        else if (~llListFindList(FirstMenu+FoodMenu+DrinkMenu,[message])){            // if it's one of the first  or second level menus            if("Food"==message){                CurrentMenu=FoodMenu;            }            else if ("Drink"==message){                CurrentMenu=DrinkMenu;            }            else if ("Meat"==message){                CurrentMenu = meat;            }            else if ("Fruit"==message){                CurrentMenu = fruit;            }            else if ("Soft Drinks"==message){                CurrentMenu = soft;            }            else if ("Alcoholic Drinks"==message){                CurrentMenu = alcoholic;            }            llDialog(toucher,"Please choose something",    CurrentMenu+["Main Menu", "Finished"],chan); // present appropriate sub menu or sub-sub menu        }        else{// from one of the sub-sub menus            if (~llListFindList(meat,[message])){                llRegionSayTo(toucher,0,"You chose an item from the meat menu, "+message);            }            else if (~llListFindList(fruit,[message])){                llRegionSayTo(toucher,0,"You chose an item from the fruit menu, "+message);            }            else if (~llListFindList(soft,[message])){                llRegionSayTo(toucher,0,"You chose an item from the soft drinks menu, "+message);            }            else if (~llListFindList(alcoholic,[message])){                llRegionSayTo(toucher,0,"You chose an item from the alcoholic drinks menu, "+message);            }            llDialog(toucher,"Please choose something",    CurrentMenu+["Main Menu", "Finished"],chan); // present appropriate sub menu or sub-sub menu        }    }    timer()    {        llSetTimerEvent(0.0);        llListenRemove(handle);        toucher ="";    }}

 

Link to comment
Share on other sites

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

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...