This is a wrapper to make it simple handling Steam Cloud usage across games. Made by Softwool to use in our games (check out Pistola and Torecower. As we love open source, we wanted to share this simple tooling.
- This project expects your project to use GodotSteam
- Add the
addons/
folder to your project (orsteam_cloud/*
into youraddons/
if it already exists) - Make sure your game has the Cloud enabled on steam
SteamCloud.gd
- Autoload
Saves your local file to desired path (defaults to user://) and then sends its contents under the name _filename
to the cloud.
Calls back save_finished
on success and save_failed
on fail.
Loads both the local file from desired path (defaults to user://).
On error calls load_failed
.
On success it returns loaded_with_conflicts
, so you can check both the remote file and local one if you need to handle conflicts to keep them in sync.
If there's no conflicts and there's only a remote file (e.g.: When the player first plays the game on a new device), it calls load_finished
.
I need to improve this API.
Emitted when your save is finished. You can use it to remove a "Save in Progress" view, for instance.
Emitted when there's an error during the file saving. Remote: whether the error was when saving the remote file (to Steam Remote Storage) or local one.
Emitted when there's both a remote and local files, so you can handle any reconciliations if needed to guarantee the player doesn't have any rollback into their progress.
filename
is meant to be used as a way to handle multiple different files being saved if you need.
Emitted when the load is done in two cases:
- There's only the remote file;
- There's only the local file (this shouldn't happen at all, if this is happening, there's something wrong in your implementation)
filename
is meant to be used as a way to handle multiple different files being saved if you need.
Emitted when the loading fails, as well as with the same, it returns the remote
variable so you know whether the error was in the file system or steam's remote storage.