diff --git a/automated_updates_data.json b/automated_updates_data.json index 8a7b974c5c..ee9525e280 100644 --- a/automated_updates_data.json +++ b/automated_updates_data.json @@ -84,6 +84,10 @@ { "date": "2026-03-24", "summary": "Fixed device-sensors docs (typo in gamma rotation description, wrong units deg/s vs m/s² for rotation values, clarified Is Absolute expression, added gravity note to acceleration) and fixed broken wiki URL in advanced-conditions OR condition" + }, + { + "date": "2026-03-30", + "summary": "Improved save-state docs (named all 4 conditions, 2 TimeSince expressions, added 'Stop and restart scenes' load parameter) and fixed screenshot docs (typo, expression syntax, auto-.png note)" } ] } diff --git a/docs/gdevelop5/all-features/save-state/index.md b/docs/gdevelop5/all-features/save-state/index.md index 06b27a058a..dc1bac1cb2 100644 --- a/docs/gdevelop5/all-features/save-state/index.md +++ b/docs/gdevelop5/all-features/save-state/index.md @@ -36,6 +36,8 @@ For this, use actions **Save game to device storage** and **Load game from devic Each save uses a **storage key**, such as `"Save1"`, `"CheckpointA"`, or `"Autosave"`, to identify the save slot. This enables you to offer multiple save slots (in some games, it's usual to have 3 to 5 save slots that the player can use). +The load action has an optional **"Stop and restart all the scenes currently played"** parameter (default: No). When set to Yes, all running scenes are stopped and restarted from the save state, which gives the cleanest restoration. When left as No, the state is applied to the currently running scenes without restarting them — suitable for in-level checkpoints where you only want to reset positions and variables. + !!! tip @@ -56,7 +58,12 @@ This is useful for: ## Monitoring Save/Load Operations -The extension provides a few **expressions and conditions** to help you monitor saves and loads. In particular, the "Load just succeeded" condition is perfect to run some logic after a scene was loaded. This is somewhat similar to "At the beginning of the scene", except that after a loading a scene is already considered as started (because it was "frozen in time" in the save state). +The extension provides **conditions and expressions** to help you monitor saves and loads: + +- **Save just succeeded** / **Save just failed** — trigger in the frame immediately after a save attempt completes. +- **Load just succeeded** / **Load just failed** — trigger in the frame immediately after a load attempt completes. "Load just succeeded" is especially useful to run logic right after a game is restored, since the scene is already considered started (it was frozen in time by the save). +- **`SaveState::TimeSinceLastSave()`** — returns the number of seconds since the last successful save, or `-1` if no save has occurred yet. +- **`SaveState::TimeSinceLastLoad()`** — returns the number of seconds since the last successful load, or `-1` if no load has occurred yet. ## Advanced: Excluding Objects from Save States with the “Save Configuration” Behavior. diff --git a/docs/gdevelop5/all-features/screenshot/index.md b/docs/gdevelop5/all-features/screenshot/index.md index bb4518a422..3ef7846315 100644 --- a/docs/gdevelop5/all-features/screenshot/index.md +++ b/docs/gdevelop5/all-features/screenshot/index.md @@ -17,9 +17,7 @@ Use this action to save a screenshot of everything which is currently drawn on t **Save path**: The file path where the screenshot should be saved. -The save path needs to be an absolute path on the file system (Like "C:\MyFolder\MyScreenshot.png" on Windows)' - -Relative paths are not supported. +The save path must be an absolute path on the file system (e.g. `C:\MyFolder\MyScreenshot.png` on Windows). Relative paths are not supported. If the path does not end with `.png`, the extension is appended automatically. !!! note @@ -29,9 +27,9 @@ Relative paths are not supported. This path: -``` () + () + "my_screenshot.png" ``` +``` FileSystem::PicturesPath() + FileSystem::PathDelimiter() + "my_screenshot.png" ``` -This will save the screenshot to the *Pictures* folder on Windows, Linux and MacOS. +This will save the screenshot to the *Pictures* folder on Windows, Linux and macOS. ## Reference