- Download and install VS Code.
- Type Ctrl + Shift + P and type Install extensions.
- Select Debugger for NWjs and click Install.
- Type Ctrl + Shift + P and type NWjs and select NWjs Install from the dropdown menu.
- Select File from the menu and Open Folder and choose a folder where your RMMZ project is stored.
- Go to Run -> Add Configuration, then select NWJs from the dropdown menu.
- Add a configuration to launch.json. launch.json should look something like this afterwards:
{ "version": "0.2.0", "configurations": [ { "type": "nwjs", "request": "launch", "name": "Launch NWjs", "nwjsVersion": "any", "webRoot": "${workspaceFolder}", "reloadAfterAttached": true }, { "type": "nwjs", "request": "attach", "name": "Attach to NWjs", "port" : 9222, "webRoot": "${workspaceFolder}", "reloadAfterAttached": true } ] }
- Backup packages.json and then change chromium-args to the following value
"--remote-debugging-port=9222"
Every time you open your RMMZ project, package.json will be overwritten, so keep a copy of your file with the debugging port handy. - Now go to the Run and Debug tab (CTRL + SHIFT + D) and change Launch NWjs to Attach to NWjs in the upper left corner.
- Now, start Playtest in RPG Maker MZ. Check if package.json is still correct and then press the play button next to Attach to NWjs. (In the future, you can start the debugger by pressing F5.)
Original Blog Post for RPG Maker MV: https://forums.rpgmakerweb.com/index.php?threads/debug-rmmv-plugins-with-vs-code.99980/