Make the rewind key give back items gained or spent in a story scene
Story games let readers step back through earlier lines. If they step back past a line that handed over a key or took coins, the bag must go back too, exactly, and stop where the story says there is no way back. This entry records the changes in a way that can be reversed.
Why this works
Remembering what each line changed is lighter and safer than copying the whole bag every time, and undoing a change cleanly works only for differences, never for totals. Final moments are marked so stepping back cannot turn a purchase into free money.
When not to use it
Skip it when the game is meant to be unforgiving, with no way back after a choice. Also skip it when a scene changes many things at once and the player needs a clear save point rather than a long chain of undo steps.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 4 common mistakes and the fix
- 31 lines of example code with 4 checks that pass
- How your AI shows you that it works
Say this to your AI
Use the Spielerando entry "Make the rewind key give back items gained or spent in a story scene" (read_entry rollback-undoes-item-changes-in-text-scenes) in my game. Build it step by step, and show me how you checked that it works.Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP