Lazy question about saving

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Mystile1369
:warning: Old Version Published before Godot 3 was released.

Okay… to give a little explanation…
My game is menu based… planning to keep the progress in Globals for easy access throughout the different scenes.

Is there a simple way to “save current globals values” or “write to current globals file”? I’ve scoured the sites and have only the dictionary to json or parse to json to go from. being able to save directly to the global file would make things simpler… in the event that I haven’t found it yet. help?.

:bust_in_silhouette: Reply From: Aaron

According to the official documentation, saving is normally done by saving to and loading from json variables using to_json(),
parse_json(), and File.

When you say “Globals” are you talking about a script you have in your AutoLoad? Because such a script is no different from any other script save that it’s treated as a globally accessible singleton.

In a nutshell, there is no way to save and load a script’s state directly other than through json parsing that I’m aware of.