Debugging & Development with IntelliJ/Webstorm

● ARCHIVED · READ-ONLY
Started by awhite 3 posts View original ↗
  1. I am new to the forums but I thought I would share how you can do RPG Maker MV Javascript debugging and development with IntelliJ Idea. This will allow you to actually run and debug your game outside of the RPG Maker application. IntelliJ is a top-of-the line IDE designed for Java but extendable to other languages via plugins.


    I am making this how-to somewhat platform agnostic so there may be OS specific paths or settings that need to be tweaked. Such tweaks should be minimum and obvious to users of the OS. 


    Prerequisites

    1. Download IntelliJ (Community Edition is free but somewhat limited, EAPs are beta releases but are pretty stable).
      Edit: Webstorm is IntelliJ optimized for Web/JS applications so you can/should use that instead if you are just doing RPG Maker development)
    2. Download NW.js - this is what RPG maker uses to launch Node.js apps inside a web-kit container locally
    3. In your game project's root directory create a package.json file with the following contents:

      {
      "name": "KADOKAWA/RPGMV",
      "main": "index.html",
      "js-flags": "--expose-gc",
      "window": {
      "title": "",
      "toolbar": false,
      "width": 816,
      "height": 624,
      "icon": "icon/icon.png"
      }
      }


      Note: these are probably flexible but this is the exact json used by RPG Maker. 



    Setup IntelliJ


    Note: If this is your first time launching IntelliJ there may be some setup wizards to walk through. You should be able to accept the defaults. 

    1. Preferences -> Plugins -> Browse Repositories -> NodeJS -> Install -> Restart IDE
    2. File -> Open -> Select your game root directory
    3. Run -> Edit Configurations -> "+" (top left hand corner) -> Node-Webkit

      Name: Your Game Name
    4. Node-Webkit App: game root directory
    5. Working Directory: game root directory
    6. Node-Webkit Interpreter: path to nwjs that was installed above (on OSX for example you may use /Applications/nwjs.app/Contents/MacOS/nwjs)
    7. Ok

    [*]Now you can either Run -> Run "Game Name" or Debug "Game Name"




    Now you should be able to launch and debug your game with a power and flexible IDE. IntelliJ has a number of features that make it ideal for Javascript development over other editors and it's debugging tools are far superior to the standard Chrome Dev Tools for most tasks. 
  2. I use WebStorm. How can I set up a breakpoints?
  3. did you try on Microsoft Visual Studio Code.
    i find has NodeJS plugin
    thanks for this tips