Debugging and writing logs

Discussion in 'Javascript/Plugin Support' started by swquinn, Oct 24, 2015.

  1. swquinn

    swquinn Villager Member

    Messages:
    6
    Likes Received:
    2
    Does RPG Maker MV have any means of writing information out to a console, a log, or something?

    Ideally, even if it weren't baked in, the ability to write to the file system (especially if NodeJS is being leveraged) would be great. Can anyone shed some light on this?

    Thanks!

    ---------------------------------------------------

    Update (2015/10/24):

    If you're running your game from the Playtest option within RPG Maker MV, while the game is running you can hit F8 to bring up a developer console window (similar to Chrome's) that you can use to inspect the game and view console messages.
     
    Last edited by a moderator: Oct 25, 2015
    #1
    Traveling Bard likes this.
  2. Shaz

    Shaz Veteran Veteran

    Messages:
    37,809
    Likes Received:
    11,519
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    Look in the help file under Local Server Setup
     
    #2
  3. Zalerinian

    Zalerinian Jack of all Errors Veteran

    Messages:
    4,695
    Likes Received:
    923
    Location:
    The Internet.
    First Language:
    English
    Primarily Uses:
    N/A
    Yes, JavaScript provides multiple ways to print to the console. The most basic is console.log:

    console.log("This is printed out!")There are also several other functions that provide slightly different information.

    • console.error will print the given text, highlighted in red with a stack trace (a list of function calls in reverse order so you can see how the program specifically got to where it is at this point).
    • console.trace will print the given text with a stack trace, but it won't have a red background.
    • console.warn will print the given text, highlighted slightly yellow, with a small warning icon.
     
    #3
    Jonforum likes this.
  4. swquinn

    swquinn Villager Member

    Messages:
    6
    Likes Received:
    2
    Thanks for the replies, I'm familiar with JavaScript but I wasn't certain how much of the language was made available within RPG Maker, especially for a non-browser based client.

    I'll take a look at using console to see if it fits my needs (worse case scenario I can leverage it via the browser for my needs), and I'll look at the server setup guide as well! Thanks again.

    As a side note, it looks like RPG Maker MV does provide access to some of the NodeJS modules, like the File System (fs) module. It isn't clear to me yet how much of that module I can actually use. It would be great to write logs to a file, but so far I haven't been able to actually use it to write to the file system.

    Cheers.
     
    Last edited by a moderator: Oct 24, 2015
    #4
  5. Hendrik

    Hendrik Villager Member

    Messages:
    38
    Likes Received:
    1
    First Language:
    German
    Someone knows how i can open the developer tools?

    F12 doenst work.

    Im using the mac version.

    Nevermind that. Truly with a local webserver you can read all the errors. The only drawback seems to be

    that theres no savegames available.
     
    Last edited by a moderator: Oct 24, 2015
    #5
  6. Hudell

    Hudell Dog Lord Veteran

    Messages:
    3,323
    Likes Received:
    2,963
    Location:
    Brazil
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    Why not? Mine saves properly here.
     
    #6
  7. Hendrik

    Hendrik Villager Member

    Messages:
    38
    Likes Received:
    1
    First Language:
    German
    I mean the savegames saved from the editor during testplay.

    The browser saves and read the files using the localStorage.
     
    #7
  8. Shaz

    Shaz Veteran Veteran

    Messages:
    37,809
    Likes Received:
    11,519
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    @Hendrik, please do not hijack someone else's threads with your own unrelated questions.  Please start a NEW thread to ask your own questions.  Thanks :)
     
    #8
  9. swquinn

    swquinn Villager Member

    Messages:
    6
    Likes Received:
    2
    So, while looking through other threads I stumbled across a comment that I must have missed in the documentation (I will add this to the first post so people don't miss it, just in case).

    In order to assist with debugging and the output to the console log, if you're running your game from the Playtest option within RPG Maker MV, while the game is running you can hit F8 to bring up a developer console window (similar to Chrome's) that you can use to inspect the game and view console messages.

    Of course if you are running within a browser, you should be able to use the full browser's developer tools support for debugging.
     
    Last edited by a moderator: Oct 25, 2015
    #9
  10. Shaz

    Shaz Veteran Veteran

    Messages:
    37,809
    Likes Received:
    11,519
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    Running in a browser, F12 is the key to hit to bring up the developer tools.  Or at least it is in Chrome.
     
    #10
  11. swquinn

    swquinn Villager Member

    Messages:
    6
    Likes Received:
    2
    Correct, I should have clarified that, for the browser you'd want to use the F12 key.

    However if you are running the stand-alone client from the RPG Maker MV editor, the game window that is launched will respond to the F8 key, bringing up a (Node-Webkit) developer tools console there as well. Which is remarkably convenient for non-browser based testing.
     
    Last edited by a moderator: Oct 25, 2015
    #11

Share This Page