Changes to the listen event.
|
Don Linden
Bug Reaper
Join date: 14 Jun 2004
Posts: 58
|
09-28-2004 13:12
I am giving a heads up to everyone that I have made modifications to the listen event on the test servers (not live yet). Messages can now only trigger one listen event, even if they match the criteria for more than one listen callback. For example: default { state_entry() { llListen(0, "", "", ""); llListen(0, "", llGetOwner(), ""); }
listen(integer channel, string name, key id, string mesg) { llSay(0, name + ": " + mesg); } }
Currently, if the owner says something, both callbacks would match and the listen event would be fired twice. With the new changes, the listen event would just trigger once. Is anyone relying on the current behavior? I can't think of a good reason to have the listen event trigger more than once for any given message, but I'm just giving out a heads up just in case. =)
_____________________
Its not a glitch, its a feature.
|
McWheelie Baldwin
Registered User
Join date: 9 Apr 2004
Posts: 154
|
09-28-2004 13:23
Don, Thanks for the advanced notice. I can't think of any reason to trigger listen() more than once, but I am constantly amazed at all of the great scripts people come up with. At any rate, keep up the great work, thanks again for the heads up, and when do you expect the listen changes to be moved to production?
McW
|
Don Linden
Bug Reaper
Join date: 14 Jun 2004
Posts: 58
|
09-28-2004 13:26
Most likely in 1.5.6
_____________________
Its not a glitch, its a feature.
|
Tiger Crossing
The Prim Maker
Join date: 18 Aug 2003
Posts: 1,560
|
09-28-2004 13:50
Good change. I've been bitten by this before. Once again, Don knows what we want and makes it so. Where's the llRezObjectRight function, Don? 
_____________________
~ Tiger Crossing ~ (Nonsanity)
|
Don Linden
Bug Reaper
Join date: 14 Jun 2004
Posts: 58
|
09-28-2004 14:15
Tiger: In 1.5.6 =D
_____________________
Its not a glitch, its a feature.
|
Francis Chung
This sentence no verb.
Join date: 22 Sep 2003
Posts: 918
|
Re: Changes to the listen event.
09-28-2004 15:57
Thanks for the heads up Don. Personally, I don't mind either behaviour and I don't rely on either.
I assume you're making this change as an optimization. I do have a question, though.
It's common belief that an excessive number of listeners causes lag. I hear that this behaviour was significantly improved in 1.5, although I have not personally verified it.
Many people, including myself, often write/re-write scripts to minimize the number of listeners we use (ie. have a listener script and pass listen events to other scripts via link messages), but this often comes at the price of simplicity and modularity.
Is this practice now obsolete?
_____________________
-- ~If you lived here, you would be home by now~
|
Catherine Omega
Geometry Ninja
Join date: 10 Jan 2003
Posts: 2,053
|
09-28-2004 18:41
That's a really good question, Francis. What's easier on the sim, Don, two llListens, or an llListen with an IF/ELSE?
|
Tiger Crossing
The Prim Maker
Join date: 18 Aug 2003
Posts: 1,560
|
09-28-2004 20:30
From: someone Originally posted by Don Linden Tiger: In 1.5.6 =D WOOHOO You da man, Don! 
_____________________
~ Tiger Crossing ~ (Nonsanity)
|
Hiro Pendragon
bye bye f0rums!
Join date: 22 Jan 2004
Posts: 5,905
|
09-28-2004 22:43
Don,
I like this change.
I can't think of any example of why people would need this, that couldn't be solved by moving around / copying procedures.
_____________________
Hiro Pendragon ------------------ http://www.involve3d.com - Involve - Metaverse / Emerging Media Studio
Visit my SL blog: http://secondtense.blogspot.com
|
Hank Ramos
Lifetime Scripter
Join date: 15 Nov 2003
Posts: 2,328
|
09-28-2004 23:23
Sounds good to me. No problem here. Thanks Don!  What about Francis' question? People have bounced around that question for a long time.
|
Oz Spade
ReadsNoPostLongerThanHand
Join date: 23 Sep 2003
Posts: 2,708
|
09-29-2004 01:54
Awsome, thank you so much for the heads up on this. I myself don't rely on the current way it works and actualy would find that annoying to happen.
So I'd so go ahead and change it.
Any situation that would call for someone to use more than one Listen, could and probably should be done with if statments within the listen event instead.
I too am curious about Francis' question.
_____________________
"Don't anticipate outcome," the man said. "Await the unfolding of events. Remain in the moment." - Konrad
|
Rysidian Rubio
Ruby Red Head
Join date: 14 Jan 2004
Posts: 263
|
09-29-2004 22:35
I'm not sure if this is valid but I'm gonna throw it out there anyway.
What about new scripters who accidentally open multiple llListens? Without the result duplicating is there anything to indicate to them that they have too many listens open (which eat up server resources)?
I know that once a certain ammount of listens are opened an error occurs, but if this limit isn't reached then there would be no indication of wasted resources.
|
Azelda Garcia
Azelda Garcia
Join date: 3 Nov 2003
Posts: 819
|
09-29-2004 23:42
FWIW, this wont break any of my code, I think.
Azelda
|
Alondria LeFay
Registered User
Join date: 2 May 2003
Posts: 725
|
09-30-2004 05:46
Makes sense to me and I have no problems with it.
|
Samhain Broom
Registered User
Join date: 1 Aug 2004
Posts: 298
|
09-30-2004 08:43
Not that I have many scripts running in SL, (I do have a few)... this would not negatively impact me.
Hammer down!
_____________________
rm -rf /bin/ladden #beware of geeks bearing grifts
|
Rickard Roentgen
Renaissance Punk
Join date: 4 Apr 2004
Posts: 1,869
|
09-30-2004 17:09
Great idea, but Rysidian has a valid point I think. From: someone Originally posted by Rysidian Rubio I'm not sure if this is valid but I'm gonna throw it out there anyway.
What about new scripters who accidentally open multiple llListens? Without the result duplicating is there anything to indicate to them that they have too many listens open (which eat up server resources)?
I know that once a certain ammount of listens are opened an error occurs, but if this limit isn't reached then there would be no indication of wasted resources. currently, there seem to be a lot of people scripting who don't know how to use llListen. My suggestion is that if you do this there should also be a corrisponding addition of... llGetNumberOfListens() or llGetListenList() or llListenRemove(-1) //Remove All Listens.
|
Azelda Garcia
Azelda Garcia
Join date: 3 Nov 2003
Posts: 819
|
09-30-2004 20:29
llListenRemove( LISTEN_ALL ); or similar would be rather nice.
Azelda
|
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
|
09-30-2004 23:08
agreas with Rickard Roentgen & Azelda Garcia
_____________________
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
|
Jim Bunderfeld
The Coder
Join date: 1 Mar 2004
Posts: 161
|
10-01-2004 11:38
Gladly Welcomed
|