These forums are CLOSED. Please visit the new forums HERE
Proposed change to llSay |
|
Cory Linden
Linden Lab Employee
Join date: 19 Nov 2002
Posts: 173
|
09-29-2004 13:51
llSay, llWhisper and llShout currently generate a script error if the text sent to them exceeds the max chat length of 255 bytes. I'd like to change that behavior to instead truncate the text to 255 bytes and to then say that text. Any objections?
|
Francis Chung
This sentence no verb.
![]() Join date: 22 Sep 2003
Posts: 918
|
09-29-2004 14:18
No, I prefer that my script crashes.
Just kidding. Works for me. _____________________
--
~If you lived here, you would be home by now~ |
Psyra Extraordinaire
Corra Nacunda Chieftain
![]() Join date: 24 Jul 2004
Posts: 1,533
|
Mmm. I will hug Cory for this, yes.
09-29-2004 14:38
... just before I devour Cory's brainpan.
I love this idea. Go with it. Er, the feature implementing, that is. [Though eating brainpans doesn't sound too shabby either...] ![]() I make occassional sentance-fragment-combining scripts. Knowing that instances of 256+ character randomizes will NOT crash it is Happy News. ![]() _____________________
E-Mail Psyra at psyralbakor_at_yahoo_dot_com, Visit my Webpage at www.psyra.ca
![]() Visit me in-world at the Avaria sims, in Grendel's Children! ^^ |
Ace Cassidy
Resident Bohemian
![]() Join date: 5 Apr 2004
Posts: 1,228
|
09-29-2004 14:40
Unlike other recent behavior changes to some LSL functions, this won't break any existing scripts, and might even fix a few.
Go for it... - Ace _____________________
"Free your mind, and your ass will follow" - George Clinton
|
Moleculor Satyr
Fireflies!
![]() Join date: 5 Jan 2004
Posts: 2,650
|
09-29-2004 18:03
I like.
HOWEVER, please PLEASE somehow alert the coder, user, or someone that this is occuring? Maybe make the alert a llSetStatus feature or something? Either by channel 0 warnings or IMs or something? _____________________
</sarcasm>
|
Rysidian Rubio
Ruby Red Head
![]() Join date: 14 Jan 2004
Posts: 263
|
09-29-2004 19:54
I Agree with Mole! Please alert the owner that this is hapenning! an IM might work best to stop chat spam.
Simply truncating the string with no warning would definately cause me some issues with a few games I'm working on. |
Strife Onizuka
Moonchild
![]() Join date: 3 Mar 2004
Posts: 5,887
|
09-29-2004 22:02
Yes a llSetStatus flag would be a good idea (for showing warnings)
I don't see a good reason not to implement this. Makes life simple. Would there be a way for the script to catch the warning as well? Maybe an event? Or make llSay() return an integer equal to the number of letters it chopped off. then you could right something like to dump entire strings with little hastle. CODE
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river. - Cyril Connolly Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence. - James Nachtwey |
Wednesday Grimm
Ex Libris
![]() Join date: 9 Jan 2003
Posts: 934
|
09-30-2004 07:59
I think the ability to turn warnings on in general would be neat, but not necessary in this instance. Nor do I think it's necessary to change the return type of llSay (knowing nothing about the LSL bytecode, I boldly predict that this would break all already compiled scripts that use llSay).
If you have the possibility of your messages going over 255 characters, it's easy to break up the message. _____________________
Sarcasm meter:
0 |-----------------------*-| 10 Rating: Awww Jeeze! |
CrystalShard Foo
1+1=10
![]() Join date: 6 Feb 2004
Posts: 682
|
09-30-2004 08:10
llShowWarnings(TRUE) ? I'd go with it.
Other then that, the llSay sounds good. Go gadget go. |
Samhain Broom
Registered User
![]() Join date: 1 Aug 2004
Posts: 298
|
09-30-2004 08:33
If a function like llSay() were to return an error, it might really be nice to see a line number of the offending command.
_____________________
rm -rf /bin/ladden #beware of geeks bearing grifts
|
Azelda Garcia
Azelda Garcia
Join date: 3 Nov 2003
Posts: 819
|
09-30-2004 11:31
I agree with Wednesday (I think). Truncate llSay silently. Add a warning feature to Possible Future Enhancements. I'm fine with having cookies and eating them, I dont need chocolate gateau
![]() Azelda _____________________
|
Siro Mfume
XD
Join date: 5 Aug 2004
Posts: 747
|
09-30-2004 12:22
integer stringlength = llStringLength(message);
llSay(0, message); Adding error catching code should be your imperetive when designing your code. llSay does not need error catching code when so simple a debug is readily available. I'm all for having it truncate silently. heck even this snippet of code solves the problem without patching it: CODE
|
Rickard Roentgen
Renaissance Punk
![]() Join date: 4 Apr 2004
Posts: 1,869
|
09-30-2004 16:50
if you think some text might get too long and you just want to cut it off before it errors.
llSay(0, llGetSubString(message_text, 0, 254)); this will just cut it off if it is over 255 characters, otherwise nothing changes. doesn't require an if, doesn't add to your mem overhead much, and doesn't even require extra lines. edited: oh ya, if you lindens want to just integrate that functionality into the llSay,Shout,Whisper stuff, that's good. I'm for it. |
Eggy Lippmann
Wiktator
![]() Join date: 1 May 2003
Posts: 7,939
|
10-02-2004 13:00
Originally posted by Strife Onizuka make llSay() return an integer equal to the number of letters it chopped off. then you could right something like to dump entire strings with little hastle. CODE
Yes please, this is a great way to do it. _____________________
|
Cory Linden
Linden Lab Employee
Join date: 19 Nov 2002
Posts: 173
|
10-02-2004 14:23
As some of you correctly guessed, changing the return type is a problem. Also, as has been posted elsewhere, we're really focused on bug fixes only right now, so I'm going to truncate llSays and put better warning controls on to the future enhancement page.
|
Hank Ramos
Lifetime Scripter
![]() Join date: 15 Nov 2003
Posts: 2,328
|
10-02-2004 23:20
Sounds good to me. Better to have the SL servers ignore script errors since we have no way to handle or recover from such errors, so I'd say ignore all errors until we get error handling. In the case of llSay, just truncate it. If you exceed the number of characters, tough nuggies.
![]() |
Siro Mfume
XD
Join date: 5 Aug 2004
Posts: 747
|
10-03-2004 12:12
Much of the problem with warning messages associated with a function performing some kind of corrective action is unless a way is built in, we have no way of turning the warning off. This is why I earlier suggested writing your own warning code as part of debugging. Once you have your programming functioning in a set pattern, you no longer need any warnings and can remove the code.
|
Strife Onizuka
Moonchild
![]() Join date: 3 Mar 2004
Posts: 5,887
|
10-03-2004 13:23
Originally posted by Siro Mfume Much of the problem with warning messages associated with a function performing some kind of corrective action is unless a way is built in, we have no way of turning the warning off. This is why I earlier suggested writing your own warning code as part of debugging. Once you have your programming functioning in a set pattern, you no longer need any warnings and can remove the code. SHHHH the more work that is automaticly done by the server will speed things up with minimal loss for us. So if they want to make our lives easy for us that just fine with me ![]() consequently could we get float-integer union commands? it's such a hastle to build them on our end ^_^' _____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river. - Cyril Connolly Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence. - James Nachtwey |
Siro Mfume
XD
Join date: 5 Aug 2004
Posts: 747
|
10-03-2004 20:32
well I'm saying that it's temporary work... you don't NEED to do it in your script at all once you have it working right... I mean, do you really leave your debug messages up and running in scripts you sell? I don't. I would think any extra load on the server would be exactly that, an extra load. One which is unwarranted.
|
Strife Onizuka
Moonchild
![]() Join date: 3 Mar 2004
Posts: 5,887
|
10-03-2004 21:13
IMHO coping only 255 characters is easier then stopping a script.
depends on the script and if i give them rights. I usualy strip most debugging comments and comment out most debugging. So it's hit or miss on how many comments are in the code. Only the biggest projects usualy have comments left in them. Small projects like here just don't really need them. They do require instuctions for setup (that would be best placed in a notecard). but ehhh, doesn't really matter. A status flag would be great for doing this. _____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river. - Cyril Connolly Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence. - James Nachtwey |
Carnildo Greenacre
Flight Engineer
Join date: 15 Nov 2003
Posts: 1,044
|
10-05-2004 23:45
How about truncating to 254 characters and adding an ellipsis on the end? That would indicate to the scripter that the output has been truncated, without requiring major changes to anything.
_____________________
perl -le '$_ = 1; (1 x $_) !~ /^(11+)\1+$/ && print while $_++;'
|
Huns Valen
Don't PM me here.
![]() Join date: 3 May 2003
Posts: 2,749
|
10-07-2004 10:49
Absent error handling, it's not a bad idea. It would be good to have it say() a warning rather than silently truncating the string. Having the script crash because of a chat overrun is definitely not so great.
_____________________
|
Rickard Roentgen
Renaissance Punk
![]() Join date: 4 Apr 2004
Posts: 1,869
|
10-07-2004 14:57
wait a second, changing a return type is a problem... ADDING a return type shouldn't be. Since llSay, llShout, llWhisper currently return nothing, having them return an int won't break scripts. Look at llListen, it returns and int, and a lot of people ignore that return value
![]() llGetNotecardLine(...); works as well as... key query; query = llGetNotecardLine(...); |
Morgaine Dinova
Active Carbon Unit
![]() Join date: 25 Aug 2004
Posts: 968
|
10-07-2004 15:33
Guys, the LSL way of raising exceptions is to trigger an event.
![]() By all means issue a warning before destroying data, that's very sound engineering. But send the warning in an event (which everyone except us programming nutters can ignore), and then we can do useful stuff with it if we wish, and do it rapidly without needing to poll any silly status flags (which have to be reset, yay). That's old technology. Events are efficient. That's good for everyone. _____________________
-- General Mousebutton API, proposal for interactive gaming
-- Mouselook camera continuity, basic UI camera improvements |
Strife Onizuka
Moonchild
![]() Join date: 3 Mar 2004
Posts: 5,887
|
10-08-2004 07:03
Guys, the LSL way of raising exceptions is to trigger an event. ![]() By all means issue a warning before destroying data, that's very sound engineering. But send the warning in an event (which everyone except us programming nutters can ignore), and then we can do useful stuff with it if we wish, and do it rapidly without needing to poll any silly status flags (which have to be reset, yay). That's old technology. Events are efficient. That's good for everyone. In a normal system an error event would be an interrupt. The problem with raising an event is that it would be added to the end of the event que. So it would be practically impossible to catch the error and make a custom handler for it. Just having the chat commands return the number of characters they chopped off is the easiest solution for all parties involved. Again i will say a status flag would be well worth it to enable/disable any runtime warnings. _____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river. - Cyril Connolly Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence. - James Nachtwey |