Topic was automatically imported from the old Question2Answer platform.
Asked By
Amateur.game.dev.
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?
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 = File.new()
file.open("user://savegame.json", File.WRITE)
var json = to_json(data)
file.store_line(json)
file.close()
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.