Modding Help PSA: If your mod has bugs/crashes, make sure to validate your JSON first

Discussion in 'Starbound Modding' started by Remalis, Dec 18, 2013.

  1. Remalis

    Remalis Aquatic Astronaut

    First, for those that don't know, JSON (JavaScript Object Notation) is what all the text files (besides the Lua scripts) in the assets folder are written in. It's not a programming language, it's simply a way of formatting information in a text file. As such, JSON has a very specific syntax, and one misplaced comma or square bracket can cause all manner of problems in the game (i.e. crashes, unexpected warps back to ship, etc.).

    There are a few websites that will check to ensure that text input is valid JSON (like this one: http://jsonlint.com/). It will tell you if your JSON text has some kind of syntax problem, and if so, around where the problem occurs. That validator is not perfect; It has problems with really long files in that it seems to cut off at a certain point, but in most cases it should be fine.

    As a side note, make sure to check starbound.log in the Starbound folder if you get a crash, unexpected ship warp, or anything similar and want to know which file caused it. It will probably have a lot of text, but look in particular for things that say "exception" or talk about unreadable/unloadable JSON files.

    More information on JSON can be found at www.json.org.

    I hope this made sense and can help some people. Anyway, happy modding!
     
    justmary828 and Mezzolan like this.

Share This Page