Skip to reading
GDScript Programming & Godot

SaveGameSlot()

Edition 0.86.4.1 HF1

0.86.4.1 Hotfix 1 edition. Earlier lessons and screenshots retain their original version context; revised references and supplements describe the newer behavior.

Download PDFView PDF page

Save Game Slot

Save the current game into a chosen slot with an optional name.

Source table from SaveGameSlot(), page 219
Option key / fieldMeaning and inputDefault
Slot slotExplicit save slot number. Selected-slot widget commands use widget selection instead.0
Save Name (optional) saveNameOptional player-facing name for the saved game. May be blank.Blank

Timing. Waits for the runtime routine to return; no further completion wait is promised by this schema.

Code example
await SaveGameSlot({"slot": 0, "saveName": ""})

In use. Save slot 1 as "Before the archive." Save a coherent completed puzzle state, rather than halfway through a multi-step reward. Do not silently overwrite a player-chosen slot without a sensible interface policy.

LoadGameSlot()#

Load Game Slot

Load the chosen save slot.

Source table from SaveGameSlot(), page 219
Option key / fieldMeaning and inputDefault
Slot slotExplicit save slot number. Selected-slot widget commands use widget selection instead.0

Timing. Awaits loading.

Code example
await LoadGameSlot({"slot": 0})

In use. Load the row the player selected in a custom save screen. Test an empty slot and a save from another room. OnSaveLoaded is the hook for follow-up work that belongs to successful loading.

Page 219 of 378Permalink
Go to page