Unit Bind
Every instruction about units — ucontrol, uradar, ulocate — works not with a unit named
in a field but with the one sitting in @unit. ubind puts it there, and nothing else does.
Hence the whole order of working with units: bind first, command after. A binding lives until
the next ubind, belongs to each processor separately, and the unit knows nothing about it —
it simply starts obeying.
Lessons
Section titled “Lessons”- Binding by typeOne ubind, one unit. The next one gives another, and so on round the circle until they run out
- Keeping one unitThere is no point binding every iteration. A proper loop binds rarely — only when the previous unit will no longer do
- Other teams' unitsAn enemy unit cannot be driven — neither by type nor by object. Looking at it is free
What you need first
Section titled “What you need first”«Emptiness: null» — with no units around @unit comes out empty,
and that is an everyday thing, not a breakage. The lessons will tell you the rest themselves.
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.