Hi,
I feel like I'm missing something when it comes to being able to save a game state.
For context I'm creating an app rather than a game. Which looks like this:
I want to be able to save the node graph and be able to have the user reopen different projects. This is what I've written so far as a save file:
extends Node
const SAVE_FILE = "user://save_file.save"
var g_data = {}
func save_data():
var file = FileAccess.new.call()
file.open(SAVE_FILE, FileAccess.WRITE)
file.store_var(g_data)
file.close()
func load_data():
var file = FileAccess.new.call()
if not file.file_exists(SAVE_FILE):
g_data = {}
I've tried following a couple tutorials but I just can't manage to get saving to work. Any help would be appreciated!