Locale Print
The same print, only the text comes from the map's dictionary rather than from the program — a different one per language
localeprint "task.drill"The program contains a key, and the board shows “Build a drill”: the text lives in the map’s dictionary, not in the processor.
| Field | What is in it |
|---|---|
| the only one | the key, as a string |
Everything after that is like an ordinary print: the
text is appended to the buffer, and the buffer is handed to a message block, a marker or the
player.
What it is for
Section titled “What it is for”A map can reach a player with any interface language. If a script prints “Build a drill” straight out of the program, everybody sees English — including those who do not read it.
A map’s dictionary solves that: the map holds a “key → text” table, one per language, and the program knows only the keys. The game picks the right language itself.
No key, no text
Section titled “No key, no text”A key can be assembled
Section titled “A key can be assembled”A key is an ordinary string, and a variable will do in the field:
set key "task.drill"localeprint keyHence a common technique: a script’s step number is turned into a key and the hint for the current step is printed, without writing every text out in a row.
Unofficial fan project, not affiliated with Anuke. Mindustry sprites, fonts and translations © Anuke, used under GPL-3.0; Fira Code under OFL-1.1. Site code is GPL-3.0.