Other teams' units
An enemy unit cannot be driven — neither by type nor by object. Looking at it is free
There are two daggers on the map, both hostile. ubind @dagger honestly searches — and puts
emptiness into @unit: the walk goes through units of your own team, and there are no
enemies on that list at all.
The same goes for binding by object: even if an enemy unit is sitting in one of your
variables — found by a radar, say — ubind will not take it.
What you can still do with enemies
Section titled “What you can still do with enemies”The ban covers driving only. Nobody stops you looking at an enemy:
| What | With what |
|---|---|
| find the nearest | radar from a building, uradar from your own unit |
| walk through all of them | fetch by team, query by area — both on a world processor |
| read properties | sensor — health, coordinates, type, team |
| shoot at it | control shootp on a turret |
| aim your own unit at it | ucontrol targetp — the target is given to yours, not to theirs |
radar enemy any any distance duo1 1 foesensor health foe @healthsensor team foe @teamAn enemy unit here is an ordinary value: it is read, compared, passed around. Only one thing is
forbidden — putting it into @unit and commanding it.
A team arrives as a number
Section titled “A team arrives as a number”sensor whose unit @team gives the team’s number, not the team itself: derelict is zero,
yours is usually one, the enemy’s is two.
The constants @sharded, @crux, @derelict, on the other hand, are objects, and they do not
compare with a number directly. The number is asked of the team itself:
sensor whose unit @teamsensor crux @crux @idjump 10 equal whose cruxA processor learns its own team the same way, through itself: sensor myTeam @this @team.
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.