Make sure a one-of-a-kind item is never in two places at once
When a character can carry the locket, it can also lie in a chest or sit in the player's pocket, and a bug can put it in two of those at once. This entry moves such things between owners safely and repairs a save that already has copies.
Why this works
If you record who holds a thing, not how many exist, there is only ever one answer to where it is. A move then has to start from the real holder and take it away in the same step it hands it over, so copying becomes impossible rather than merely checked for.
When not to use it
Do not apply it to things that can be made again or exist in many copies, such as coins, arrows or common keys. A count is simpler and right there. Keep one-holder rules for the few items the story depends on.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 3 common mistakes and the fix
- 45 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 sure a one-of-a-kind item is never in two places at once" (read_entry one-of-a-kind-item-has-one-holder) 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