XbabylonX Posted February 12, 2017 Posted February 12, 2017 Hello,how is possible to click a button on a dialog menu from script file 1 and this action trigers a link_message from script file 2?Script file 1dialogChannel=-1 - (integer)("0x" + llGetSubString( (string)llGetKey(), -7, -1) );listenHandle=llListen(dialogChannel, "", llGetOwner(), "");llDialog(llGetOwner(), "Click a button", ["YES","NO"], dialogChannel);Script file 2 link_message(integer sender_num, integer num, string msg, key id) { if(num==1) { 'THIS IS TRIGGERED!!!!!!!!!!!!!! } }:smileymad::smileyfrustrated::smileymad::smileyfrustrated::smileymad::smileyfrustrated::smileymad::smileyfrustrated: PS the listener in script file 1 does not get triggered.
Sari6t Posted February 13, 2017 Posted February 13, 2017 Your idea is along the right path. Go to this link and read and lear the first example. For one thing it works and two you can compare what you wrote to it and learn the syntax fo rnext time. http://wiki.secondlife.com/wiki/LlDialog 1
Innula Zenovka Posted February 14, 2017 Posted February 14, 2017 As it stands, your question is unanswerable. We need both scripts, not just a fragament from each one, and also we need to know whether the scripts are in the same prim, or different ones in the same linkset, and if there are any other scripts involved. Something, presumably, is sending a link message with 1 as its number parameter when it hears a message ("Yes"? "No"? either of them?) on the dialog channel, but with the information you've provided that's about all anyone can say.
XbabylonX Posted February 15, 2017 Author Posted February 15, 2017 "YES" from the dialog menu when clicked sends "YES" where this "YES" is not found anywhere else inside in any other script file.
Innula Zenovka Posted February 15, 2017 Posted February 15, 2017 Without both scripts it's just a guessing game trying to work out what's happening. You say "YES" from the dialog menu sends "YES" -- how does it send it, and to where? Something is clearly sending a link message with `1 as the number parameter when it hears "YES" from the dialog menu (or possibly another script mimics the behaviour you expect when your receiver script receives a link message with 1 as the parameter). On the basis of the avaiable information that's all anyone can say. If you want more help, you need to post the scripts. Otherwise I would suggest putting in lots of llOwnerSay messages whenever scripts send or receive communications, so you can tell what's actually happening rather than what you think is going to happen.
Arduenn Schwartzman Posted February 16, 2017 Posted February 16, 2017 Hi, you are using link_message in Script 2. You should use listen in Script 2 instead.
Rolig Loon Posted February 16, 2017 Posted February 16, 2017 I agree with Innula. With just these snippets to work with, we can't guess how you are sending messages or why they may not be getting where they are going. The link_message event in script 2 is clearly meant to get a message from something, but who knows what? If I were you, I'd start loading both scripts with diagnostic llOwnerSay statements and start keeping track of what happens to key variables.
Arduenn Schwartzman Posted February 16, 2017 Posted February 16, 2017 llDialog chats messages (the dialog words) on the given channel. Any other script within 20m of the script issuing the llDialog should be able to receive it. From the llDialog Wiki: In most cases, the listener will be in the same script as the llDialog, however if not, the distance between the root prim of the listening object and the dialog generating prim becomes a factor. If this distance is greater than 20 meters when a button is pressed, the response will not be heard.
Rolig Loon Posted February 16, 2017 Posted February 16, 2017 That's true, but if the two scripts are in the same link set, there's no need for the llDialog generated in one to be heard in the other. A link message does not require that you keep re-opening listen handlers each time that execution moves from one script state to another, so it's often a less troublesome way to send signals beteen scripts. As Innula says, though, we don't know anything about the structure of either script, so all we can do is guess about why the OP's having a problem with them. It may have nothing at all to do with communication. The best way to find out is to start from parts of the scripts that do work and follow what happens to significant variables as they are changed in the less certain parts.
Arduenn Schwartzman Posted February 16, 2017 Posted February 16, 2017 That's true, but if the two scripts are in the same link set, there's no need for the llDialog generated in one to be heard in the other. That's true too, unless there really is a need to use a second script. Then, making the second script listen is easier than make the first script listen and pass on the answer to the second scriptusing message linked. I'm just assuming here that they really need two.
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now