These forums are CLOSED. Please visit the new forums HERE
llSay issues |
|
|
Maury Lehane
Registered User
Join date: 28 Feb 2005
Posts: 3
|
05-05-2006 12:07
heres the deal .. i have a hud attachment ive made to control features on a gun i also made this hud simply repeats the objects name of the pressed button over a chat channel then the listen command picks it up so if i have a listen for a draw command i just name the button draw ... now the problem is i want thisto work with the hud but not with anything else and i also note if some one else is wearing my guns and hud that my hud affects there gun .. is there a way to make wach hud and gun set interact only with each other if they have the same owner ? or some other method of preventing other objects or my own from affecting guns of the same type owned by some one else ?
|
|
Yumi Murakami
DoIt!AttachTheEarOfACat!
Join date: 27 Sep 2005
Posts: 6,860
|
05-05-2006 12:12
heres the deal .. i have a hud attachment ive made to control features on a gun i also made this hud simply repeats the objects name of the pressed button over a chat channel then the listen command picks it up so if i have a listen for a draw command i just name the button draw ... now the problem is i want thisto work with the hud but not with anything else and i also note if some one else is wearing my guns and hud that my hud affects there gun .. is there a way to make wach hud and gun set interact only with each other if they have the same owner ? or some other method of preventing other objects or my own from affecting guns of the same type owned by some one else ? In the listen event, call llGetOwnerKey() on the speaking object's key, and check it matches llGetOwner(). |
|
Maury Lehane
Registered User
Join date: 28 Feb 2005
Posts: 3
|
05-05-2006 12:26
In the listen event, call llGetOwnerKey() on the speaking object's key, and check it matches llGetOwner(). umm im not sure what you mean i took a look at the getownerkey command and i dont really understand how it works |
|
prak Curie
----------
Join date: 4 Jun 2004
Posts: 346
|
05-05-2006 14:48
im not sure what you mean i took a look at the getownerkey command and i dont really understand how it works My advice is poor. Please see the next post for someone who actually knows what they are talking about. ---- Begin Bad Advice Block ---- http://secondlife.com/badgeo/wakka.php?wakka=llListen The third argument you pass to llListen() should be llGetOwner(). ----- End Bad Advice Block ----- _____________________
-prak
|
|
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
|
05-05-2006 15:11
To clarify what Yumi said...
In the listen event, you get a key parameter, which is the key of the object/avatar that spoke. In this case, this will be the key of the HUD. What you need to check is to see if the owner of the HUD, is the same as the owner of the object that's listening (presumably a gun). So inside the gun, you know your own owner - that's llGetOwner, pretty simple. But you also need to find the owner of a different object, the HUD. You have the HUD's key, so you use llGetOwnerKey to find the HUD's owner. If the two match, you know that the command came from the right HUD. If they don't match, it's someone else's HUD that issues the command. So, something like this... CODE
Hope that helps. The third argument you pass to llListen() should be llGetOwner(). I don't think that will work, because the HUD will speak with its own key, not the owner's key. That would work if it were a dialog menu (which speaks with the avatar's key). |
|
prak Curie
----------
Join date: 4 Jun 2004
Posts: 346
|
05-05-2006 15:50
I don't think that will work, because the HUD will speak with its own key, not the owner's key. That would work if it were a dialog menu (which speaks with the avatar's key). Right you are. My mistake. _____________________
-prak
|
|
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
|
05-06-2006 11:48
Just a nit, but it is more readable, code-wise:
![]() CODE
|
|
Llauren Mandelbrot
Twenty-Four Weeks Old.
Join date: 26 Apr 2006
Posts: 665
|
05-06-2006 12:50
Just a nit, but it is more readable, code-wise: ![]() CODE
CODE if (!test) {ta be easier ta read thanCODE if (test) {...especially when tonsOfStuff includes this same structure recursively.Not always; it depends on which is longer, tonsOfStuff or crashGracefully. Ah says `tis easier ta read with th` shorter one first. Jes` ma L$0.02 worth , an` strictly a matter of personal opinion. No flames intended, so please don`t flame back. Toodle-oo! |
|
ed44 Gupte
Explorer (Retired)
Join date: 7 Oct 2005
Posts: 638
|
05-06-2006 18:55
You could set up a randomly numbered channel, 1/ 2 billion choices!!
1. Set up a variable at the start of your script (before default) CODE
2. Set up the channel number somewhere in your startup code: CODE
3. call the dialog, set up the listen and then listen to the hud: CODE
CODE
|