Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Odd open channel + linkmessage

Seagel Neville
Far East User
Join date: 2 Jan 2005
Posts: 1,476
02-06-2006 23:47
Ok, I'm testing the open channel behavior.
sample1
CODE
default
{
state_entry()
{
llListen(0, "", "", "");
}

listen(integer channel, string name, key id, string message)
{
llSay(0, message);
}
}
This is no problem. But if you linked two objects and...
sample2(sender)
CODE
default
{
state_entry()
{
llListen(0, "", "", "");
}

listen(integer channel, string name, key id, string message)
{
llMessageLinked(LINK_SET, 0, message, "");
}
}
sample2(receiver)
CODE
default
{
link_message(integer sender_num, integer num, string str, key id)
{
llSay(0, str);
}
}
What do you think this happens?
It repeats my saying forever. :D I'm not sure why this happens.
If you set any filter in llListen such as channel number or llGetOwner as key, it doesn't happen. :D Does anyone tell me why, plz?
_____________________
:) Seagel Neville :)
Ben Bacon
Registered User
Join date: 14 Jul 2005
Posts: 809
02-07-2006 00:13
Hmmmmm - that's exactly the opposite of what BadGeo: Chat says should happen. Objects are supposed to ignore themselves.

Seagel, what happens if you put both scripts into the same prim? Does it still get into an infinte loop?

All, is this an error in the wiki, or a bug in LSL?
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
02-07-2006 00:52
This is where you need to remember that "object" and "prim" are used interchangably, often in a confusing manner.

A script will ignore all chat that orginates from it's prim. But if it comes from another prim in the link set, then it will hear it.
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Ben Bacon
Registered User
Join date: 14 Jul 2005
Posts: 809
02-07-2006 01:25
From: Strife Onizuka
This is where you need to remember that "object" and "prim" are used interchangably, often in a confusing manner.
Almost, but not quite, Strife. According to both general use and BadGeo: Object
From: someone
An object is an instance of geometry in SecondLife that can consist of a just a single primitive or multiple prims linked together. A single prim is often also generically called an object.
and according to BadGeo: Chat
From: someone
Objects that output chat never receive their own output back in listen() events. This applies to all scripts in that object, not just the one that chatted.
In other words, all prims are objects, but not all objects are prims. Some objects are linked sets of multiple prims, which the wiki clearly says should not hear themselves.

So my question is: Do we bug-report that prims in a multi-prim object hear other prims within that object - or do we change the wiki to say that "Prims that output chat never..."?
Seagel Neville
Far East User
Join date: 2 Jan 2005
Posts: 1,476
02-07-2006 01:36
Well, in brief, I answer Ben's this question.
From: Ben Bacon
Seagel, what happens if you put both scripts into the same prim? Does it still get into an infinte loop?
No. It doesn't still get into an infinte loop when I put both scripts into the same prim.
_____________________
:) Seagel Neville :)
Seagel Neville
Far East User
Join date: 2 Jan 2005
Posts: 1,476
02-07-2006 01:48
Ben, I think BadGeo issue is another. The prim doesn't Say anything by itself and doesn't even listen to itself. It sends just its message via llMessageLinked. This trouble is that when the script listened to something by open channel, it would repeat to send messages permanently. Or, just repeating execution under the link_message event.
_____________________
:) Seagel Neville :)
Seagel Neville
Far East User
Join date: 2 Jan 2005
Posts: 1,476
02-07-2006 02:05
From: Strife Onizuka
This is where you need to remember that "object" and "prim" are used interchangably, often in a confusing manner.
Strife, yes, it may be. But this is a reproducible issue.
_____________________
:) Seagel Neville :)
Ben Bacon
Registered User
Join date: 14 Jul 2005
Posts: 809
02-07-2006 02:23
From: Seagel Neville
Ben, I think BadGeo issue is another. The prim doesn't Say anything by itself and doesn't even listen to itself. It sends just its message via llMessageLinked. This trouble is that when the script listened to something by open channel, it would repeat to send messages permanently. Or, just repeating execution under the link_message event.
The problem there is that:
  1. Script A hears you say something, and uses llMessageLinked to pass it to script B.
  2. Script B gets the link message, and says the message on channel 0.
  3. Script A hears script B talking on channel 0 and uses llMessageLinked to pass what it hears back to script B.
  4. Script B gets the link message, and says the message on channel 0.
  5. Script A hears script B talking on channel 0 and uses llMessageLinked to pass what it hears back to script B.
  6. etc
  7. etc

BadGeo states that because these scripts are in the same object (you said your prims were linked together), script A should not hear script B chatting - but apparently it does.
Seagel Neville
Far East User
Join date: 2 Jan 2005
Posts: 1,476
02-07-2006 02:32
:D Thank you, Ben. I think I'm a fool. :D

Surley object B says it and A listens to it and repeats it. So what I took for a trouble was my mistake. Sorry, for bothering you. :o

Speaking of BadGeo, it seems to make a mistake between object and prim in Wiki, I guess.
_____________________
:) Seagel Neville :)
Ben Bacon
Registered User
Join date: 14 Jul 2005
Posts: 809
02-07-2006 02:59
With everything others and myself have learned from your posts about animations, I'm glad I could return the help. :)
Seagel Neville
Far East User
Join date: 2 Jan 2005
Posts: 1,476
02-07-2006 03:06
:) Thanks for your kindess.
_____________________
:) Seagel Neville :)
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
02-07-2006 10:02
Thanks for pointing this out - I fixed the chat page. I also did a little revision to make wording clearer, lemme know what you think :)
==Chris
_____________________
October 3rd is the Day Against DRM (Digital Restrictions Management), learn more at http://www.defectivebydesign.org/what_is_drm
Seagel Neville
Far East User
Join date: 2 Jan 2005
Posts: 1,476
02-07-2006 14:40
Thank you, Crhis. :)
From: Christopher Omega
I also did a little revision to make wording clearer, lemme know what you think :)

What about this? :D
CODE
but this practice is discouraged because it is best that there is nothing (the use of llMessageLinked is recommended instead)
_____________________
:) Seagel Neville :)