Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Scripts in seperate objects communication

Brian Demme
Registered User
Join date: 17 Jan 2007
Posts: 1
07-14-2009 21:53
Looking for a little advice, basically a suggestion on where to start looking on how to fix my problem. I'm a scripting newbie, taking baby steps, so please be gentle.

Here's the situation: I've got a HUD that sends texture UUIDs via negative chat channels to my object, thus changing the appearance of the object. The problem is that the HUDs control every object in the nearby area (thus one person could change the textures of someone else's object). What I need to do is make it so the object listens to only the HUD of the owner of the object.

What I'm looking for is the simplest possible solution. I'm guessing that maybe the HUD announcing the AV's UUID might work but that also just adds to all the open Listens (the object itself could have many prims that need texture changes).

Thanks in advance for any suggestions.
Viktoria Dovgal
Join date: 29 Jul 2007
Posts: 3,593
07-14-2009 22:02
In your listen event, you have key id coming in. You can use llGetOwnerKey(id) to see who owns the HUD that sent the message, and compare that against your object's llGetOwner().
Darien Caldwell
Registered User
Join date: 12 Oct 2006
Posts: 3,127
07-15-2009 08:48
in the listen event, try something like this:


CODE

listen(integer channel, string name, key id, string message)
{
if (llGetOwnerKey(id)==llGetOwner())
{
[Stuff goes here]
}
}


What this will do is reject any messages from objects not owned by object owner. :)
_____________________