Plan for debug/release script error reporting modes

Jump to: navigation, search

The current error reporting scheme causes some problems. Improvements to error reporting can cause games that previously ran smoothly to be interrupted with script errors.

  • First we will add a debug/release setting
    • This will default to "release" for all existing and new games (done)
    • This will be stored as 2 values in GEN. One will be the user-editable value, and the other will be the effective current value. This is needed so that the "Distribute Game" menu and the "Test Game" feature can temporarily override the setting and have a reliable and simple way to revert it to the game author's desired setting without risk of complications if the engine happens to crash during a temporary override (done)
  • Debug mode will enable the display of script error messages. Release mode will suppress the display of script error messages (although they will still be written to g_debug.txt) (done)
  • Debug/release mode can be toggled in the "Edit General Games Data" menu (done)
  • Games exported from "Distribute Game" will have "release" mode enabled (done)
    • There will be an option to override this
  • Games played through the "Test Game" menu will have "debug" mode temporarily enabled (done)
    • There will be an option to override this
  • Having separate script error levels is still useful to distinguish between minor and major errors. However the error levels for existing error checks is often unhelpful (due to now-obsolete backcompat where we didn't want newly added error checks to show anything. We can convert existing serrBound errors to serrBadOp.
  • There are heaps of commands that use bound(), converting invalid arguments into something valid. Error checking should be added to all of these. bound will continue to be used if the error is ignored.
  • Add new script error messages for anything we want, without worry!