Set
set computes nothing and asks nobody anything. It puts a value into a variable —
and that is all.
It has two fields: the variable’s name on the left, what to put into it on the right. The right-hand side can be any of four things:
- a number —
5,-0.25,1e6; - text in quotes —
"copper"; - a name the game has taken —
@copper,@this,@time; - another variable — then the value is copied.
There are no expressions on the right: count + 1 is not a value but a calculation, and that
lives in op. set can only put down something ready.
Lessons
Section titled “Lessons”- Assignment and copyingPut down a number, a text or another variable's contents — and how a copy differs from the original
- Content constantsAn item, a liquid, a block and a unit are values like a number: they go into variables and get passed to instructions
What you need first
Section titled “What you need first”«Variables and names» — where variables come from and which names are already taken. The lesson will tell you the rest itself.
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.