Sunday, August 20, 2006

Ambiguous Object Chat

This post appeared originally on the old blog. The original comments attached to the post are listed at the bottom. -J 09/03/06

Consider the following LSL script:

default
{
state_entry()
{
llSay(0,"Hello, Avatar!");
llOwnerSay("Hello, Avatar!");
// edit: fixed erroneous argument in previous line. Thanks MP!
llInstantMessage(llGetOwner(),"Hello, Avatar!");
}
}
Drop that script into a prim and run it. Three lines of chat will appear for the owner:
Object: Hello, Avatar!
Object: Hello, Avatar!
Object: Hello, Avatar!
Three forms of chat available to scripted objects show up exactly the same! (The other two, shout and whisper, can be distinguished from all others.) But of these three forms of chat, only one can be heard by other people.

This issue comes up with scripted objects which use chat to report something to the owner. Sometimes these scripts use llSay when they should instead use llOwnerSay. (If your script does this, it is a naughty script that should be publicly flogged. I'm looking at you, "MultiGadget by Timeless Prototype"! For shame!) Being the considerate person that I am, I do not want to use an object which will spam everyone around me, but I cannot determine at a glance which method of communication the object is using.

So, If I Ruled the Grid, every form of visible object communication would be easily distinguishable from every other form, at a glance. The results of the script would show up as something like this:
Object: Hello, Avatar!
[Own] Object: Hello, Avatar!
[IM] Object: Hello, Avatar!
Not only would each form have different text boilerplate, but they would use different colors (which could be changed in your preferences, of course). The Grid would be a much less ambiguous place to live in, and that's a good thing.



Since I do not yet rule the Grid, I will point out for the benefit of my readers that you can tell if an object is spamming the general chat channel by using another object which has been scripted to repeat to you everything which is said on channel 0. Here is a script that should do the job (pending actual testing in SL):

default
{
state_entry()
{
llListen(0,"",NULL_KEY,"");
}

listen( integer channel, string name, key id, string message )
{
llOwnerSay( name + " said: " + message );
}
}

To my knowledge, it remains impossible by any means (short of packet sniffing, which may or may not violate the Terms of Service) to tell the difference between llOwnerSay and sending an instant message to the owner.


Comments from the original post:
Timeless Prototype said...

The Multi Gadget advert can be disabled by its owner by saying 'cmd|advert|off'. That is to say it is the choice of the owner. Everything else is an IM or OwnerSay, except for the "key getter" feature which is deliberately a whisper because you might be getting keys for a friend to use.

I like your idea of prefixing what is said with [Own] or [IM]. Here's how that can be achieved by your LSL script:

myOwnerSay(string message)
{
string preserveName = llGetObjectName();
llSetObjectName("[Owner] " + preserveName);
llOwnerSay(message);
llSetObjectName(preserveName);
}

8/21/2006 5:28 PM



Erbo Evans said...

I know I'll definitely turn that off on my copy of the MG...I just wonder if the setting "sticks" when the MG is detached and reattached (which is basically every time I change outfits). Perhaps I'll need to make a gesture that issues that command to the MG that I can use whenever needed.

8/24/2006 11:18 AM



Mera Pixel said...

You already know this, but llOwnerSay doesn't take a channel as the first example shows.

*waves to timeless*

8/25/2006 6:12 PM


No comments: