Stop a saved game from loading a hero with no health or endless ammo
Saved files get edited, cut off or filled by an old bug, and the game then loads nonsense: a hero that dies on the first frame, negative ammo, a level that does not exist. This entry shows how to clean the values on load and report what was changed.
Why this works
A file read back is not the file you wrote: people edit it, a crash cuts it, an old bug fills it with nonsense. So every value is checked against what it may be on the way in, and each correction is reported, which makes a hidden bug visible.
When not to use it
Wrong where the player should not be rescued, such as a hardcore mode that treats a damaged save as lost, or a game where editing the save is welcome. Cleaning also hides a real fault if you never read the report, so read it.
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 "Stop a saved game from loading a hero with no health or endless ammo" (read_entry action-save-values-sanitize) 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