A downloadable plugin

Download NowName your own price

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 only works for Errors caused directly by Command execution. For any other error, you will still have to rely on the JavaScript stack trace in the browser console (F12 while testing).

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.

Commands

This plugin does not add additional commands.

Parameters

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.

JavaScript API

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");

Compatibility Notes

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!

f you develop on Windows and deploy for Linux, you must first update the NW.js runtime in the nwjs-lnx folder to at least version 0.29.4 (to match other targets, but ideally use the newest stable version)! You can find more information and a tutorial for this here. It's fast, easy, and also fixes many other problems for your players.

StatusReleased
CategoryAssets
Rating
Rated 5.0 out of 5 stars
(1 total ratings)
AuthorTamschi
Made withRPG Maker
Tagsdebugging, plugin, RPG Maker
Average sessionA few seconds
LanguagesEnglish
LinksImprint / Impressum, Support

Download

Download NowName your own price

Click download now to get access to the following files:

TS_Command_Error_Backtrace.js 9 kB
Version 1.0.1

Development log

Leave a comment

Log in with itch.io to leave a comment.