Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llMessageLinked: LINK_ALL_CHILDREN or...

Talan Mackenzie
The Rocketeer
Join date: 15 Aug 2004
Posts: 14
05-16-2005 20:31
(My apologies if this has been covered before. I looked but did not see.)

I am designing a vehicle in which the root prim contains the script which contains the vehicle code and llMessageLinked central control. There are, at this time, four prims in the vehicle which contain link_message events, which use conditionals to determine what to do when link messages arrive, and if those link messages even pertain to them.

I need to simultaniously send messages to two of those prims. (But not the other two.)

Being a civic-minded scripter, I was wondering which was the more efficient course of actions:

1) Send the llMessageLinked to LINK_ALL_CHILDREN, and put conditional statements in the two unneeded scripts that check the message and discard it, or..

2) Send the llMessageLinked to the specific prims in question, via their explicit link numbers. Obviously this means I'll have to llMessageLinked twice. Or..

3) Anything else.

Furthermore, while we're on the subject, if 2) is the better solution, how many more prims would need the message before 1) becomes the more efficient way to go?
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
05-16-2005 21:04
Since it's only two, I would llMessageLinked the two individual prims in turn. It should be close enough to synchronized for your purposes.

For more than three, just use a broadcast.
_____________________
---
Vortex Saito
Quintzee Creator
Join date: 10 Sep 2004
Posts: 73
05-17-2005 18:05
Or use the the id part as a switch
It doesn't neccesarily need a key to work ;)
So you could use :

llMessageLinked(LINK_ALL_CHLDREN,0,"command","switch1";)

and

llMessageLinked(LINK_ALL_CHLDREN,0,"command","switch2";)

and select on the command AND/OR the switch
Ace Cassidy
Resident Bohemian
Join date: 5 Apr 2004
Posts: 1,228
05-17-2005 18:23
I have always operated under the assumption that "event processing" in general incurs a significant overhead, and is what you want to minimize when you're worried about performance.

Whenever a script has an event handler triggered, for whatever reason, the sim needs to ready that that script, and execute the appropriate event handler. That is the reason that collissions with scripted objects are much more painful on a sim than collissions with non-scripted objects.

If this assumption is true, then you are much better off sending individual llMessageLinked() messages to the specific prims within the link set, rather than broadcasting, and having each script do a conditional to determine whether it needs to respond or not.

The larger overhead is not in the individual llMessageLinked() calls, but is in the event handling that has to occur on the other end. Minimize the latter at the expense of the former, and I think you'll be better off from a sim performance perspective.

- Ace
_____________________
"Free your mind, and your ass will follow" - George Clinton