These forums are CLOSED. Please visit the new forums HERE
Multiple scripts within one prim |
|
|
Thom Wozniak
Registered User
Join date: 13 Nov 2007
Posts: 15
|
11-30-2007 11:31
I have two scripts within the same prim, and am trying to get them to talk together via the llMessageLinked() command. However, it seems that only one script is receiving the link_message() event. Is it possible to set it up so that both scripts receive all link messages?
|
|
Ravanne Sullivan
Pole Dancer Extraordinair
Join date: 10 Dec 2005
Posts: 674
|
11-30-2007 11:42
A script can not talk to itself via linked messages, so with only two scripts only one gets the message originating from the other. Why would you want both scripts to receive the message? The script that originates it already knows the content.
_____________________
Ravanne's Dance Poles and Animations
Available at my Superstore and Showroom on Insula de Somni http://slurl.com/secondlife/Insula de Somni/94/194/27/ |
|
Monica Balut
Beam-Me
Join date: 18 Feb 2007
Posts: 311
|
11-30-2007 12:03
I script can receive messages sent from itself if LINK_THIS is used. I have done it.
|
|
Kahiro Watanabe
Registered User
Join date: 28 Sep 2007
Posts: 572
|
11-30-2007 12:20
What are you trying to do? If you can explain us and show us the code we'd be able to help you.
|
|
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
|
11-30-2007 12:27
Erm. Unlike chat messages, scripts DO hear their own link messages, if they are sent to the prim (either specifically, or as part of a specified group) the script is in.
To the OP: Make sure you have a link_message() event in both scripts, and that you are indeed sending the message to the specified prim (either via LINK_THIS, LINK_SET, or llGetLinkNumber()). |
|
Bobbyb30 Zohari
SL Mentor Coach
Join date: 11 Nov 2006
Posts: 466
|
11-30-2007 12:40
A script can not talk to itself via linked messages, so with only two scripts only one gets the message originating from the other. Why would you want both scripts to receive the message? The script that originates it already knows the content. Your absolutely wrong. A script can here its own link_message. _____________________
|
|
Cryas Tokhes
Great Googley Moogley...
Join date: 8 Feb 2006
Posts: 124
|
11-30-2007 12:58
Correct, a Script WILL hear itself if the linknum is including this prim (LINK_SET, LINK_THIS, etc). that is why it is good to use a "incoming" and "outgoing" integer for the 'integer num'. this will allow, especially if your using like commands to communication.
|
|
Thom Wozniak
Registered User
Join date: 13 Nov 2007
Posts: 15
|
11-30-2007 16:18
True. The originating script does hear its own LINK_THIS messages. The problem is that the other script in the same object doesn't. What I am trying to do is create a generic button script for a HUD with a separate component in a separate script that allows the user to set some basic parameters without exposing the code for the button action.
|
|
Monica Balut
Beam-Me
Join date: 18 Feb 2007
Posts: 311
|
11-30-2007 16:47
Thom, if you're using LINK_THIS, all the other scripts in the same prim will also receive the message. Make sure that the script is actually running. I've had situations where the script gets turned off for some reason. If it's off, it obviously won't react to anything.
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
11-30-2007 16:52
True. The originating script does hear its own LINK_THIS messages. The problem is that the other script in the same object doesn't. What I am trying to do is create a generic button script for a HUD with a separate component in a separate script that allows the user to set some basic parameters without exposing the code for the button action. Try this: ==script 1== CODE
==script 2 == CODE
outputs: "[16:48] Object: script 2 Testing 1 [16:48] Object: script 1 Testing 1" _____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum |
|
Ravanne Sullivan
Pole Dancer Extraordinair
Join date: 10 Dec 2005
Posts: 674
|
11-30-2007 17:07
Oops, my bad. I was having a no coffee day, ran out and hadn't gotten to the store yet.
_____________________
Ravanne's Dance Poles and Animations
Available at my Superstore and Showroom on Insula de Somni http://slurl.com/secondlife/Insula de Somni/94/194/27/ |
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
11-30-2007 17:08
You can also do this:
==script 1== CODE
==script 2== CODE
outputs: "[17:06] Object: script 2 Testing 1 number = 1 [17:06] Object: script 1 Testing 2 number = 2" _____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum |
|
Nyoko Salome
kittytailmeowmeow
Join date: 18 Jul 2005
Posts: 1,378
|
11-30-2007 18:29
script can hear itself via linkmessage???
TRUE... but funny hearing the question, from what i remember of the literature, THIS ISN'T SUPPOSED TO HAPPEN... i -think- linkmessages are =supposed= to be automatically ignored by the calling script. :\ correct me if i'm wrong, scripting gurus... i've noticed this myself lately, but haven't had time to address it at all... am i confusing things? maybe it's the 'listen' that is not supposed to hear itself (but i don't recall running into these interferences with listens - only lately, linkmessages...) CORRECT ME IF I'M WRONG ) (super-smiley sized i'm gonna hafta start a jira just to open up my smiley allowance!!![]() p.s. very simple filtering on script-name works well, see my 'product delivery script' package elsewhere for that... guess that's why i've never brought it up myself, i almost always use that. ![]() _____________________
![]() Nyoko's Bodyoils @ Nyoko's Wears http://slurl.com/secondlife/Centaur/126/251/734/ http://home.comcast.net/~nyoko.salome2/nyokosWears/index.html "i don't spend nearly enough time on the holodeck. i should go there more often and relax." - deanna troi |
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
11-30-2007 18:35
script can hear itself via linkmessage??? TRUE... but funny hearing the question, from what i remember of the literature, THIS ISN'T SUPPOSED TO HAPPEN... i -think- linkmessages are =supposed= to be automatically ignored by the calling script. :\ correct me if i'm wrong, scipting gurus... i've noticed this myself lately, but haven't had time to address it at all... am i confusing things? maybe it's the 'listen' that is not supposed to hear itself (but i don't recall running into these interferences with listens - only lately, linkmessages...) CORRECT ME IF I'M WRONG ) (super-smiley sized i'm gonna hafta start a jira just to open up my smiley allowance!!![]() p.s. very simple filtering on script-name works well, see my 'product delivery script' package elsewhere for that... guess that's why i've never brought it up myself.Yep, you are thinking of llSay & listen. From Kelly Linden a cpl weeks ago: 3. When the script asks the history for a chat message the checks are done in this order: - channel - self chat (objects can't hear themselves) - distance/RegionSay - key - name - message _____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum |