I need help parsing a json file into different dictionaries. The json file contains a a [] root with a number of {} structures, in which there is the data I want to parse to dictionaries.
So in essence I want to create a dictionary of startDialog1, node 2 and so on.
Alternatively they can be parsed to a single dictionary that contains all these subdictionaries.
[
{
"title": "startDialog1",
"tags": "",
"body": "Starting here bla bla bla\nthis is a new line blah blah blah\n[[|node2]]",
"position": {
"x": 236,
"y": 175
},
"colorID": 0
},
{
"title": "node2",
"tags": "",
"body": "this is continuing from last time\nblah blah blah 2\nend",
"position": {
"x": 555,
"y": 150
},
"colorID": 0
},
{
"title": "dialogue2",
"tags": "",
"body": "blah blah dialogue 2 starts here\n[[|dialog2node2]]",
"position": {
"x": 238,
"y": 424
},
"colorID": 6
},
{
"title": "dialog2node2",
"tags": "",
"body": "dialogue2 continues here\n[[|node4]]",
"position": {
"x": 554,
"y": 416
},
"colorID": 0
},
{
"title": "Node4",
"tags": "",
"body": "end of dialogue 2",
"position": {
"x": 817,
"y": 408
},
"colorID": 0
},
{
"title": "Node5",
"tags": "",
"body": "Empty Text",
"position": {
"x": 788,
"y": 143
},
"colorID": 0
}
]
How do I do that??
In this case I am trying to write a parser for YARN:
https://github.com/InfiniteAmmoInc/Yarn
If I get it to work , I will share all the code on github.