Saving or loading multiple files?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Syl

Greets!

Is there a way? Cause i find it a bit tedious to select one by one my resources to load: got many many diferent tiles, and that’s a very long prospect ahead.

Fun!

:bust_in_silhouette: Reply From: oofman

You could use .json format as database and File.new() as file creation function. Example code from my project:
example write file

You can also add this script to global AutoLoad. Example from my project:
enter image description here

Then use all these functions anywhere you want:

onready var itemData:Dictionary = Global_DataParser.load_data("res://Database//items.json") # loads data from file to itemData variable
...
Global_DataParser.write_data("res://Database//items.json", itemData) # writes data to file
...
Global_DataParser.delete_file("res://Database//items.json") # deletes file

Thxs a lot, i’ll keep and check that on my project, though i’m not yet at the level of singleton and global data…

Cheers!

Syl | 2020-01-21 11:22