Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | SteeveDroz |
I have a world map that is generated from a PNG file. A script analyzes the picture and generates an autotile TileMap
based on the color of the pixels. The key point there is that the map is generated.
Now, I want to add some labels on it (place names and level entries). My first idea was to create a JSON file in which to store objects that look like this:
{
"tutorial": {
"name": "Tutorial Island",
"description": "Your journey starts here!",
"coordinates": {
"x": 94,
"y": 45
}
},
"beach": {
"name": "A hard way out of the sea",
"description": "After the shipwreck, it's time to find food and water",
"coordinates": {
"x": 117,
"y": 51
}
},
...
}
My problem is: how do I store those data?
- I tried putting them in a
.json
file, but it doesn’t seem to be recognized by Godot. I don’t want to open this file with an external program. If I have to, that means Godot is not intended to do that. - I then tried to put it in a
.tres
file, but Godot tries to read the content and it doesn’t match the expected format.
How can I store my custom data in a way that can be read by the script?
Not that it’s OK if I have to change the format, I don’t have shares in the JSON company ;-). I barely started filling the data and retyping a few words won’t be a problem.