The tile language · guide

Cheat sheet

Every word of the language on one page: the keywords, units, functions, weightings, coordinates and $ names, the library’s heights and the seam words. Nothing here is typed: cargo xtask docs writes it from the program’s own word registry and tables, so it cannot say what the program does not.

Keywords

WordIs
tilethe one tile of a file: its size, seed and stack
usebring definitions in from another file
letname a value, a thing or a layer: its body tells which
overridereplace a library name for this file
parama value a definition takes from its caller
pointa named point of a tile
linea line drawn through points
regionan area of the tile
stackwhat the tile is made of, in the order it is built
defaultsvalues every element of a kind starts from
printera printer profile
seamsthe edge contract: the seam words along a square edge
withina clause of a region: all that lies within a distance of a place
excepta clause of a region: regions taken out of it
kindwhat kind of value a param takes
atwhere an entry goes: a region, a line, a point or a place word
ida name an entry is edited by
weighthow often a child of a scatter is drawn
dharmatilesthe header line that says a file is a dharmatiles document

Read it in Syntax.

Units

UnitIs
sqa square of the grid; 35 mm on DungeonBlocks, 25.4 mm on OpenLOCK
mma printed millimetre: the same on every system
ina printed inch, 25.4 mm: the same on every system
dmmdesign millimetre: 1/35 of a square; 1 mm on DungeonBlocks, 0.73 mm on OpenLOCK
layerone printed layer: the printer's layer height
dega degree
rada radian: 180/pi degrees
pithe number pi: 2 pi rad is a turn
%a plain fraction: 50% is 0.5 (a length only inside a point)

Read it in Units and kinds.

Functions

WordTakesIs
sin1the sine of an angle
cos1the cosine of an angle
abs1the size of a number without its sign
min2the lesser of two numbers
max2the greater of two numbers
clamp3a number held between two bounds
smooth1smoothstep: an easing from 0 to 1
x2across: where a point is, or the across of a region in a unit
y2down: where a point is, or the down of a region in a unit
d2how far from the middle
a2the angle round the middle
point3a point in a frame, from two numbers
polar3a point in a frame, from a distance and an angle
parent1the region that holds a region

The coordinates are x y d a parent.

Read it in Squares, cells and points.

Weightings

WordNumbers after the rangeIs
flat0a weighting: every value equally likely
low1a weighting: low values likelier
high1a weighting: high values likelier
bell2a weighting: values near the middle likelier
peak2a weighting: values near a chosen peak likelier
ends2a weighting: values near the ends likelier
stepsthe weight of each stepa weighting: one weight for each step
mixparts and their weights in pairsa weighting: parts drawn by weight

Read it in Weighted ranges.

$ names

What an element sets where it works a height out: a body, a tree, any other element.

NameBodyTreeOther
$xsetssets
$ysetssets
$dsetssets
$asetssets
$bottomsetssets
$tile
$regionsetssetssets

Read it in Names.

The library’s heights

NameIs
$waterBedHeight0.4dmmthe bottom of standing water: two print layers
$waterSurfaceHeight2.6dmmcalm water
$waterEdgeHeight$waterSurfaceHeight + 0.6dmm * cos(720deg * ($x - $y))water at a tile edge: two waves a square
$dirtEdgeHeight3.4dmmwhere dirt meets a tile edge
$groundHeight5dmmopen land
$floorHeight7.4dmma built floor's top
$floorEdgeHeight$floorHeightwhere a built floor meets a tile edge: flush
$shortWallHeight16.55dmmhalf the wall top
$wallHeight33.1dmmthe standard wall top
$tallWallHeight72.3dmm

Read it in Heights.

Seam words

Along a square’s edgenorthsouthwesteast
1/3 (a third)nnwsswwnwene
1/2 (half)nswe
2/3 (two thirds)nnessewswese

The tile’s corners: nw (north-west), ne (north-east), se (south-east), sw (south-west). They take no number.

Read it in Lines.

Numbers

Land slope24°: how steeply dirt eases unless an entry says slope=
Water settle9 mm: how far water settles over what is under it