Skip to content

Locale Print

The same print, only the text comes from the map's dictionary rather than from the program — a different one per language

tick 0
Locale Print0
Print1
Locale Print2
Print3
Print Flush4
Stop5
@counter0number
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.

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.

A key is an ordinary string, and a variable will do in the field:

set key "task.drill"
localeprint key

Hence 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.