Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Can llListen listen for multiple keys?

Kyushu Tiger
Registered User
Join date: 12 Nov 2005
Posts: 92
04-12-2006 14:19
I have a script that I would like to listen for commands from two specific objects. I know llListen can listen for messages from a specific key, but can I specify multiple keys?


Kyushu
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
04-12-2006 14:32
You can use NULL_KEY to listen for every key, and then filter inside your listen handler. Or you can use 2 separate listeners. I'm not sure which will be laggier. If many other objects are likely to be speaking on the same channel, using 2 listeners might be better.
Rickard Roentgen
Renaissance Punk
Join date: 4 Apr 2004
Posts: 1,869
04-12-2006 14:52
my own experience is that a single listen for all keys and then scripting to only pay attention to the keys you want is better.
_____________________
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
04-12-2006 14:53
IMO mutiple listeners are worse becuase your opening up 2+ things that the script has to listen for vs just making a generic listen and filtering it out later with if statements

now if theres 1000 objects i dont know which would be better
Kyushu Tiger
Registered User
Join date: 12 Nov 2005
Posts: 92
04-12-2006 15:02
Thanks. I'm assuming as well that multiple listeners would not be the way to go. Just wondered if there was a way to make the one listen to only two keys (without doing additional filtering), and it sounds like the answer is no :)


Kyushu
Kyushu Tiger
Registered User
Join date: 12 Nov 2005
Posts: 92
One more questions
04-13-2006 17:04
If I have a script that's in an object, do I want to listen for the key of the script itself? Or the prim it's in?


Kyushu
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
04-14-2006 00:32
The prim does the speaking - so it's the prim it's in.

llGetKey() returns the key of the prim the script is in.

A prim is "deaf" to anything it says btw, but can hear other prims quite happily. I've never tested for child prims in an object though it could go either way.
Kyushu Tiger
Registered User
Join date: 12 Nov 2005
Posts: 92
04-14-2006 12:10
Thanks Eloise :)


Kyushu