Skip to content

Make Marker

A drawing over the map that the player sees: a circle over a point, a caption, an arrow, a line

tick 0
Jump -> 90
if
Make Marker1
typeid #xyreplace?
Set Marker2
typeid #color
Set Marker3
typeid #radius
Make Marker4
typeid #xyreplace?
Print5
Set Marker6
typeid #fetch?
Make Marker7
typeid #xyreplace?
Set8
=
Set Marker9
typeid #rotation
@counter0number
wasPlacednullnull
makemarker shape 1 8 7 1
makemarker text 2 8 3 1
makemarker line 3 4 5 1

Three markers: a shape, a caption and a line. They appear on the map itself — not on a display but over the world, and the player sees them.

Field What is in it
first the kind of marker
second the id: what it is found by later
third and fourth coordinates in tiles
fifth whether to replace a marker with that id if one already exists

That is the main difference from drawing on a display. A display has to be redrawn every time; a marker is placed once and stays on the map until it is removed.

setmarker remove 1 0 0 0

Hence the fifth field: makemarker with the same id and replace = 0 does nothing if the marker already exists. That is exactly how it is placed inside a loop — the program calls makemarker every iteration and the marker does not multiply.

Kind What it draws
shape a polygon: a circle, a triangle, a square
text text on the map
shapeText a shape with a caption under it
line a segment between two points
texture a picture — one of the game’s sprites
quad a quadrilateral given by four corners
point a point visible only on the minimap

All of them are configured by one instruction — setmarker: colour, radius, rotation, text, drawing layer. Right after creation a marker is plain: a white quadrilateral at the given point.

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.