I'm trying to design a dialogue system, and I believe I'd prefer to use JSON over XML. I feel like I need the ability to use nested structures, but from what I understand C2 supports a limited dialect of JSON which can be seen when using the Download action on Arrays and Dictionaries.
It appears I can get nesting in XML, so I will use it as a last resort.
scirra.com/tutorials/354/xml-parsing
However, if anyone knows how one could load the following JSON dialogue and parse it let me know. I tried loading it into a Dictionary but it never worked for me.
Also, here's a link explaining why JSON is better than XML: json.org/xml.html
{
"fallingFromTheMountain001": {
"normal": {
"blocks": [
{
"portrait": "Kain",
"text": [
"I'm fine, thank you..",
"You know you really didn't have to do all of this.."
]
},
{
"portrait": "Tellah",
"text": [
"Oh no worries at all. A life is a valuable thing.",
"I'm just glad these old bones were still up to such a task, haha.",
"So tell me, why were you trying to climb that mountain?"
],
"options": [
{
"response": "It's none of your business.",
"goto": "fallingFromTheMountain002",
"type": "wary"
},{
"response": "Something terrible happened there..I'm looking for answers.",
"goto": "fallingFromTheMountain002",
"type": "normal"
}
]
}
]
}
},
"fallingFromTheMountain002": {
"normal": {
"blocks": [
{
"portrait": "Tellah",
"text": [
"Oh? Well then take this..."
],
"itemGet":"OldCaveKey"
}
]
},
"wary": {
"blocks": [
{
"portrait": "Kain",
"text": [
"I don't know who you are and there are people after me for what I know.",
"So I don't trust you yet."
]
},
{
"portrait": "Tellah",
"text": [
"Fine by me. Take as much time as you like."
]
}
]
}
}
}