Spielerando

A strange player name breaks my text or shows up as nothing

Let players type their own name and someone will type nothing, a very long string, an emoji, or something that looks like your own formatting. Here is a small clean-up that keeps the name readable, short and harmless in every line it is inserted into.

Why this works

A name typed by a stranger lands in many places, some of which treat certain marks as commands. Cleaning it once at the door, and storing only the clean version, is safer and simpler than defending every line it will appear in.

When not to use it

Skip it when the name is never shown inside styled text, or when it comes from a trusted list you wrote yourself. Also skip the strict cleaning when players need unusual letters, say for a language you support. Allow those and clean less.

In the full entry

  • What to build, step by step
  • Starting values and the reason for each
  • 4 common mistakes and the fix
  • 15 lines of example code with 5 checks that pass
  • How your AI shows you that it works

Say this to your AI

Use the Spielerando entry "A strange player name breaks my text or shows up as nothing" (read_entry player-name-breaks-the-dialogue) 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