Watermelon wrote:
The wz 'homebrew' scripting engine is very complex and powerful,and it's has been enhanced greatly by Troman.Maybe the major problem with it is the lack of helper functions and detailed error report messages(currently it just crashes/asserts without detailed info when encountering syntax errors in scripts) to make scripter's life easier.
Actually wz gives you more debugging info than most other games offer.
First of all you can compile wz with DEBUG_SCRIPT defined, it will give you detailed output when compiling the scripts. Even if this is not enabled wz outputs line number of the syntax error and token that caused it.
Maybe you just didn't enable script output?
When a runtime error occurs wz outputs a rather detailed info about the error.
I think speaking of helper functions you refered to functions like assert etc?
Right now we have:
Code: Select all
ASSERT(BOOL expression, STRING outputString, INT player);
If you call
Code: Select all
dbgMsgOn(INT player, BOOL bEnableDebugOutput);
with bEnableDebugOutput set to TRUE, it will make
Code: Select all
dbg(STRING debugMessage, INT player);
and ASSERT() output debug messages to the game console, handy when you debug scripts. Call dbgMsgOn() with FALSE and it will suppress all the debug output for release versions of a script.
will output strings directly to console no matter what, usually used for code functionality, like interaction with human players.
will output text to the stderr.txt.
Additionaly you can also use the newly added watch menu:
Code: Select all
setDebugMenuEntry(STRING debugString, INT slot)
You should first make it show up with:
That should probably suffice.
Once last glitches are gone and new functionality is officialy released documentation for the new functions will be available. Right now use it at your own risk as they say.