Set Prop
The other side of sensor: what it reads, setprop writes — bypassing all physics
setprop @health duo1 50setprop @copper container1 120setprop @team @unit @cruxThree lines change the world directly: the turret now has 50 health, the store has 120 copper, and the dagger goes over to the enemy. None of that “happens” — it simply becomes so.
| Field | What is in it |
|---|---|
| first | a property: @health, @team, @x — or an item: @copper |
| second | to whom: a building or a unit |
| third | the new value |
The field order is the reverse of sensor’s: there, where to put it first; here, what to change.
What can be written
Section titled “What can be written”| Property | To whom | What it does |
|---|---|---|
@health |
a building and a unit | sets health; will not go above the maximum |
@team |
a building and a unit | moves it to another team |
@x, @y |
a unit | teleports it across the map |
@rotation |
a unit and a turret | turns it |
@flag |
a unit | the same flag as ucontrol flag |
@totalPower |
a battery | charges it |
| an item | a building | puts exactly that much of that item in |
An item in the first field is a special case and the most useful one:
setprop @copper container1 120 does not add 120 copper but makes it be 120.
Bypassing all physics
Section titled “Bypassing all physics”setprop deals no damage, carries no items and moves no unit — it substitutes a number.
All its quirks follow from that:
- a building set to zero health dies — as if from damage, but with nobody having dealt it: the battle statistics will not see it;
- a unit moved by
@xand@yends up anywhere: through walls, beyond the edge of the base, in the middle of water; - items placed by
setpropcome out of nowhere and never pass along a conveyor.
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.