Don't click here unless you want to be banned.

LSL Wiki : llMessageLinked

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl801.us.archive.org
llMessageLinked(integer linknum, integer num, string str, key id)

Sends num, str, and id to linknum (the specific prim in the linked set).

The value for linknum can be the link number of the desired prim (use llGetLinkNumber to get the prim's link number containing the script) or one of the constants for linked sets.

Constants

Constant Value Description
LINK_ROOT 1 root prim in linked set (but not in a single prim, which is 0)
LINK_SET -1 all prims in object
LINK_ALL_OTHERS -2 all other prims in object besides prim function is in
LINK_ALL_CHILDREN -3 all child prims in object
LINK_THIS -4 prim script is in

In objects with only 1 prim, linknum is 0. In objects with multiple prims, the linknum count starts at 1. (So in a 2-prim object, llGetLinkNumber would return 1 in the parent and 2 in the child.

num can be any valid integer. str and id may be blank, ("") or as long as desired. str and id are only limited by the amount of available memory.

Notes:

llMessageLinked triggers the link_message event handler in scripts receiving link messages.

Example:
See ExampleLinkMessage.

Q: I don't get it. Why not just use chat?
A: Aside from the fact that an object can't listen to itself, link messages are much faster than using chat functions as well as being private. They're higher-capacity, avoiding chat's 255-character limitations. Also, if you tend to have memory overflow problems in a single script, you can use link messages to communicate between scripts in the same prim, thus enabling separate storage or even pseudo-multithreading.

Q: What is the length of the penalty on llSay, etc?
A: There is no delay on any of the llMessageLinked, llSay, llWhisper, or llShout functions. The "delay" is in the event queuing for the receiving event, which is affected by the sims performance at that given time. The speed ranges from llMessageLinked being the fastest as it's internal, to llShout being the slowest as it causes the most sim performance hit since it's external to all prims within a 100m range. -- SiRiSAsturias

Q: Can I use llMessageLinked to send a message within only one script?
A: Yes, though there are better ways to communicate within a single script. Note that your link_message event will trigger on all link messages the prim receives, so your script may end up talking to itself if you're not careful.

Q: Do I need to specify a value for num, str, and id, or can I use a null string or key?
A: No, you can give llMessageLinked empty values of 0, "" and NULL_KEY, respectively.

Q: Can I use link messages to communicate between two attachments, or an attachment and the object the avatar is sitting on?
A: No, they're not truly linked in this case. You'll need to use chat instead.


Functions | Communications | Link
Comments [Hide comments/form]
What is the distance limit of llMessageLinked between two linked communicating prims?
-- BluemanSteele (2005-10-12 19:28:12)
Same as the link distance. If the objects are linked, llMessageLinked works.
-- ChristopherOmega (2005-10-12 20:52:34)
Regarding the tet on llWhisper vs. Linked message, in testing in 10/2005 on the 1.7 preview grid, llMessageLinked is indeed faster than llWhisper (although not by 40%). Interestingly, llSay was shown to be significantly faster than either (I tested about 5 sets of 10,000 iterations of each). Of course, llMessageLinked still has greater throughput, even if it is slower.
-- AlondriaLeFay (2005-10-18 06:39:46)
A linked message has the advantage of being able to traverse any distance (link distance or hack limiting). Chat commands can't boast that.
-- BlindWanderer (2005-10-20 23:44:48)
Looks like sending too many of these too fast results in a Bounds Check Error. There probably exists a limit for how many pending ones an object can have. I managed to cause this error by doing llMessageLinked(LINK_ALL_OTHERS, ...) on a 74 prim object. After 2 or 3 consecutive calls like that, it dies.
-- DaleGlass (2006-05-14 19:09:24)
Has anyone had an issue with 2 of the same objects, that are not linked, and use Link Messages can affect the other? I have 2 Boards where someone clicks on a name on one Board, it then uses a Link Message to communicate back to remove that name by position. After awhile, the 2nd board, will start removing a name in the same position when only the one board has been clicked. Both boards are not linked, so why would it start doing this? I have had this happen twice to two different people.
-- NicolasDecatur (2006-12-28 09:58:21)
I would assume this is a bug in your code, because as far as I know, there is no such thing as quantum entanglement in SL. However, if you can replicate this behavior and manage to have link messages go between objects, please post your findings.
-- KeknehvPsaltery (2006-12-30 18:03:52)
are you sure they aren't using chat for comms as well?
-- BlindWanderer (2006-12-31 00:00:52)
I have confirmed that an attachment using link messages can cause avatars to "jitter" when an link_message event is received. This effects many HUDS that use these messages to communicate amongst the many prims of the HUD. All of my tests had a llSetText() associated with the link message, but llSetText() alone in an attachment will not cause the jitter.

Im assuming this is a bug, or has something to do with how the sim renders avatars when some kind of state of their attachments is changed.
-- adsl-69-226-220-211.dsl.pltn13.pacbell.net (2007-04-27 18:54:25)
Nice! Many thanks, easy to find helpful information. Good work.
-- ip-176.net-81-220-232.bruay.rev.numericable.fr (2007-06-14 17:39:28)
Whats with the stupid spam of porn website address here? Please ban those dumb bots. Kinda scary.
-- NexiiM (2007-07-04 03:36:01)
Does llWhisper perform better than llSay in a laggy sim? i really wanna know, can someone test that?
-- 193.180.104.200 (2007-09-17 04:52:08)
OMFG, can someone delete all this crap?
-- 136.8.1.100 (2007-11-12 18:27:25)