Kaidesa Renfort
Registered User
Join date: 2 Nov 2009
Posts: 2
|
11-09-2009 23:14
Okay, hopefully someone can help me out here as I'm fairly new to scripting with LSL. I'm currently working on creating a HUD object for myself to use, and I want it to have a menu-driven system. As it stands, I currently have the very basic part set up. It shows an initial dialog upon touching the object the script contains, like so:
state_entry() { llDialog(llDetectedKey(0), "Please choose an option below.", ["Button 1", "Button 2"], channel);
listenid = llListen(channel, "", llDetectedKey(0), ""); } listen(integer chan, string name, key id, string mes) { llListenRemove(listenid); }
I tried having "mes" in a switch statement which called another "llDialog" depending upon which button was pressed, but it seems that the second call to "llDialog" is just ignored. How can I properly set this up to bring another dialog up after the first selection has been made? Any help would be GREATLY appreciated. Thanks! ^_^
|
Kaidesa Renfort
Registered User
Join date: 2 Nov 2009
Posts: 2
|
11-09-2009 23:29
Nevermind...
Seems I was being stupid and tried using llDetectedKey(0) in the second request, and it wasn't getting passed properly for whatever reason. Just replaced it with llGetOwner() and it's working fine.
I guess llDetectedKey(0) only works inside of handlers like state_entry, etc? Man, LSL confuses me sometimes...
|
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
|
11-09-2009 23:49
...check out the key id in the listen event though.
That's the agent the listen had detected.
|
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
|
11-10-2009 02:49
From: Kaidesa Renfort I guess llDetectedKey(0) only works inside of handlers like state_entry, etc? Man, LSL confuses me sometimes... Do some reading: http://www.lslwiki.net/lslwiki/wakka.php?wakka=detected
_____________________
From Studio Dora
|