I would like to request the following:
1) a command to insert a debugging note of the scripter's choice, but prefixed with useful information such as the script, state & event / custom function, and line number. It would chat privately the same way llOwnerSay() does.
Example usage in a script:
llDebugSay("At this point we are switching modes.")
Output would look like:
[12:18:33] Test Object: DEBUG [NewScript, default, state_entry (43)]: At this point we are switching modes.
Since custom functions are defined prior to the start of the default state, and a function always takes at least the form of functionname(), it should be possible for the compiler to identify the name of the function and use that instead of the state & event, as follows:
// this is a custom function that does something
string customfunction( integer foo string bar )
{
... a bunch of code...
llDebugSay("At this point the framistan should have blogulated.");
... more code...
return somestring;
}
Output would look like:
[12:18:33] Test Object: DEBUG [NewScript, customfunction() (12)]: At this point the framistan should have blogulated.
Everything from (and including DEBUG) to the colon after the square bracket should be generated by the function itself, not something the scripter has to type in.
2) a command to insert a debugging variable dump of specified variables (up to a reasonable maximum; if more are needed, scripter can always use a second command). It would be able to report any variable known to the script scope at that point. Again, it would chat privately the same way llOwnerSay() does.
Example usage in a script:
llDebugVarDump([MENU_TIMEOUT, ModifiedColorVal, collar_prefix]);
Output would look like:
[12:18:33] Test Object: DEBUG variable dump:
MENU_TIMEOUT: type=float, value= 15.0
ModifiedColorVal: type=vector, value=<0.72,0.2,1.0>
collar_prefix: type=string, value=rh
3) A command or meta-variable or script editor command to enable/disable those commands. The idea is that it would not be necessary to remove the llDebug* commands; they simply would not execute UNLESS a box was checked (similar to the □Run and □Mono checkboxes), or there was a command that had to be the VERY FIRST executable line (so it could follow a bunch of comments, but would have to be before ANY variable declarations, function definitions, or start of the default state); something like this:
// initial comments in script
DEBUG; // all llDebug* commands will function
If that line with the one word, DEBUG, was absent, all llDebug* commands would be treated as comment lines, possibly even to the extent of being coloured the same as comments. If this 3rd part isn't possible, at least the other two commands could be easily found and deleted or commented out just by searching for llDebug