|
Cobalt Neutra
As seen on radio
Join date: 13 Sep 2004
Posts: 48
|
04-06-2006 17:36
What's the trck to making a HUD object communicate with a body-attachment?
I've tried using llSay on a channel, with a listen, and it's no go. I know it can be done, because I have HUD objects that do it.
So - what's the trick? How can you make a HUD button tell a body attachment that it's been pressed?
|
|
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
|
04-06-2006 17:48
llSay with a listen in the other object. It should have worked. Can you post the script that talks, and the script that listens? Or, start out simple - just have the HUD say something on a channel, and put a listen handler in the other attachment that listens on that channel and echoes what it heard. Note that the HUD attachment will speak with its own key, not the owner's key, so use to set up NULL_KEY the listener, unless you've got some otehr way of finding the HUD attachment's key (sensors won't work on attachments).
|
|
Cobalt Neutra
As seen on radio
Join date: 13 Sep 2004
Posts: 48
|
04-06-2006 17:57
Okay - that was my problem. I didn't realise HUD objects didn't speak as the owner. I changed: llListen(23, "", llGetOwner(), ""  ; to llListen(23, "", "", ""  ; And now it works. But, does this mean that you can't set an owner-only block on HUD communications?
|
|
Keiki Lemieux
I make HUDDLES
Join date: 8 Jul 2005
Posts: 1,490
|
04-06-2006 18:09
You can check for the owner of an object like this: listen( integer channel, string name, key id, string message ) { if( llGetOwnerKey( id ) == llGetOwner() ) { // do stuff } }
_____________________
imakehuddles.com/wordpress/
|
|
Cobalt Neutra
As seen on radio
Join date: 13 Sep 2004
Posts: 48
|
04-06-2006 18:53
From: Keiki Lemieux if( llGetOwnerKey( id ) == llGetOwner() ) Won't this run you into the same problem I hit before? If the HUD doesn't speak as the owner, then getting the owner's ID isn't going to work.
|
|
Keiki Lemieux
I make HUDDLES
Join date: 8 Jul 2005
Posts: 1,490
|
04-06-2006 19:48
From: Cobalt Neutra Won't this run you into the same problem I hit before? If the HUD doesn't speak as the owner, then getting the owner's ID isn't going to work. llGetOwnerKey( id ) gets the owner of the object that spoke. If it's attached to you, you own it. The example compares the owner of the object that spoke to the owner of the object the current script is in.
_____________________
imakehuddles.com/wordpress/
|