Yes, I've been following that specific documentation this whole time.
I checked the save file the code generates and it does, in fact, save all the variables.(I just didn't realize they were out of order from my listed dictionary.)
But it's still not loading the variables. It just kind of resets everything. He's the script i'm using:
func _load_game():
var save_game = File.new()
if not save_game.file_exists("res://savegame.save"):
print("error, dont have a file to load")
return
var save_nodes = get_tree().get_nodes_in_group("Persist")
for i in save_nodes:
i.queue_free()
save_game.open("res://savegame.save", File.READ)
while save_game.get_position() < save_game.get_len():
var node_data = parse_json(save_game.get_line())
var new_object = load(node_data["filename"]).instance()
get_node(node_data["parent"]).add_child(new_object)
new_object.translation = Vector3(node_data["pos_x"], node_data["pos_y"], node_data["pos_z"])
for i in node_data.keys():
if i == "filename" or i == "parent" or i == "pos_x" or i == "pos_y":
continue
new_object.set(i, node_data[i])
save_game.close()