Referencia de funciones
Godot 4 · GDScript · Cloud saves
load_game
Loads the full data object stored in a single cloud save slot.
Asynchronous (result via signal)
Signature
load_game(slot: int) -> voidWhat it does
POSTs /saves/load. An empty slot is NOT an error: save_loaded fires with found=false and data={}. When found is true, data is the saved JSON object verbatim. error_code is "" unless a real failure occurred (e.g. no_session / invalid_slot).
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| slot | int | required | Save slot to load, 1-10. |
How to call it
Connect save_loaded first, then call load_game().
Result signal: save_loaded(slot: int, found: bool, data: Dictionary, error_code: String)
Example
Gamdato.save_loaded.connect(_on_loaded)
Gamdato.load_game(1)
func _on_loaded(slot: int, found: bool, data: Dictionary, error_code: String) -> void:
if found:
_apply_save(data)
else:
_new_game()Use cases
- Restore a player's progress on a Continue button.
- Detect a fresh player (found=false) and start a new game.