[sldev] Using llGetAgentLanguage() in a different way...

Marine Kelley marinekelley at gmail.com
Wed Jan 21 12:50:55 PST 2009


Hello all,

I am sending this message to gather thoughts about a little experience I
have made today, and possibly some insight...

Lately the SL viewer has been given the ability to "export" its language
setting out to the sim, and to a LSL function called "llGetAgentLanguage(key
id)". This feature is useful for scripters who want to localize their
scripts according to the language chosen by the user. However, some people
may not want to disclose which language they use so it is an optional
feature that scripters may not really want to exploit automatically.

With my own flavour of the viewer, a script is able to find out whether the
user is using it or not by issuing a llOwnerSay ("@version=nnnn") command
(where "nnnn" is a positive channel number), requiring both a listener and a
timer. I was thinking of using the language feature to convey the version of
the viewer directly, making it a synchornous call : just call
llGetAgentLanguage() once and you get the version, or just the language or
even nothing at all in the case of another viewer. Much easier for scripts.
This change is trivial and takes place in
secondlife-bin/llagentlanguage.cpp,

I have tried it already and it works like a charm. But there are still some
uncertainties I would like to clear out :

- This feature only works if the sim the agent is in has the capability. Is
this the case for every sim now ? If so, will it stay that way ? And if not,
will this be the case later ?

- It obviously masks the real language setting. I don't know whether it is
used a lot or not yet (emphasis on "yet"). As the language is optional,
scripts have to rely on another way to change their localization anyway.
Through a dialog, a notecard or anything the creator can think of. The LSL
Wiki seems to concur : http://wiki.secondlife.com/wiki/LlGetAgentLanguage

- Unlike my current llOwnerSay() trick, any script is able to check the
version of the viewer as long as the avatar and the script are in the same
sim. The script does would not have to belong to the agent anymore. Good or
bad, I don't know yet.

- Is this a good idea at all ? As far as I checked, this is *the only way*
I've found to directly "upload" a string of chars to a sim and to share it
with a script through a synchronous LSL call. This is a dirty hack, though,
since it takes the place of a genuine feature.

- Would LL consider "extending" this kind of feature by allowing a viewer to
upload one custom string (not changed by the user), retrieved by another
call like this llGetAgentLanguage() function in the future ? Something along
the lines of llGetCustomString(key id) or llGetSignature(key id), maybe even
llGetOwnerSignature() that would only work for the owner of the script.


Thank you for your attention,
Marine
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.secondlife.com/pipermail/sldev/attachments/20090121/0b2934fc/attachment.htm


More information about the SLDev mailing list