Error code · a mistake in the document
dt::unit
A length or angle has no unit, or a unit that is not one.
What the program says
dt::unit
× `rock size`: `5` has no unit, and a length is written with one
╭─[example.dtile:3:29]
2 │ tile size="1x1" {
3 │ stack { dirt; rock size=5 }
· ┬
· ╰── here
4 │ }
╰────
help: write 5dmm or 5mm (`dmm` is 1/35 of a square: 1 mm on DungeonBlocks;
`mm` is a printed millimetre)
explain: https://shawn-vincent.github.io/dharmatiles/e/unit
offline: dharmatiles explain dt::unit
What to do
Write the unit: 5dmm or 5mm for a length, 20deg for an angle.
Broken, then fixed
dt::unitdharmatiles version="1.0.0"
tile size="1x1" {
stack { dirt; rock size=5 }
}dharmatiles version="1.0.0"
tile size="1x1" {
stack { dirt; rock size="5dmm" }
}The rule
- A unit goes right after its number and multiplies it:
2layeris 0.4 mm on the default printer,0.5sqis half a square,2 pi radis a full turn. House style writes no space (4.5dmm, as50%already is); a spaced4.5 dmmstill reads.- A digit followed by letters is always a number and a unit, since plain names can't start with a digit. An unknown suffix,
2foot, isdt::unit: “footis not a unit”, listing the units.- A bare
0is the same in every unit and fits any of them.- As a coordinate's second argument a unit divides instead:
d($region, mm)is the distance in from the edge counted in printed millimetres, a plain number (squares and points).%on its own is a plain fraction. It is a length only inside a point,"(50%, 2sq)", where the frame gives it a size, and a coordinate's unit divides by the frame's own size:x($region, %)is 0 at the region's west edge and 1 at its east. An angle is alwaysdegorrad:polar($tile, 40%, 90deg).- Printer files take printed units only:
line "0.45mm",layer "0.2mm",overhang "55deg".sq,dmmandlayerhave no meaning there and are refused.
Read it in context: Units and kinds · A unit goes right after its number and multiplies it