|
Thili Playfair
Registered User
Join date: 18 Aug 2004
Posts: 2,417
|
06-11-2006 20:51
okie so trying to make this script open a menu if it recives a llMessageLinked from another one, it gets the message but dont really pop up anything, is it possible i dont know n.n default { state_entry() { llListen(Channel, "objectyeller", NULL_KEY, ""); // listen for dialog answers (from multiple users } link_message(integer sender_num, integer num, string str, key id) { if (str == "arow") { llSay (0,"recived"); //this one it gets then blah llDialog(llDetectedKey(0), "What do you want to do?", MENU_MAIN, Channel); } } listen(integer channel, string name, key id, string message) { if(Channel == Channel) { if(message == "stuff") //more stuff
|
|
Joannah Cramer
Registered User
Join date: 12 Apr 2006
Posts: 1,539
|
06-11-2006 21:05
From: Thili Playfair link_message(integer sender_num, integer num, string str, key id) {
llDialog(llDetectedKey(0), "What do you want to do?", MENU_MAIN, Channel); }
The llDetected... functions only return sensible values during events that actually detect something or someone interacting with object. So llDetectedKey() in link_message returns gibberish, pretty much which is why you don't see any dialog. If you want your dialog to be triggered through linked message, the script that displays dialog needs to somehow know who should receive it. You can probably pass the key of receiver in your link message, in the id field... or use any other means that happen to apply for your script ^^;;
|
|
Artemis Cain
Take it or Leave it
Join date: 11 Apr 2005
Posts: 116
|
06-12-2006 06:28
I have been working a TON with passing strings between linked objects... it is pretty simple now that I have finished pounding my head against a wall to do it. the first thing that you want to do is get the users key and pass that to the object getting the message. That way, you can have the dialog box go to the right person. key user; default { state_entry() { llListen(Channel, "objectyeller", NULL_KEY, ""); // listen for dialog answers (from multiple users } link_message(integer sender_num, integer num, string str, key id) { if (str == "arow") { user = id; llSay (0,"recived"); //this one it gets then blah llDialog(user, "What do you want to do?", MENU_MAIN, Channel); } } listen(integer channel, string name, key id, string message) { if(Channel == Channel) { if(message == "stuff") //more stuff
that should take care of the dialog box. you also need to have the key sent to this prim All you have to do is make sure that llDetectedKey(0) is in the id field of your llMessageLinked() tag on the prim that is sending the message hope this helps!
|
|
Adriana Caligari
Registered User
Join date: 21 Apr 2005
Posts: 458
|
06-12-2006 07:50
You might want to put a handle on those listens : eg
integer lkey ;
lkey = llListen ( w,x,y,z );
then later when you have processed that channel..
llListenRemove( lkey ) ;
Else if you keep returning different channels the listens are just gonna stack up and eat resource.
|
|
nand Nerd
Flexi Fanatic
Join date: 4 Oct 2005
Posts: 427
|
06-12-2006 08:57
Just a note, the line: llListen(Channel, "objectyeller", NULL_KEY, ""); // listen for dialog answers (from multiple users Will listen only to objects (or by some strange twist of fate an Avatar) named "objectyeller" and therefore will not process replies from the llDialog.
|