A hero's name with a colon, an emoji or a reserved word makes saving fail
Players type anything as a name, and if the name becomes the file name, some names cannot be saved on some computers, or two heroes overwrite each other. Here is how to turn any name into a safe, unique file name without breaking the name shown in the game.
Why this works
The name a player types and the name a disk accepts are different things. Keeping the real name inside the save and giving the disk only a cleaned label means the player sees what they typed, while the computer only ever sees something it cannot refuse.
When not to use it
You do not need it when saves are named by slot number, which is simpler and always safe, or when the game keeps its saves in a browser store where names are no problem. Use a name on disk only if players must recognise the files in a folder.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 3 common mistakes and the fix
- 18 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 hero's name with a colon, an emoji or a reserved word makes saving fail" (read_entry rpg-hero-name-as-file-name) 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