Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

First time using llDiaog/Menu - what am I doing wrong?

Pauski Zenovka
Registered User
Join date: 14 Mar 2007
Posts: 43
08-23-2007 12:19
Hi

I'm trying to use a menu to call a menu to offer the user choices. The first menu displays OK when you touch the object. Selecting button "Four" should show another button but doesn't

What am I doing wrong?

Thanks in advance :)

//----code -------

integer menu_handler;
integer menu_channel;
menu(key user,string title,list buttons)
{
menu_channel = 999;
menu_handler = llListen(menu_channel,"","","";);
llDialog(user,title,buttons,menu_channel);
llSetTimerEvent(5.0);
}


default
{
state_entry()
{
llSay(0, "Hello, Avatar!";);
}

touch_start(integer total_number)
{
menu(llDetectedKey(0),"Test Object",["One", "Two", "Three", "Four"]);
}



listen(integer channel, string name, key id, string msg)
{
if (channel == menu_channel)
{
llWhisper(0,"Message Received: " + msg);
if (msg == "Four";)
{
menu(llDetectedKey(0),"Menu Two",["Five", "Six", "Seven"]);
}
}
}
}

//------End -----
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
08-23-2007 12:27
When the user clicks on a menu choice, the menu will say the choice on the channel you give to llDialog - you need to listen on the menu channel *before* calling llDialog.

I would think that this line gives you a compiler error because there's no channel specified.. No?

menu(llDetectedKey(0),"Test Object",["One", "Two", "Three", "Four"]);
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!!
- Go here: http://jira.secondlife.com/browse/SVC-1224
- If you see "if you were logged in.." on the left, click it and log in
- Click the "Vote for it" link on the left
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
08-23-2007 12:31
Nothing jumps out at me as wrong.

Do you see the whisper happening?
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!!
- Go here: http://jira.secondlife.com/browse/SVC-1224
- If you see "if you were logged in.." on the left, click it and log in
- Click the "Vote for it" link on the left
Zuleica Sartre
Registered User
Join date: 27 Sep 2005
Posts: 105
08-23-2007 12:36
I'd do two things...

1. If you're going to create a handle for a listen then remove the listen established by that handle before you create a new one. Use llListenRemove(handle) to remove the old one before starting a new one. You could put this llListenRemove(menu_handler) right before the second call to menu.

2. In menu(llDetectedKey(0),"Menu Two",["Five", "Six", "Seven"]); change llDetectedKey(0) to id. you want the key of the person that used the first menu and triggered the listen event, not the key of the person that clicked the object...I'm not sure the contents of the llDetected lists are reliable from event to event.
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
08-23-2007 12:37
From: Zuleica Sartre
2. In menu(llDetectedKey(0),"Menu Two",["Five", "Six", "Seven"]); change llDetectedKey(0) to id.

D'oh! Can't believe I missed that. Nice catch.
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!!
- Go here: http://jira.secondlife.com/browse/SVC-1224
- If you see "if you were logged in.." on the left, click it and log in
- Click the "Vote for it" link on the left
Pauski Zenovka
Registered User
Join date: 14 Mar 2007
Posts: 43
08-23-2007 13:43
Thank you so very much!!

the "id" did it!!

Now to the rest of the script.......... :)

Pauski