ronXt Posted May 26, 2020 Share Posted May 26, 2020 I am not getting access to nested llDialog buttons. Do I have to use different listen channel for nested llDialog menus? Or should I use a different state to handle all the sub menus from all buttons? Or there is more efficient way to do so? Link to comment Share on other sites More sharing options...
Nova Convair Posted May 26, 2020 Share Posted May 26, 2020 The channel is irrelevant. Just handle mainmenu and submenu answers in the same listen if .. then .. else chain. If that's not possible because for example all submenus are equal then you set a global variable whenever you open a menu: menulevel = 1; llDialog(...); and in the listen event: if (menulevel==1) { if (...) else if (...) ... } else if (menulevel==2) { ... } and so on 2 1 Link to comment Share on other sites More sharing options...
Innula Zenovka Posted May 26, 2020 Share Posted May 26, 2020 12 hours ago, ronXt said: I am not getting access to nested llDialog buttons. Do I have to use different listen channel for nested llDialog menus? Or should I use a different state to handle all the sub menus from all buttons? Or there is more efficient way to do so? I would use this kind of logic integer iDialogChannel; integer iHandle; key kToucher; list lMainMenu =[ "SubMenu 1","SubMenu 2" ]; list lSecondMenu; list lSubMenu1=[ "Tea","Coffee","Orange" ]; list lSubMenu2=[ "Egg","Beans","Bacon" ]; string strCaption= "Please choose an option"; list lOrderButtons(list buttons) { return llList2List(buttons, -3, -1) + llList2List(buttons, -6, -4) + llList2List(buttons, -9, -7) + llList2List(buttons, -12, -10); } default { state_entry() { iDialogChannel = (integer)llGetSubString((string)llGetUnixTime(),-6,-1); } touch_start(integer total_number) { llListenRemove(iHandle); kToucher= llDetectedKey(0); iHandle = llListen(iDialogChannel,"",kToucher,""); llDialog(kToucher,strCaption, lOrderButtons(lMainMenu),iDialogChannel); } listen(integer channel, string name, key id, string message) { llListenRemove(iHandle); if(~llListFindList(lMainMenu,[message])){//message from the main menu if("SubMenu 1"==message){ lSecondMenu= ["Back"]+ lSubMenu1; } else if("SubMenu 2"==message){ lSecondMenu= ["Back"]+ lSubMenu2; } iHandle = llListen(iDialogChannel,"",kToucher,""); llDialog(kToucher,strCaption, lOrderButtons(lSecondMenu),iDialogChannel); } else if (~llListFindList(lSecondMenu,[message])){ if(~llListFindList(lSubMenu1+lSubMenu2,[message])){ llRegionSayTo(kToucher,0,"You chose "+message); } else if("Back"== message){ iHandle = llListen(iDialogChannel,"",kToucher,""); llDialog(kToucher,strCaption, lOrderButtons(lMainMenu),iDialogChannel); } } } } 2 Link to comment Share on other sites More sharing options...
Susie Chaffe Posted May 27, 2020 Share Posted May 27, 2020 llGetUnixTime for dialog channel - I am stealing that idea 🤩 1 1 Link to comment Share on other sites More sharing options...
ronXt Posted May 28, 2020 Author Share Posted May 28, 2020 Thank you guys I made it easily after merging both of your codes and andding my twists. And I found this(LSL Editor) magical debugger tool that helped me analysing further errors and fix them, highly recommends to all scripters 🤩😄 https://sourceforge.net/projects/lsleditor/ 2 Link to comment Share on other sites More sharing options...
Innula Zenovka Posted May 29, 2020 Share Posted May 29, 2020 18 hours ago, ronXt said: Thank you guys I made it easily after merging both of your codes and andding my twists. And I found this(LSL Editor) magical debugger tool that helped me analysing further errors and fix them, highly recommends to all scripters 🤩😄 https://sourceforge.net/projects/lsleditor/ Great! You might want to take a look at Sublime Text, too, which has a great LSL add-on that allows you to compile the scripts in the editor to check them, too. https://github.com/buildersbrewery/sublime-lsl You need to follow the installation instructions carefully, but it's worth the time, I think. 1 1 Link to comment Share on other sites More sharing options...
KT Kingsley Posted May 29, 2020 Share Posted May 29, 2020 According to the requirements on the Builder's Brewery GitHub page you link to, Sublime Text build 4073 or greater is required, but the link there takes me to build 3211, with no 4073 in sight. And 3211 doesn't seem fit with the installations instructions suggesting using "Install Package Control..." from the Tools menu: that option isn't there. Any ideas as to where I might find a build 4073 or greater? Or where I'm going wrong? 2 hours ago, Innula Zenovka said: Great! You might want to take a look at Sublime Text, too, which has a great LSL add-on that allows you to compile the scripts in the editor to check them, too. https://github.com/buildersbrewery/sublime-lsl You need to follow the installation instructions carefully, but it's worth the time, I think. . Link to comment Share on other sites More sharing options...
Innula Zenovka Posted May 29, 2020 Share Posted May 29, 2020 1 hour ago, KT Kingsley said: According to the requirements on the Builder's Brewery GitHub page you link to, Sublime Text build 4073 or greater is required, but the link there takes me to build 3211, with no 4073 in sight. And 3211 doesn't seem fit with the installations instructions suggesting using "Install Package Control..." from the Tools menu: that option isn't there. Any ideas as to where I might find a build 4073 or greater? Or where I'm going wrong? . No idea -- you'd have to ask Builders Brewery about that. You're right, of course, 3211 is the current build (and I can confirm that it works perfectly well with that LSL package, which updates automatically once you've installed it). As I say, you'd have to ask whoever maintains the instructions there, but perhaps they may refer to Sublime Text 2.n build 4073 or something like that. Just follow the instructions there about what packages to add, and in what order, and you should be fine. I mentioned it only because I know a friend of mine always has difficulty setting it up on a new machine, while I find it really intuitive. 1 Link to comment Share on other sites More sharing options...
KT Kingsley Posted May 29, 2020 Share Posted May 29, 2020 Thanks, Innula. Can you, or anyone else, remember where the =BB= LSL .sublime-package file can be found? Link to comment Share on other sites More sharing options...
Innula Zenovka Posted May 29, 2020 Share Posted May 29, 2020 (edited) 5 minutes ago, KT Kingsley said: Thanks, Innula. Can you, or anyone else, remember where the =BB= LSL .sublime-package file can be found? https://github.com/buildersbrewery/sublime-lsl But you should be able to install it automatically from the Sublime Text Package Control menu. From the instructions there: open Sublime Text open the command palette via Tools > Command Palette select Package Control: Install Package select =BB= LSL Edited May 29, 2020 by Innula Zenovka 1 Link to comment Share on other sites More sharing options...
KT Kingsley Posted May 29, 2020 Share Posted May 29, 2020 (edited) 2 hours ago, Innula Zenovka said: https://github.com/buildersbrewery/sublime-lsl But you should be able to install it automatically from the Sublime Text Package Control menu. From the instructions there: open Sublime Text open the command palette via Tools > Command Palette select Package Control: Install Package select =BB= LSL Thanks again, Innula. I've followed those instructions, but nowhere in the list can I see "=BB= LSL". I think I'd better start a thread specific to this. Edit: resolved. See this thread: Edited May 29, 2020 by KT Kingsley 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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