Jump to content

Just weird! Or not?


XbabylonX
 Share

You are about to reply to a thread that has been inactive for 2626 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

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 1

dialogChannel=-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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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. 

Link to comment
Share on other sites

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. 

Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 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.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2626 days.

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
 Share

×
×
  • Create New...