Godot Version
4.2
Question
Hi! So I have a todo list idea, I save data in an Array, each task saved is also an array containg a name, task and color. So an Array within an array and this is saved in a Custom Resource. Everything works great until I export the EXE file, then it would not write the data to the Resource file but only read from it. How could I read and write my Custom Resource or any other suggestions to get my data is welcome. Thank you in advance.
Instead of a resource, here are a some ideas
- Use an online database | This would be more difficult and require an online connection
- Save the data in the “user://” directory
- Use a dictionary and save a json and save in “user://”
The user directory exists on all platforms, windows, macos, ios, android, and linux
a dictionary example could be
var Tasks: Dictionary = {
"NewTaskName": {
"Color": "FFFFFFFF",
"TaskDetails": "Description of task here"},
"NewTaskName": {
"Color": "FFFFFFFF",
"TaskDetails": "Description of task here"},
"NewTaskName": {
"Color": "FFFFFFFF",
"TaskDetails": "Description of task here"}
}
As a dictionary you would be able to get a list of your tasks by name using Tasks.keys() which will return an array of each NewTaskName
1 Like