|
Boq Beauchamp
Registered User
Join date: 3 Oct 2006
Posts: 59
|
11-24-2006 10:51
I am working on a new casino game but am having one major issue. The problem is that llListen does not seem to be getting the messages that llDialog is sending. I have the channel set up as integer Channel = 7; and then have the entry money(key id, integer amount) { llDialog((id, "Message to player.", Choices, Channel); }
listen(integer channel, string name, key id, string message) { llSay (0, message); //attempting to see if it is getting the message if(message=="Message") { //THE ACTION } }
These are obviously abbreviated to show the skeleton. There is more "meat" but otherwise this is how the whole thing is formatted. Is something wrong there?
|
|
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
|
11-24-2006 10:58
'integer Channel' is not the same as 'integer channel'  Variables are case sensitive.
|
|
Tiarnalalon Sismondi
Registered User
Join date: 1 Jun 2006
Posts: 402
|
11-24-2006 11:42
Pale, I'm not seeing where you're referring to...he has the integer called at the top as "Channel" and in the dialog as "Channel". If you're referring to the "listen(integer channel...." this should not contain the defined integer from before as it's just stating the variable name for the incoming channel it received chat on, not the one it's designated to listen to.
Unfortunately, Boq, I'm not sure that this can be easily resolved without more of the 'meat' as you put it since we cannot see what the values of the list "Choices" contains. Also, we cannot see where you defined the llListen
|
|
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
|
11-24-2006 12:28
Ignore me... I lost the wood in the trees for a moment. You are correct, there's nothing wrong with the variable naming. I think your line of enquiry is right though... we need to see the llListen. Although I think the llSay should repeat the 'Choices' value regardless.
|
|
Tiarnalalon Sismondi
Registered User
Join date: 1 Jun 2006
Posts: 402
|
11-25-2006 00:35
It should...assuming that the listen was called correctly and in the appropriate event...which is where my suspicion is leading. Like if the listen is in the on rez event, while that's fine, it's not going to be called untill he takes it into inventory and rezzes it again. I tend to define an llListenControl so I can easily turn it on and off. integer Channel = 7; list Choices = ["Blah"]; default { state_entry() { MENU_LISTEN = llListen(Channel,"",NULL_KEY,""); //this is where the listen is defined llListenControl(MENU_LISTEN,FALSE); //we turn off the listen at the start just in case :) } touch_start(integer touches) { llListenControl(MENU_LISTEN,TRUE); key menu = llDetectedKey(0); llDialog(menu,"Weeee",Choices,Channel); } listen(integer chan, string nme, key id, string msg) { llSay(0,msg); if (msg == "Blah"); { llListenControl(MENU_LISTEN,FALSE); //turn off the listen unless we have other menus to do //this is where we do the cool stuff } } } Which is a very basic example of a menu and listen...it's also nice and sim-friendly to add a timer here as well that will turn the listen off after so long if they don't make a menu choice.
|