Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | blueSuedeShoes |
I have the following JSON
[{
"id": 1,
"npc": "man",
"dialogue": ["Oh, hello I didn’t see you there”, “Perhaps we can talk later?"]
}]
And parsing it through as so
var file = File.new()
file.open("res://data/dialogue/man_dialogue_eng.json", file.READ)
var raw_text = file.get_as_text()
var json = JSON.parse(raw_text)
file.close()
dialogue_raw = json.result[0]["dialogue"]
print(dialogue_raw)
dialogue = dialogue_raw[page]
When in game, it seems to return not as an array with two entries - just one long, combined string:
Oh, hello I didn’t see you there”, “Perhaps we can talk later?
Why might this be?