A grid inventory loads with overlapping items after an item or bag changed size
Items that fill several squares of the bag are saved with their positions. When an update makes a sword longer or the bag smaller, they overlap or fall outside. Here is how to keep what still fits where it was and place the rest, without losing anything silently.
Why this works
The size of an item is a fact about the game, not about the save. Trusting the current game for sizes and the save only for the player's choices of place keeps the arrangement the player made, and a fixed order of placing makes the result the same every time.
When not to use it
Do not use it when the bag has no grid, such as a plain list of items, or when sizes never change after release. Then it is needless work. If a change is large, tell the player and let them sort the bag by hand rather than moving things unseen.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 4 common mistakes and the fix
- 39 lines of example code with 3 checks that pass
- How your AI shows you that it works
Say this to your AI
Use the Spielerando entry "A grid inventory loads with overlapping items after an item or bag changed size" (read_entry rpg-grid-bag-items-after-resize) 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