Command Error Backtrace MV
A downloadable plugin
This is a small plugin that adds Command list stack traces to error messages in RPG Maker MV. The traces include the location and line number of the failing Command, as well as those of each calling Command, in order from most- to least-specific.
This plugin is available free of charge, but if it proves to be useful, please do consider supporting me, whether by tipping a few dollars or by spreading the word about this and/or my other plugins and tools.
Resolved Command Lists
Command lists defined in the following places are resolved into human-readable locations automatically:
- Common Event n (<name>)
- Map n (<name>), Event m (<name>), Page o
- Troop n (<name>), Page m
If the name can't be determined, "unknown Command list" is displayed instead.
If an error happens while trying to determine the Command list name, that error is ignored and "(failed finding Command list)" is displayed instead.
This plugin does not add additional commands.
All parameters are configured with in-editor types and help text.
Custom Error Screen
(boolean, default: true)
Replaces the error screen layout with a custom one that makes it easier to read the Command stack trace (see screenshot) and adds clipboard functionality.
Clicking the error first tries to use the browser clipboard API to copy the error name and message directly. If this fails (for example when running in RPG Maker MV's NW.js version with Chromium 65 or on a website not served via HTTPS), the text is instead shown and automatically selected inside a
<textarea> HTML element.
The text wraps and vertical scroll bars are shown as needed in either presentation.
As this feature uses private RPG Maker APIs, caution is advised for engine upgrades.
Show names in deployed game?
(boolean, default: false)
When playtesting from the editor, Command Error Backtrace will automatically insert the in-editor name of items mentioned in the trace, where available. In deployed games, this information is hidden by default (but still present in the game files, as normal).
Using this parameter, you can make the in-editor names available in the stack trace also outside of "playtest" mode, to players of your released game.
You can set the property
TSCommandErrorBacktrace_listName on either the executing
Game_Interpreter instance or on the Command list data array itself to provide a custom Command list name for the stack trace. If both are present, the latter takes precedence.
When generating a custom list name, you can use this snippet to decide whether to include in-editor-only information:
const showNames = ($gameTemp.isPlaytest() || PluginManager.parameters('TS_Command_Error_Backtrace').showNamesInDeployedGame === "true");
This plugin was tested on RPG Maker MV 1.6.2, and makes use of private RPG Maker API functions. Please include the error screen in any engine upgrade tests, and please make sure to report any issues!
Click download now to get access to the following files:
- ChangelogMay 06, 2022
Leave a comment
Log in with itch.io to leave a comment.