Skip to content

Finding a unit

Three conditions are joined by a logical AND, and the range is taken from the block you look from

tick 0
Radar0
target1target2target3sortradarsortOrderoutput
Radar1
target1target2target3sortradarsortOrderoutput
Radar2
target1target2target3sortradarsortOrderoutput
Print3
Print4
Print5
Print6
Print7
Print Flush8
Stop9
@counter0number
nearnullnull
flyingnullnull
minenullnull

There are three on the map: a dagger and a flare belong to the enemy, a poly is ours. Three radars find different ones — through filters.

Field What is in it
first, second, third the filters: three conditions joined by a logical AND
fourth what measures “best” — that is the next lesson
fifth where we look from: the block being asked
sixth the sort direction
seventh where to put the one found
Filter Who qualifies
any anybody
enemy a unit of another team
ally a unit of your own team
flying airborne
ground on the ground
attacker able to shoot
player driven by a player
boss a wave boss

The derelict team does not count as an enemy: rusty units on the map will not come up under enemy.

Three filters are an AND, not an OR: enemy flying any finds one that is hostile and airborne. To have fewer than three conditions, the spare ones are set to any.

The fifth field is a block, and the range is taken from it:

Block How far it sees
a turret as far as it shoots
a processor as far as it links
every other block not at all

So a radar is usually hung on the very turret that will be commanded afterwards: it sees exactly what it can reach.

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.