-
Notifications
You must be signed in to change notification settings - Fork 0
General Usage
- Download the most recent release
- Copy the
addons/savedata-dx
directory into your project'sres://addons/
directory - Enable under Project Settings -> Plugins
After installing the plugin, a new menu will be added in the top bar with your other editor screens. This menu has three main modes, each can be selected in the top-left corner of the UI. Each mode will be detailed below.
This mode is used to view and modify your save data. All data saved using this plugin is encrypted, making it not work with a standard text editor. This helps prevent the end-user from breaking their save file. To view one of your save files, click the Open
button or press Ctrl+O. Then select the common data or a specific save slot to view!
When opened, you'll get a full JSON file representing your save data! This can be modified in-editor, including warning and error checks to ensure you provide a valid JSON input when saving.
This mode allows you to modify the script for each save slot the player can make. This is extremely similar to the "Script" panel built-in to Godot. Your save slot script is a standard GDScript file, and can include variables, constants, functions, and more! But make sure to note, every variable declared here will be saved to disk, so it's not recommended to write much game logic here.
In order to organize your save data, you'll want to create other classes. Hit the New
button on the top of the window and select the folder and file name of your new script. It's recommended to add .gd
to the end of your file name so the engine knows this is a GDScript file.
The newly opened script can then be modified to include anything you want. It's worth noting that you don't need to add extends
or class_name
to the top of your script.
In order to use the new script you made, hit Close
or "Ctrl+W" to return to the root script you started on. Then, hitting Import
or "Ctrl+I" will allow you to select the script you previously created and add it as a preload. Now you use this new class/script freely!
The SaveData slot editor does not include error checking like Godot's built-in script editor. If you're doing complex work and would like intellisense, it's recommended to open the file in the normal script editor.
The Common Mode is almost identical to the Slot Mode. This mode is for modifying the common data which is shared globally between all save files. A common use case for this would be config settings like resolution. For more info on this section, please read the Slot Mode docs.