The result
dt::unitdharmatiles version="1.0.0"
// A bare number is not a length: the wobble needs a unit, so this tile does not build.
tile size="1x1" seed=4 {
line stream wobble=5 { through "(0sq, 0.5sq)" "(1sq, 0.5sq)" }
stack {
base
dirt
}
}
Say it plainly
The program reads on past a mistake, so all of a file’s mistakes come together. dharmatiles check my-tile.dtile reports them without building; the preview shows them beside the tile.
Each code has a page of its own with the rule, a broken document beside its fix, and a link to the section of this guide that explains it.
The rules
Every mistake has a code, a place and a hint
Every mistake gets a message with a stable code (such as dt::unit), the line it is on with the spot underlined, and a hint that says what to write instead. The program reads on past a mistake, so all of a file's mistakes come together. dharmatiles check my-tile.dtile reports them without building (it takes --system, --printer and --seed like build, so a mistake that only shows on OpenLOCK is caught too); the preview shows them beside the tile. Two examples, from one file:
dt::unit
× `pebble size`: `1.2` has no unit, and a length is written with one
╭─[my-tile.dtile:7:44]
6 │ dirt
7 │ scatter perSquare=40 { pebble size=1.2 }
· ─┬─
· ╰── here
8 │ grass cover="85%"
╰────
help: write 1.2dmm or 1.2mm (`dmm` is 1/35 of a square: 1 mm on
DungeonBlocks; `mm` is a printed millimetre)
dt::unknown-control
× `tree` has no control `count`
╭─[my-tile.dtile:9:36]
8 │ grass cover="85%"
9 │ tree top="$bottom + 40dmm" count=3
· ──┬──
· ╰── unknown control
10 │ }
╰────
help: a tree is one tree; how many and how spread is a scatter's job:
`scatter count=… { tree }`
dt::unknown-element
× no element or definition is called `dirrt`
╭─[my-tile.dtile:6:9]
5 │ base
6 │ dirrt clods=none
· ──┬──
· ╰── unknown
7 │ }
╰────
help: did you mean `dirt`?
Other mistakes caught the same way: a misspelt control (clumsp, did you mean clumps?), a range or a size that is not quoted, an expert control in a tile, a wall without at=, side= on a tile edge, and KDL v1 syntax.
Mistakes are found in four phases, each as early as it can be known
Four phases, each as early as it can know. The static ones are found reading the document; the solve ones when check works out the bands; the build ones only when the element builds. Every refusal gives the place, the values and what would fit.
A note does not stop the build; check prints it after the tile's line. The pins named in a note are the ones that cause it.
Errors this page explains
dt::unknown-controlThe element has no control by that name The ruledt::unknown-elementNo element or definition is called that The rule
Next
Next: worked tiles, whole tiles that put the guide together.