Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

A hud animating involuntarily the others

Ange Menges
Registered User
Join date: 2 Apr 2007
Posts: 4
07-08-2007 08:03
Hello,
I made a very simple hud just for a choice of animations with sounds, mixing some basic scripts that I found in the forums.
It works well, but I have an unforeseen problem.
When we use the hud with my friends, and when we are near from each others, each animation launched by one animate also the others.
I suppose that it is a known problem and easily solved, but I was unable to find by searching in the forums the right answer.
So if anyone could explain me the reason or give me a link for that, it would be a great help.
Thank you in advance,
Ange
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
07-08-2007 08:32
They're all listening on the same channel. Each instance would need to use a different channel to avoid "cross-talk". In a recent thread, a similar problem was addressed by selecting a channel based on a hash of the owner key. But that's overkill here because, if it's just a HUD, there's no reason it should be listening at all, but instead link_messages should be used.

(Well, actually, it probably would be better to just use llDetectedLink() in a single root-prim script instead of explicitly communicating from separate scripts in the child prims... but that may entail some aggressive overhaul of the "found scripts.";)
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
07-08-2007 09:01
If you set the listen to filter on the Owner...

llListen(channel, "", llGetOwner(), "";);

...this should fix the problem.

Caveat: The listen must be set when the object's ownership changes.

This sort of thing:

changed(integer change)
{
if (change & CHANGED_OWNER)
{
llResetScript();
}
}
Ange Menges
Registered User
Join date: 2 Apr 2007
Posts: 4
07-08-2007 10:02
A big thank you to you two. I will try to fix that.
Well, it seems that the page that I forgot to read carefully was the llListen one !
Very nice to you to spend time for help :-)
Thanks again,
Ange