llDialog Message Length
Raime Crisp
It'd be great to allow a message length greater than 512 characters. However, at a minimum, right now a message length greater than 512 characters both throws up a debug error AND causes the script to stop running. Is this really world breaking behavior that must be stopped? Maybe instead throw up the error, truncate the message, and allow the script to continue operating?
Log In
Andromeda Quonset
Whatever the limit is, it really should simply truncate the message. and keep running. Having it display a error on the error channel would be annoying.
The LSL Wiki for llDialog says, and I paste from that: "message must be fewer than 512 bytes in length and be not empty. If it is empty, llDialog will shout "llDialog: must supply a message" on the DEBUG_CHANNEL. If you want to create an empty message, however, you can do it legally by using a line feed as your message, as in
llDialog(avatar_key," \n",button_list,dialog_channel);
If the message length is greater than or equal to 512 bytes, it shouts (again on the debug channel): "llDialog: message too long, must be less than 512 characters"; in both instances, the dialog box will not be created for avatar."
For the somewhat-similar llTextMessage, the wiki says: message must be less than 512 bytes and not empty. Otherwise, it will shout an error on DEBUG_CHANNEL.
I am aware of the variable byte nature of UTF8. However, I assume that the backend has been written so that a character in this context is always only using a single byte. If that is incorrect, it really should be explicitly documented. And probably changed.
Lucia Nightfire
FWIW, llDialog() is limited to 511 bytes, not 512 characters.
That said, I am all for the function truncating and not causing a hard error.
Bavid Dailey
workaround might be to write a jacket script that calls LLDialog with llSubString(msg, 1, 512) . It can even be done as FS #define i suspect
Lucia Nightfire
Bavid Dailey
Since communication strings in SL are all UTF8, whose characters can be 1-4 bytes, you'll need to use a function similar to the Truncate To Length UDF in https://wiki.secondlife.com/wiki/Combined_Library instead of substringing or you risk a script error occurring.
Bavid Dailey
Lucia NightfireYou're absolutely right, thanks