Jump to content
You are about to reply to a thread that has been inactive for 114 days.

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

Recommended Posts

Posted

Hi,

I cant use llRegionSay to trigger an event, what i've missed?

default
{
    state_entry()
    { 
        llListen(123, "","","");
    }
    touch_start(integer num)
    {
        llRegionSay(123, "test");
    }
    listen(integer channel, string name, key id, string message) 
    {
        llOwnerSay("msg="+message);
    }    
}

 

Posted

Or in other words, you need two different scripts in two different objects.

// script 1 in object 1:
default
{
    state_entry()
    {   llListen(123, "","","");
    }
    listen(integer channel, string name, key id, string message) 
    {   llOwnerSay("msg="+message);
    }    
}
// script 2 in object 2:
default
{   touch_start(integer num)
    {   llRegionSay(123, "test");
    }
}

if you really need a script talk to itself (or another script in the same object!) consider using llMessageLinked() or LinksetData

  • Like 2
Posted

You could also use a llDialog, since a script will listen to itself in that case. Really, it all depends on exactly why you want to trigger the listen. Don't make the script(s) any more complicated than necessary to do whatever you have in mind.

  • Like 2
Posted

I just put everything in a prim only for testing, but I want to have 2 prims that communicate

Thank you all for your quick help and I should read the wiki more carefully 🙂

  • Like 2
Posted
1 hour ago, Rolig Loon said:

llDialog, since a script will listen to itself in that case.

Maybe more an issue of semantics, but llDialog doesn't really create text on its own, it instructs the recipient's viewer to open an interface that (after user-interaction) will cause the recipient's avatar to say some predetermined text centered on the object that created the dialog.

  • Thanks 1
Posted (edited)
3 hours ago, Quistess Alpha said:

Maybe more an issue of semantics, but llDialog doesn't really create text on its own, it instructs the recipient's viewer to open an interface that (after user-interaction) will cause the recipient's avatar to say some predetermined text centered on the object that created the dialog.

Indeed, a matter of semantics. In the current context, I was going for the simplest possible description of what happens.

It wasn't clear what the OP had in mind, but it seemed that he was trying to do something just slightly more than "touch this object and make it do something". One possibility -- the one that you went to -- was that he wanted to send a message to a linked prim so that it could do something.  Another possibility was that he wanted to be able to select from a menu of messages for some action (rezzing objects, changing radio stations, recoloring an attachment ...) that the object he is touching is supposed to execute.  That's what llDialog or llTextBox is for. Without getting into how it works, I just wanted to be sure that option was on his radar. ;) 

Edited by Rolig Loon
Cleaner wording
Posted
25 minutes ago, Rolig Loon said:

That's what llDialog or llTextBox is for.

Isn't the response from llDialog exactly as if the user entered "/9 ThisButton", where "9" is the dialog channel selected and "ThisButton" was the button they pressed?

 

Posted
33 minutes ago, Love Zhaoying said:

Isn't the response from llDialog exactly as if the user entered "/9 ThisButton", where "9" is the dialog channel selected and "ThisButton" was the button they pressed?

Yes but for my italic note about the location of the response. It's rarely relevant, but llDialog effectively works over a longer distance than you can say or shout, and (last time I tested was a few years ago, so grain of salt, do your own testing if curious) for a few seconds after teleport can even message objects in the region you left.

 

  • Thanks 1
Posted
On 8/7/2024 at 10:21 PM, Quistess Alpha said:

llDialog effectively works over a longer distance than you can say or shout,

Some time ago I tried this and found it worked up to draw-distance, but as I usually have sensible DD it might actually work even across regions.

  • Like 1
You are about to reply to a thread that has been inactive for 114 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
×
×
  • Create New...