|
Rhaorth Antonelli
Registered User
Join date: 15 Apr 2006
Posts: 7,425
|
11-21-2008 21:26
I am stuck with trying to get the link_message thing to work.
not sure what I have done incorrectly... this is what I have done so far (not in world to copy the script so please forgive if I use the incorrect terminology, I will send the script in world to anyone who wants to see it)
I create 2 prims, root has the script with the messagelinked in it next prim has a script for changing the texture of the prim it is in, via a dialogue menu (free from the forums with some mods) and in that script it has the call for the link_message
hopefully I said those correct
ok so... I link the prims, with the root being of course the root
touch prim, dialogue comes up change the texture all is good
if I make a copy of the prim set, and leave it rezzed in world, and click either set, it activates the dialogue for all of them (and from what I understand it should not do that)
I want these for changing the gemstones in jewelry on touch... but having multiple stones in some cases, in the same linkset....
but.. I do not want it to change all pieces of jewelry from touching just one.. (which is what it seems to be doing at the moment)
so.... my question is, how do I stop it from doing that? and if anyone wants to see the scripts just let me know, I will drop them on you when I am in world again.
Thanks in advance
_____________________
From: someone Morpheus Linden: But then I change avs pretty often too, so often, I look nothing like my avatar.  They are taking away the forums... it could be worse, they could be taking away the forums AND Second Life...
|
|
Ron Khondji
Entirely unlike.
Join date: 6 Jan 2007
Posts: 224
|
Open listen.
11-22-2008 00:36
It sounds like you do not remove the listen. When the dialog responds the open listens in all prims 'hear' the answer and change texture.
|
|
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
|
11-22-2008 02:56
This sounds like a classic 'cross-talk' problem. When more than one object's script is listening on the same channel they will all respond to the same command. Here's a rough example of using an ever-changing listen channel to guard against that very thing. It also includes a time-out to discard the listen if the nothing comes back from the dialog after 60 seconds. integer mnuChannel; integer mnuHandle;
dialogShow() { llListenRemove(mnuHandle); mnuChannel = ((integer)llFrand(900000) + 100000) * -1; mnuHandle = llListen(mnuChannel, "", llGetOwner(), ""); llDialog(llGetOwner(), "\nPick an Option, any Option...", ["Option 1", "Option 2", "All Done"], mnuChannel); llSetTimerEvent(60); }
default { touch_start(integer total_number) { if(llDetectedKey(0) == llGetOwner()) dialogShow(); }
listen(integer channel, string name, key id, string message) { llListenRemove(mnuHandle);
if (message == "Option 1") llOwnerSay("This is Option 1"); else if (message == "Option 2") llOwnerSay("This is Option 2"); else if (message == "All Done") llOwnerSay("Bye");
if (message != "All Done") dialogShow(); }
timer() { llSetTimerEvent(0); llListenRemove(mnuHandle); llOwnerSay("You were too slow; dialogue timed out."); } }
|
|
Rhaorth Antonelli
Registered User
Join date: 15 Apr 2006
Posts: 7,425
|
11-22-2008 11:42
thank you that is what it was I feel dumb LOL but got to learn somehow I had some help in world last night, and a person made me a new script, but it seems to only work for me, no one else, so I am guessing that has something to do with the get owner stuff going to hit the wiki and see what info I can find thanks again folks, appreciate the input. 
_____________________
From: someone Morpheus Linden: But then I change avs pretty often too, so often, I look nothing like my avatar.  They are taking away the forums... it could be worse, they could be taking away the forums AND Second Life...
|