Efficiency of linked messages

Maxxi Short maxxi at southville.net
Wed Dec 16 12:55:02 PST 2009

I have a fairly complicated project, where I'm splitting scripts between several prims and using llMessageLinked to communicate between them. I actually have 12 linked prims, but for the sake of my question, let's assume that I have four, called "Red", "Green", "Yellow" and "Blue", where "Green" is the root prim.

In certain cases, I want Red to talk directly to Blue. I can see three different approaches:

1. Use llMessageLinked with the first parameter set to the link number of Blue. Obviously the most efficient, but since I have quite a few prims, it's very easy to link them in the wrong order - so my code may assume that "Blue" is link number 4, but it's actually link number 6 this time.

2. I can get round this by having a sort of "handshake" at the beginning, where each prim announces who it is (probably to the root prim, which then tells all the children), but then there's the overhead of that initial conversation.

3. Use llMessageLinked and just set the first parameter to LINK_ALL_OTHERS, which Blue will hear and act on. This way Yellow and Green get the message too, but ignore it.

My timer is set to kick in every five minutes, so I'm not running this every fraction of a second. Is 3 a really inefficient/inelegant way to code it? I realise that knowing the link number is the most efficient way, but I'm worried about the pitfalls of getting the wrong link number, and wondering if using method 2 introduces more complexity than is worthwhile.

Any thoughts?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.secondlife.com/pipermail/secondlifescripters/attachments/20091216/195531f2/attachment.htm 

More information about the secondlifescripters mailing list