How can i save tiles?

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

I am trying to make a building game and i need to save tiles positions and load them from a file , they are from a tilemap
any ideas what i can do?

:bust_in_silhouette: Reply From: Lopy

You could use a File, save with save_file.store_line(JSON.print(…)), load with JSONParseResult().

Alternatively, you can save you values using a Resource. Create a script extending Resource, with exported variables to store your data. You then call to save it to disk, and load() to read it back.

You probably want to store your files inside the special user:// folder.