Jump to content

Looking for help on linked message


Ikonn Giano
 Share

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

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

Recommended Posts

I am trying to create a script to list for a message on a
channel and then forward the message to a linked prim.

This is my first project so I am trying to learn as I go. One of
my questions is I’m not sure if I need to use "link_message" like I did here.

 

default
{
    state_entry()
    {
        llListen( -123, "", NULL_KEY, "" ); 
    }
    listen( integer channel, string name, key id, string message )
    {
          llMessageLinked(LINK_SET, 0, "",NULL_KEY);
    }
 
    link_message(integer sender_num, integer num, string msg, key id) 
    {
        llOwnerSay(msg);// added this to test was hoping to see the message
         }    
}

 

Link to comment
Share on other sites

Using LINK_SET in your llMessageLinked() function means the message will be sent to every script in every prim - including the current one so, yes, your link_message() event-handler is fine.

The problem is you're not actually passing-on the message that your listen() event-handler received - you have hard-coded a blank string ("") there instead of 'message':

llMessageLinked(LINK_SET, 0, message, NULL_KEY);

Link to comment
Share on other sites

Ok the owner say is working but it is not passing the message to the linked prim.

default{    state_entry()    {        llListen( 123, "", NULL_KEY, "" );     }    listen( integer channel, string name, key id, string message )    {         llMessageLinked(LINK_SET, 0, message, NULL_KEY);    }     link_message(integer sender_num, integer num, string msg, key id)     {    llSay(0,msg);             }    }

 

Link to comment
Share on other sites

You need two scripts: One in the root prim that has no link_message event and one in the child prim that has no listen event.   As it is, if you put this script in both prims, they will BOTH hear the chat message on channel 123 and will send it to the entire linkset (that is, to both prims). 

Link to comment
Share on other sites

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...