I don’t know what title to type in so there’s that.
I have been tinkering with the File System in GDevelop 5, especially for saving a data in a specified folder. My game would save certain data into a JSON file and it works really great.
However, it seems that I am unable to recreate this interface (see image) where a list of your previously saved JSON files in a specified folder would automatically appear (potentially as a Text Object) when players want to load a saved game. This is really useful especially for a large map open-world game with lots of information.
I’m probably reaching here but there aren’t any actions/expressions which act similar to “scan” the specified folder for a saved files with matching file extensions (e.g. “.sav”), so I could code them to appear as a Text Object.
FYI: I am not trying to create save slots, but a loading/saving system similar to the image I’ve referenced. Any tips would be appreciated.
Is it actually possible? Thank you
I’m not sure if there was any answer given to this, but I am still looking to do exactly the same thing, and running into the same issues. I need my players to be able to select a save file to continue from, and even if there are limits to how many I would be fine - but right now, I can’t figure out a way to list all the files in a directory even just in text. Did you ever find a solution?
Nope. I ended up creating the usual saving system using storage actions/conditions.
It looks like there is a read directory action now, under the asynchronous folder in the file system actions. It takes all the subfolders and files and stores them in an array. I imagine you could then iterate over the array, remove any strings that don’t contain your save file extension, and populate the list of saves from there. I don’t see it listed on the wiki page for file system actions, and not sure when it was added.
1 Like
Ah, nice. Thank you for the info. Appreciate it. Someone needs to update the documentary for this.