Flush Message
The same print buffer, only it goes not to a message block but straight to the player's screen
print "Hold the line!"message announce 3 @waitThe text is assembled by the same print as for
a message block, and message sends it to the player’s screen. Three seconds later the
announcement disappears and the program shows it again: the frames counter grows about once
every three seconds.
| Field | What is in it |
|---|---|
| first | the kind of message |
| second | how many seconds to hold it |
| third | where to put the answer: did it get through or not |
Four kinds
Section titled “Four kinds”| Kind | What it looks like |
|---|---|
announce |
large text in the middle of the screen |
notify |
a line at the top, like the one about a core being built |
toast |
a pop-up hint, short and small |
mission |
the map’s objective: it hangs in the corner until it is replaced |
mission stands apart: it is not a pop-up message but the text of the objective. It never
disappears and waits for nobody — it simply replaces the previous one.
A busy screen
Section titled “A busy screen”Two messages in a row: the first gets through (firstText is one), the second does not
(secondText is zero). The place is taken, and the program learns about it.
An important detail: on a refusal the buffer is not cleared. The text “And one more” stays in the print buffer and will go to the screen with the next successful attempt. Nothing is lost.
@wait: the program waits its turn
Section titled “@wait: the program waits its turn”The answer field holds @wait by default — and that is not just a variable’s name. While it is
there, a busy screen holds the program on that line: the counter is wound back, the tick is
given up, and the attempt is repeated on the next tick.
print "Hold the line!"message announce 3 @waitop add frames frames 1That is exactly how the first example works: print does not get to repeat, because the
program is standing on the message line rather than running iteration after iteration.
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.