llDialog help
|
|
Max Pitre
Registered User
Join date: 19 Jul 2006
Posts: 370
|
08-06-2007 13:12
Have a dialog script with an "if" and a "else if". Work great except I don't want the menu to go away until the ignore is clicked even after selecting one of the other buttons. The menu needs to either remain there while one of the "if"'s are being taken care of or pop back up once the "if" is done. Any ideas? Can it be done?
|
|
Atashi Toshihiko
Frequently Befuddled
Join date: 7 Dec 2006
Posts: 1,423
|
08-06-2007 13:14
When a menu button is clicked, the menu goes away and I don't think you can stop that from happening.
What you can do though is have the llDialog executed again, so after your script's listen event captures the menu button click, just have the llDialog function sent again. So for the user, they click a button, the menu vanishes then reappears, they click another button, the menu vanishes and reappears, etc.
-Atashi
_____________________
Visit Atashi's Art and Oddities Store and the Waikiti Motor Works at beautiful Waikiti.
|
|
Xylo Quisling
Registered User
Join date: 1 Feb 2007
Posts: 146
|
08-06-2007 13:53
Yes, that is what I have done too, in my dialog script, and it works fine.
|
|
Over Dawg
Registered User
Join date: 14 Oct 2007
Posts: 7
|
Just what I need
11-04-2007 13:59
Im trying to do just this.
could one of you post or PM me how you do it please. Im very new to SL scripting and all i get is the dang main menu pops up again before i have made a choice.
I have a main dialog that gives 6 options, each of these options then has a subdialog that offers further options. This part works smoothly. However when the suboption is selected the dialog disappears ( as im told it should)
What I want is a repeat call to the main dialogue After the suboption has been chosen.
any help would be most appreciated, however dont get too techy ..cos you will lose me fast.
|
|
ArchTx Edo
Mystic/Artist/Architect
Join date: 13 Feb 2005
Posts: 1,993
|
11-04-2007 15:04
You should post your script so we can see it and give specific recommendations.
_____________________
 VRchitecture Model Homes at http://slurl.com/secondlife/Shona/60/220/30 http://www.slexchange.com/modules.php?name=Marketplace&MerchantID=2240 http://shop.onrez.com/Archtx_Edo
|
|
Annabelle Babii
Unholier than thou
Join date: 2 Jun 2007
Posts: 1,797
|
11-04-2007 15:59
From: Over Dawg Im trying to do just this. What I want is a repeat call to the main dialogue After the suboption has been chosen. From: someone
put the new lldialog command as a subset of the selected function yes, you have to put that line of code in each one of the options, but that way you can have it direct to the appropriate subdialogue without having to go back to main menu each time.
|
|
Daisy Rimbaud
Registered User
Join date: 12 Oct 2006
Posts: 764
|
11-04-2007 16:38
As a corollary question, is there a way to MAKE the menu go away, or disable it, if someone holds the menu open without clicking on anything?
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
11-04-2007 17:10
Tried to think of an easy example to give. Hope this helps:
integer CHANNEL = 42; list MENU_MAIN = ["Hi", "Bye"];// main menu list MENU_OPTIONS = ["English", "Spanish", "Finished"]; // a submenu string message2;
default { state_entry() { llListen(CHANNEL, "", NULL_KEY, ""); }
touch_start(integer total_number) { llDialog(llDetectedKey(0), "What Do you want to say?", MENU_MAIN, CHANNEL); }
listen(integer channel, string name, key id, string message) { if (llListFindList(MENU_MAIN + MENU_OPTIONS, [message]) != -1) { llSay(0, name + " picked the option '" + message + "'."); if (message == "Hi" | message == "Bye") { llDialog(id, "Which Language!", MENU_OPTIONS, CHANNEL); message2 = message; } else if (message == "Finished") { } else { if(message2 == "Hi") { if(message == "English") { llSay(0, "Hello"); llDialog(llDetectedKey(0), "What Do you want to say?", MENU_MAIN, CHANNEL); } else { llSay(0, "Hola"); llDialog(llDetectedKey(0), "What Do you want to say?", MENU_MAIN, CHANNEL); } } else { if(message == "English") { llSay(0, "Goodbye"); llDialog(llDetectedKey(0), "What Do you want to say?", MENU_MAIN, CHANNEL); } else { llSay(0, "Hasta luego"); llDialog(llDetectedKey(0), "What Do you want to say?", MENU_MAIN, CHANNEL); }
} message2 = ""; } } } }
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime. From: someone I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
11-04-2007 17:12
From: Daisy Rimbaud As a corollary question, is there a way to MAKE the menu go away, or disable it, if someone holds the menu open without clicking on anything? Unfortunately not. I build in timers into mine so that they no longer will respond after a certain amount of time. But the blue pop up window will stay there until someone makes some choice.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime. From: someone I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
11-04-2007 23:06
From: Daisy Rimbaud As a corollary question, is there a way to MAKE the menu go away, or disable it, if someone holds the menu open without clicking on anything? the ignore button in the lower right is your only recourse... if the dialog keeps repopping (on a timer for example) either talk to the maker, or AR the person doing it (will be shown as owner at the top of the dialog) for harrassment
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
|
Daisy Rimbaud
Registered User
Join date: 12 Oct 2006
Posts: 764
|
11-05-2007 02:53
From: Void Singer the ignore button in the lower right is your only recourse... if the dialog keeps repopping (on a timer for example) either talk to the maker, or AR the person doing it (will be shown as owner at the top of the dialog) for harrassment Ah, the problem I have is different - given an object that several people can use, if one person holds the menu open, it interferes with someone else trying to use the same menu. However, I think I have a way round it now.
|
|
Over Dawg
Registered User
Join date: 14 Oct 2007
Posts: 7
|
11-05-2007 07:19
From: ArchTx Edo You should post your script so we can see it and give specific recommendations. sorry, i couldnt post the code i wrote..cos i got mad and deleted it... However, the example posted by Jesse is a smaller version of what i had. This was the point i got to and got totally stumped. If you run Jesse's script .. On touching the object a menu pops up with the 2 suboptions "Hi" and "Bye", when either of these is chosen a new dialog opens with the suboptions of "English" , "Spanish" and "Finish". All good so far... but then once the suboption has been chosen, the whole menu shuts off and requires touching the object again to get back into menu. what i was trying to do was... on the choosing of the suboption..lets say "english" the suboption closes and reverts to the main menu without the need for retouching the object. I tried putting a second call to lldialog at the end of the options, and this indeed reopened the main menu, however it did so before the suboption was chosen and the new main menu covered the suboption. I have since been told by a scripting friend of mine that doing this in SL script is a really complicated piece of scripting and to work smoothly will be very hard to do. Im really just a dabbler with scripts..and by no means a scripter in any sense of the word. so unless anyone knows of a way to actually make this work properly i guess its just another of my good ideas that is impossible but thankyou to all that have taken the time to offer suggestions
|
|
Over Dawg
Registered User
Join date: 14 Oct 2007
Posts: 7
|
11-05-2007 07:24
From: Annabelle Babii From: Over Dawg Im trying to do just this. What I want is a repeat call to the main dialogue After the suboption has been chosen. From: someone
put the new lldialog command as a subset of the selected function yes, you have to put that line of code in each one of the options, but that way you can have it direct to the appropriate subdialogue without having to go back to main menu each time.
I just saw this post Annabelle and im not sure what you mean exactly. would it be possible to show where you would put the new llDialog using Jesse's example? Im sorry to be a pain,
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
11-05-2007 15:40
From: Over Dawg sorry, i couldnt post the code i wrote..cos i got mad and deleted it...
However, the example posted by Jesse is a smaller version of what i had.
This was the point i got to and got totally stumped. If you run Jesse's script .. On touching the object a menu pops up with the 2 suboptions "Hi" and "Bye", when either of these is chosen a new dialog opens with the suboptions of "English" , "Spanish" and "Finish".
All good so far... but then once the suboption has been chosen, the whole menu shuts off and requires touching the object again to get back into menu.
Actually it doesn't. If you try it in world then you will find that after you choose the language, it says the phrase and then the main menu pops up again. It does that because I put this into each of the if's: llDialog(llDetectedKey(0), "What Do you want to say?", MENU_MAIN, CHANNEL); Where ever you put that in the code it is telling it to display the blue menu. If instead I would have wanted it to call up the language menu, I would have used this expression instead: llDialog(id, "Which Language!", MENU_OPTIONS, CHANNEL); Please never apologise for asking questions. We are more then thrilled seeing new people here learning. Plus it gives us old farts something to do.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime. From: someone I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
|
|
Over Dawg
Registered User
Join date: 14 Oct 2007
Posts: 7
|
11-05-2007 21:35
From: Jesse Barnett Actually it doesn't. If you try it in world then you will find that after you choose the language, it says the phrase and then the main menu pops up again.
It does that because I put this into each of the if's:
llDialog(llDetectedKey(0), "What Do you want to say?", MENU_MAIN, CHANNEL);
Where ever you put that in the code it is telling it to display the blue menu.
If instead I would have wanted it to call up the language menu, I would have used this expression instead:
llDialog(id, "Which Language!", MENU_OPTIONS, CHANNEL);
Please never apologise for asking questions. We are more then thrilled seeing new people here learning. Plus it gives us old farts something to do. Thanks for the encouragement. but im sad to say that i did try your example in world before i posted and the results were the same as I got with my own script. which were..after the call to the submenu it closed completely on more occasions than it stayed open (or was recalled) and if it did stay open and you chose the same option as the first time, it displayed the second answer, not the answer it should have chosen to display. to make sure you can understand my gibberish... First touch of object displays MENU_MAIN choose HI submenu appears choose English result = Hello displayed in chat (now assuming that the main was displayed again, which didnt happen most of the time) Choose Hi Choose English Result = Goodbye displayed in chat. This is the problem i had with my own script. I then reordered the commands and put 1 single recall to MAIN_MENU at the end of the else..If cluster. This had the effect of bringing the main menu back every time, but..it did it before you had time to select an option on the submenu and the main blue Diaslog covered the sub menu. As i stated in previous post, Im no scripter but i have a basic understanding of C++ which seems to be about the same syntax wise. and I would never say your script didnt work without trying it out. Im not that dumb. LOL Again many thanks for even trying to help, its appreciated
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
11-06-2007 01:00
From: Daisy Rimbaud Ah, the problem I have is different - given an object that several people can use, if one person holds the menu open, it interferes with someone else trying to use the same menu. However, I think I have a way round it now. Oh you mean the script has some sort of flag that is set when A user trips the dialog, and checked on each touch etc... and only unset when that use ansers the dialog.... timers are your friend, I build 30 delay timers into most dialogs, 30 secs from the last click it closes all listens by flipping to another state and back... your example probably uses listen handles, in which case you don't have to flip states, just close the active listen, and trip the flag back
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
11-06-2007 03:53
From: Over Dawg Thanks for the encouragement.
but im sad to say that i did try your example in world before i posted and the results were the same as I got with my own script.
which were..after the call to the submenu it closed completely on more occasions than it stayed open (or was recalled) and if it did stay open and you chose the same option as the first time, it displayed the second answer, not the answer it should have chosen to display.
to make sure you can understand my gibberish...
First touch of object displays MENU_MAIN choose HI submenu appears choose English
result = Hello displayed in chat
(now assuming that the main was displayed again, which didnt happen most of the time)
Choose Hi Choose English
Result = Goodbye displayed in chat.
This is the problem i had with my own script. I then reordered the commands and put 1 single recall to MAIN_MENU at the end of the else..If cluster. This had the effect of bringing the main menu back every time, but..it did it before you had time to select an option on the submenu and the main blue Diaslog covered the sub menu.
As i stated in previous post, Im no scripter but i have a basic understanding of C++ which seems to be about the same syntax wise.
and I would never say your script didnt work without trying it out. Im not that dumb. LOL
Again many thanks for even trying to help, its appreciated OMG this was driving me absolutely nuts. Yes you are correct Over Dawg and don't worry you were not hallucinating. In the touch event I used: llDialog(llDetectedKey(0) Unfortunately I copied and pasted to same to the if tests. There llDetectedKey(0) (which it recieved in the touch) meant nothing and it was being simply ignored. If you redo the code and use llDialog(id (which it got in the listen event) instead there then it will work correctly. integer CHANNEL = 42; list MENU_MAIN = ["Hi", "Bye"];// main menu list MENU_OPTIONS = ["English", "Spanish", "Finished"]; // a submenu string message2;
default { state_entry() { llListen(CHANNEL, "", NULL_KEY, ""); }
touch_start(integer total_number) { llDialog(llDetectedKey(0), "What Do you want to say?", MENU_MAIN, CHANNEL); }
listen(integer channel, string name, key id, string message) { if (llListFindList(MENU_MAIN + MENU_OPTIONS, [message]) != -1) { llSay(0, name + " picked the option '" + message + "'."); if (message == "Hi" | message == "Bye") { llDialog(id, "Which Language!", MENU_OPTIONS, CHANNEL); message2 = message; } else if (message == "Finished") { } else { if(message2 == "Hi") { if(message == "English") { llSay(0, "Hello"); llDialog(id, "What Do you want to say?", MENU_MAIN, CHANNEL); } else { llSay(0, "Hola"); llDialog(id, "What Do you want to say?", MENU_MAIN, CHANNEL); } } else { if(message == "English") { llSay(0, "Goodbye"); llDialog(id, "What Do you want to say?", MENU_MAIN, CHANNEL); } else { llSay(0, "Hasta luego"); llDialog(id, "What Do you want to say?", MENU_MAIN, CHANNEL); }
} message2 = ""; } } } }
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime. From: someone I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
|
|
Over Dawg
Registered User
Join date: 14 Oct 2007
Posts: 7
|
11-06-2007 07:12
SUPERB !!!!!!!!
I had tried every combination of the recall i could think of and ended up pulling my hair out.
Now..it works, all i have to do is rewrite the script i had....lol
and thank you very much Jesse you have made an old man very happy. :-]
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
11-06-2007 09:49
From: Over Dawg SUPERB !!!!!!!! and thank you very much Jesse you have made an old man very happy. :-] 50 years old, tired, gray haired, female scripter here Keep coming back and we will see if we can teach the young ones a thing or two 
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime. From: someone I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
|
|
Trevor Langdon
Second Life Resident
Join date: 20 Oct 2004
Posts: 149
|
11-06-2007 14:40
Jesse-- I see one other logic error in your script. You are using a Bitwise OR instead of a Comparison OR in the following IF statement: if (message == "Hi" | message == "Bye"  should be changed to: if (message == "Hi" || message == "Bye" 
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
11-06-2007 15:06
From: Trevor Langdon Jesse-- I see one other logic error in your script. You are using a Bitwise OR instead of a Comparison OR in the following IF statement: if (message == "Hi" | message == "Bye"  should be changed to: if (message == "Hi" || message == "Bye"  Yeah I always forget that one. Thankfully the scripting engine isn't smart enough to catch it and it will still work either way. There are also some ways you could clean it up some Over Dawg. Well actually declaring user_id will make it a little more efficient. Declaring the global variable menu() does clean it up but probably makes it a tiny bit less efficient, not enough to matter though. It was posted as just an example anyways and give people something to play with. For example: integer CHANNEL = 42; list MENU_MAIN = ["Hi", "Bye"];// main menu list MENU_OPTIONS = ["English", "Spanish", "Finished"]; // a submenu string message2; key user_id; string say;
menu() { llSay(0, say); llDialog(user_id, "What Do you want to say?", MENU_MAIN, CHANNEL); }
default { state_entry() { llListen(CHANNEL, "", NULL_KEY, ""); }
touch_start(integer total_number) { llDialog(llDetectedKey(0), "What Do you want to say?", MENU_MAIN, CHANNEL); }
listen(integer channel, string name, key id, string message) { user_id = id; if (llListFindList(MENU_MAIN + MENU_OPTIONS, [message]) != -1) { llSay(0, name + " picked the option '" + message + "'."); if (message == "Hi" || message == "Bye") { llDialog(user_id, "Which Language?", MENU_OPTIONS, CHANNEL); message2 = message; } else if (message == "Finished") { } else { if(message2 == "Hi") { if(message == "English") { say = "Hello"; menu(); } else { say = "Hola"; menu(); } } else { if(message == "English") { say = "Goodbye"; menu(); } else { say = "Hasta luego"; menu(); }
} message2 = ""; } } } }
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime. From: someone I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
|