Convert Json database to another format and back

Using RMMV

I am trying to find a converter that can covert Json to another format and then back again without any errors.  I prefer CSV since I can change that into anything from mysql to excel without any problems. I have tried several converters I found online, however it doesn't convert back without spitting out major problems. I even tried looking for a Json editor that was similar to excel's formulas and functions to no avail. I have my trusty Notepad ++ and while it does allow some minor functionality with search replace functions its not near what I need.
CSV is a complicated format depending on your JSON.

Can you show an example of a JSON file you need converted?
I assume he wants the Json files generated by RPG maker MV to be converted.
I assume he wants the Json files generated by RPG maker MV to be converted.
Those can't be represented in CSV format.

XML could work, but I don't know if that's of any use for him.
Correct, map files, item files, etc that it creates in your \Project Name\data folder
Those can't be represented in CSV format.

XML could work, but I don't know if that's of any use for him.
XML possibly could work as long as it converts back without bugs. Its one of the few formats I didn't try.
I made a test here using an online converter, the only differences on the new JSON were:

1) a root element was created containing all the JSON data;

2) type information was lost, everything was turned into strings.
I did the same thing as well and this is what I got after removing the extras.

Code:
{"id":18,"name":"EV018","note":"","pages":[{"conditions":{"actorId":1,"actorValid":false,"itemId":1,"itemValid":false,"selfSwitchCh":"A","selfSwitchValid":false,"switch1Id":1,"switch1Valid":false,"switch2Id":1,"switch2Valid":false,"variableId":1,"variableValid":false,"variableValue":0},"directionFix":false,"image":{"tileId":0,"characterName":"Actor1","direction":2,"pattern":0,"characterIndex":6},"list":[{"code":0,"indent":0,"parameters":[]}],"moveFrequency":3,"moveRoute":{"list":[{"code":0,"parameters":[]}],"repeat":true,"skippable":false,"wait":false},"moveSpeed":3,"moveType":0,"priorityType":1,"stepAnime":false,"through":false,"trigger":0,"walkAnime":true}],"x":14,"y":10}
Code:
{"id":"19","name":"EV018","pages":{"conditions":{"actorId":"1","actorValid":"false","itemId":"1","itemValid":"false","selfSwitchCh":"A","selfSwitchValid":"false","switch1Id":"1","switch1Valid":"false","switch2Id":"1","switch2Valid":"false","variableId":"1","variableValid":"false","variableValue":"0"},"directionFix":"false","image":{"tileId":"0","characterName":"Actor1","direction":"2","pattern":"0","characterIndex":"6"},"list":{"code":"0","indent":"0"},"moveFrequency":"3","moveRoute":{"list":{"code":"0"},"repeat":"true","skippable":"false","wait":"false"},"moveSpeed":"3","moveType":"0","priorityType":"1","stepAnime":"false","through":"false","trigger":"0","walkAnime":"true"},"x":"14","y":"10"}
Seems like is using " where its not suppose too.
I did the same thing as well and this is what I got after removing the extras.
I could imagine a program that could properly convert between those json objects and some database or other queryable language, but maybe not CSV. It'd have to be RPGM specific though since it would need to have knowledge of events, properties, data structures, types, etc, to be of any use and that's really time consuming to get right.

Basically, you'd have to go through and do something like this for every "object" in RPG Maker MV's json:

Code:
public class Event {   private int _ID;   private string _Name;   private List<Pages> _Pages;   ...etc...   public string exportToJson() { ... }   public Event importFromJson() { ... }   public string? exportToWhatever() { ... }   public Event importFromWhatever() { ... }}public class Map { ... }public class Enemy { ... }public class Troop { ... }...etc...
Yeah I agree, I didn't know if someone had sat down and defined everything like that in a homemade parser. XML seems to be the best bet that also can be imported and exported out of Exel and Mysql. It seems the only problem is converting XML back to Json its frustratingly close but still needing a lot of data massaging to get it to open in RMMV which is too much for it to be worthwhile.
There is a plugin available for Notepad++ for viewing the JSON data in a hierarchical tree view, as well as a formatter...

A JSON viewer plugin for notepad++. Displays the selected JSON string in a tree view.

Author: Kapil Ratnani

Source: https://github.com/kapilratnani/JSON-Viewer

Homepage: http://nppjsonviewer.sourceforge.net/

Latest update: 1. Fixed display of UTF-8 characters.
Yeah I agree, I didn't know if someone had sat down and defined everything like that in a homemade parser. XML seems to be the best bet that also can be imported and exported out of Exel and Mysql. It seems the only problem is converting XML back to Json its frustratingly close but still needing a lot of data massaging to get it to open in RMMV which is too much for it to be worthwhile.
Yeah, I guess the plugin wizaerd linked above is the best way to go unless there's something real specific that you need to do that the editor doesn't support. What are you trying to make easier to do by converting from json to something else?
Why not use one of these 'w'')

http://www.jsoneditoronline.org/

http://jsoneditor.org/
I hadn't realized that all he wanted was to edit the JSONs.

Yeah, there's plenty of options for that.
You cant really do formula based equation's . Like field1 = field2 * 3 - 45 if field3 = 75 * field4 . I need to be able to manipulate data quickly instead of having to do over 10000 edits for balance and other purposes.


I have Notepad++ its amazing and have been using it for years the tree/format plugin I tried awhile back and is not what I needed ,but thank you.
You cant really do formula based equation's . Like field1 = field2 * 3 - 45 if field3 = 75 * field4 . I need to be able to manipulate data quickly instead of having to do over 10000 edits for balance and other purposes.

I have Notepad++ its amazing and have been using it for years the tree/format plugin I tried awhile back and is not what I needed ,but thank you.
Did you try to use that JSON with all the extra quotes? It's possibly that it may just work.

If it doesn't, your best chance is to commission someone to make you something. I've been planning a JSON editor with some additional features, but expressions aren't one of them.
Did you try to use that JSON with all the extra quotes? It's possibly that it may just work.


If it doesn't, your best chance is to commission someone to make you something. I've been planning a JSON editor with some additional features, but expressions aren't one of them.
I did its kicking it out the software must not be able to take them into account. There is also a few bits missing in it here and there. That's also just 1 event from a map file because the whole map.json would not convert to xml at all. I tried 2 events but it wouldn't convert to xml as well. It seems they used a different standard for their json format.


Expressions are so helpful, the game editor is actually better than anything else out there for reading and adding the data unless it had expressions built in. Like I said the only thing better than the editor is the find and replace on notepad++ but its very limited.

Original thread: https://forums.rpgmakerweb.com/threads/convert-json-database-to-another-format-and-back.49974/