Convert Json database to another format and back

Badhabits

Villager
Member
Joined
Aug 29, 2014
Messages
14
Reaction score
1
First Language
English
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.
 

Hudell

Dog Lord
Regular
Joined
Oct 2, 2014
Messages
3,608
Reaction score
3,892
First Language
Java's Crypt
Primarily Uses
RMMZ
CSV is a complicated format depending on your JSON.

Can you show an example of a JSON file you need converted?
 

RyokuHasu

Developer
Regular
Joined
Jun 23, 2012
Messages
274
Reaction score
39
First Language
English
Primarily Uses
I assume he wants the Json files generated by RPG maker MV to be converted.
 

Hudell

Dog Lord
Regular
Joined
Oct 2, 2014
Messages
3,608
Reaction score
3,892
First Language
Java's Crypt
Primarily Uses
RMMZ
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.
 

Badhabits

Villager
Member
Joined
Aug 29, 2014
Messages
14
Reaction score
1
First Language
English
Correct, map files, item files, etc that it creates in your \Project Name\data folder
 

Badhabits

Villager
Member
Joined
Aug 29, 2014
Messages
14
Reaction score
1
First Language
English
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.
 

Hudell

Dog Lord
Regular
Joined
Oct 2, 2014
Messages
3,608
Reaction score
3,892
First Language
Java's Crypt
Primarily Uses
RMMZ
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.
 
Last edited by a moderator:

Badhabits

Villager
Member
Joined
Aug 29, 2014
Messages
14
Reaction score
1
First Language
English
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.
 
Last edited by a moderator:

JumbocactuarX27

Regular
Regular
Joined
Jan 11, 2013
Messages
86
Reaction score
40
First Language
English
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...
 

Badhabits

Villager
Member
Joined
Aug 29, 2014
Messages
14
Reaction score
1
First Language
English
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.
 
Last edited by a moderator:

wizaerd

Regular
Regular
Joined
Mar 13, 2012
Messages
219
Reaction score
28
First Language
English
Primarily Uses

JumbocactuarX27

Regular
Regular
Joined
Jan 11, 2013
Messages
86
Reaction score
40
First Language
English
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?
 

Hudell

Dog Lord
Regular
Joined
Oct 2, 2014
Messages
3,608
Reaction score
3,892
First Language
Java's Crypt
Primarily Uses
RMMZ
I hadn't realized that all he wanted was to edit the JSONs.

Yeah, there's plenty of options for that.
 

Badhabits

Villager
Member
Joined
Aug 29, 2014
Messages
14
Reaction score
1
First Language
English
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.
 

Hudell

Dog Lord
Regular
Joined
Oct 2, 2014
Messages
3,608
Reaction score
3,892
First Language
Java's Crypt
Primarily Uses
RMMZ
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.
 

Badhabits

Villager
Member
Joined
Aug 29, 2014
Messages
14
Reaction score
1
First Language
English
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.
 
Last edited by a moderator:

Latest Threads

Latest Profile Posts

ko dying.png
is it me or is the site just being really oof at the moment??? I'm sitting here like Ray waiting mad long for something to load lol.
Larvae.gif
They're larvae, not fightae, honest!
I've made a big emphasis on visually representing things to make the game as accessible as possible.

MP.png

Grimoires will consist of 5 - 10 pages of skills (still finalizing that max number)

Since each actor is able to take multiple actions per turn, each skill will cost 1-5 pages
This prevents more powerful skills from being uber spammed during an actors turn.
Cats are so easy. I noticed the gray one would never nap in the office while I worked, so I put a blanket on the spare chair in here and now she won't leave.
1701793108356.png
still work in progress, had not much time at the weekend^^

Forum statistics

Threads
136,774
Messages
1,269,759
Members
180,514
Latest member
Ikana
Top