Ikonn Giano Posted June 14, 2011 Share Posted June 14, 2011 I am trying to create a script to list for a message on achannel and then forward the message to a linked prim. This is my first project so I am trying to learn as I go. One ofmy 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 More sharing options...
PeterCanessa Oh Posted June 14, 2011 Share Posted June 14, 2011 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 More sharing options...
Ikonn Giano Posted June 14, 2011 Author Share Posted June 14, 2011 Thank you PeterCanessa Oh. It is now working... Link to comment Share on other sites More sharing options...
Ikonn Giano Posted June 17, 2011 Author Share Posted June 17, 2011 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 More sharing options...
Rolig Loon Posted June 17, 2011 Share Posted June 17, 2011 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 More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now