Could someone help me with saving/loading please

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

I have looked at many tutorials on saving/loading but can’t quite get my head around it. Also, my game is a 2D RPG so there are many factors to save (health, level, hair colour, hair type, stamina, mana etc). Could someone please provide some script which could help me or possibly explain the process more simply?

:bust_in_silhouette: Reply From: Help me please

I think it would be a nice tutorial for you. Try seeing from Save File Data.
In it first the data which needs to be stored is converted into a dictionary. And then that dictionary is converted into a json file by using

var file ="user://savegame.json", File.WRITE)
	var json = to_json(data)

Where data is a dictionary which contains all the information which needs to be stored.
Reading the file is hard to explain here so it would be nice if you see up the tutorial. Just see how the player’s data is saved.