Jump to content
You are about to reply to a thread that has been inactive for 345 days.

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

Recommended Posts

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 post
Share on other sites

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
 

  • Like 2
  • Thanks 1
Link to post
Share on other sites
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);
            }
        }

    }
}

 

  • Like 2
Link to post
Share on other sites

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/

  • Like 2
Link to post
Share on other sites
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.

  • Like 1
  • Thanks 1
Link to post
Share on other sites

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 post
Share on other sites
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. 

  • Thanks 1
Link to post
Share on other sites
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 by Innula Zenovka
  • Thanks 1
Link to post
Share on other sites
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 by KT Kingsley
  • Like 1
Link to post
Share on other sites
You are about to reply to a thread that has been inactive for 345 days.

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...