Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

too many Listens??

Icarus DuCasse
Registered User
Join date: 28 Jan 2007
Posts: 27
03-06-2007 04:34
Ive got this scripted car and suddenly it says 'too many Listens' with a part of the prims not responding (logically). I didn't change anything, tried to strip but still gives the same error. Had a friend trying it with the same result... I don't know what Im doing wrong.

Can anyone help me out?
thx
Crisk Zenovka
Registered User
Join date: 2 Mar 2007
Posts: 2
03-06-2007 05:13
..You probably have too many listens. Go into the script, and look near the state_entry events (they're usually there) or you could use the Find feature to find the llListen function. Removing them from the script will make it compile and you won't get the error, but it will most likely break the script. See if you can get a hold of whoever scripted it and ask them to rework it.
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
03-06-2007 05:15
Each time llListen is called it will add a listen even if it is called with the same channel number. LSL will support 64 listens (I think) before it will break with the 'too many listens' error.

Check where your code is setting up any new listens and why.
Fenrir Reitveld
Crazy? Don't mind if I do
Join date: 20 Apr 2005
Posts: 459
03-06-2007 11:45
My guess is that your code looks something like this:

CODE
on_rez (integer p)
{
.. etc ..
llListen (0, "", llGetOwner(), "") ;
.. etc ..
}


The problem with this is that whenever the on_rez event is called, it will create a new listener. This will seemly work okay, until you rez the vehicle the 65th time and then the number allowed listeners is exceeded. IIRC, listener filters are additive for the entire primset, so it's 64 maximum per set.

One solution is to capture the handle returned by the listener filter and then remove it every time:

CODE

on_rez (integer p)
{
.. etc ..
llRemove (gListenHandle) ;
gListenHandle = llListen (0, "", llGetOwner(), "") ;
.. etc ..
}


Or, even simpler, just have your on_rez reset the script and set up your listener on the state_entry event.
_____________________
----
----
----
Icarus DuCasse
Registered User
Join date: 28 Jan 2007
Posts: 27
03-07-2007 00:35
From: Newgate Ludd
Each time llListen is called it will add a listen even if it is called with the same channel number. LSL will support 64 listens (I think) before it will break with the 'too many listens' error.


Ive noticed. I tested it with pushing the reset button a couple of times (Ive got a listen functon in state_entry which sends the random channel to +-10 children.

Adding
CODE

on_rez(integer n)
{
llListenRemove(channel);
}
state_entry()
{
llListenRemove(channel);
}


helped.

Thx
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
03-07-2007 02:30
From: Icarus DuCasse
Ive noticed. I tested it with pushing the reset button a couple of times (Ive got a listen functon in state_entry which sends the random channel to +-10 children.

Adding
CODE

on_rez(integer n)
{
llListenRemove(channel);
}
state_entry()
{
llListenRemove(channel);
}


helped.

Thx


Unless Channel is the ID returned by llListen that wont work.
Icarus DuCasse
Registered User
Join date: 28 Jan 2007
Posts: 27
03-07-2007 08:10
From: Fenrir Reitveld
Or, even simpler, just have your on_rez reset the script and set up your listener on the state_entry event.


soley a resetfunction on rez doesn't help, at least it didn't prevented getting those error messages.

From: Newgate Ludd
Unless Channel is the ID returned by llListen that wont work.


I used channel as an integer. haven't received any script errors since.
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
03-08-2007 01:12
From: Icarus DuCasse
soley a resetfunction on rez doesn't help, at least it didn't prevented getting those error messages.



I used channel as an integer. haven't received any script errors since.


He he Terminology, :), I just meant that it shouldnt be the channel that you are listening on, rather that it should be the return value (an integer id) from llListen i.e.
This is wrong
CODE

llListen(Channel,"","","");

...

llListenRemove(Channel);

It should be
CODE

Listening = llListen(Channel,"","","");
...

if(Listening > 0) llListenRemove(Listening);
Listening = 0;