|
Lankarion Lock
Thread Killer
Join date: 9 Oct 2006
Posts: 48
|
07-30-2009 23:49
Is there a function to make your actual avatar listen on a certain channel? I currently have an object scripted to listen and then IM the owner what was said, but the only problem is it doesn't say WHO or WHAT did the saying.
I was curious if we could just bypass the object listening and just have it scripted to make my avatar listen and just have the certain channel show up.
Help is much appreciated!
|
|
Cerise Sorbet
Registered User
Join date: 8 Jun 2008
Posts: 254
|
07-31-2009 00:47
Hi Lankarion! Avatars lisen to channel 0, that is the only one. Listen can say who and what said the chat, it is in the name and id. default { state_entry() { llListen(5, "", "", ""); }
listen(integer channel, string name, key id, string message) { string oldName = llGetObjectName();
if (llGetAgentSize(id)) { llSetObjectName("avatar " + name); } else { llSetObjectName("object " + name); }
llOwnerSay(message); llSetObjectName(oldName); } }
|
|
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
|
07-31-2009 00:54
Firstly, no. Your Avatar can only hear the open chat channel. However, the object you have scripted to listen and then relay an IM to its owner will be using the listen event: listen(integer channel, string name, key id, string message)Notice that besides the 'message', it also carries the 'channel', 'name', and 'id'. The 'name' and 'id' refer to the speaker. Try something like: llInstantMessage(llGetOwner(), name + " (" + (string)id + "  says: \"" + message + "\""  ;
|
|
Zen Zeddmore
3dprinter Enthusiast
Join date: 31 Jul 2006
Posts: 604
|
07-31-2009 07:30
I'm pretty sure channel comms don't cross sim boundaries. Chis has the right idea if what you want is a relayer that prepends the chatting avatars name (stipulating that it is chatting on channel 5). You could as easily stipulate channel 0, but then you are running into lag inducing that is easily avoided with a hover text suggesting to chat on channel 5(only objects can chat on negative channels).
_____________________
A kilogram of programmable nanobots can lower the certainty of both death AND taxes.
|