The result

dharmatiles version="1.0.0"
// A scatter says how many and where; its children say what. Here a pool of bare ground holds
// rocks and pebbles, three rocks for every ten pebbles.
tile size="1x1" seed=11 {
line shore wobble="4dmm" { through "(0sq, 2sq/3)" "(1sq, 0.5sq)" }
region pool { boundedBy shore; fill "(0.5sq, 0.85sq)" }
stack {
base
dirt
scatter at=pool perSquare=20 {
rock size="6dmm .. 10dmm" weight=3
pebble weight=10
}
}
}
Say it plainly
Every entry has one place. A region fills it, a line is followed or spread along, a point stands a single thing there; with no at= the entry covers the whole tile.
A thing on its own is one of itself. More than one is a scatter: it says how many and where, and its children say what, each by its own weight.
The rules
One word, at=, names the place
One word, at=, names the place, and side= adjusts a line. Each element page lists the kinds of place it takes.
| Word | Takes | Means |
|---|---|---|
at= a region | a region name | Acts only inside that region. Default: the whole tile. |
at= a line | a line, an edge or an edge path | Built or spread along it. On a tile edge, always inside. |
at= a point | a point ("(0.65sq, 0.5sq)", point(…), polar(…)), a point's name, or a corner or edge word | Centred there. No at=: anywhere in the area. |
at="foot(cliff)" | foot( cliff, wall, rock or tree ), quoted | The band at the foot of that kind of thing, where a scatter gathers. reach= says how far out. |
side= | left, right or centre | Along a drawn line, which side the element stands, as you walk the line. Not on a tile edge. |
A wall must have at= a line; a cliff needs it for the edge forms (run, corner, escarpment) but not the free-standing ones. Surfaces take a region and usually a line; things take a point or a region. An entry has one place: a second at= is dt::duplicate.
A place the element cannot use is refused
Each element takes the kinds of place that mean something to it and refuses the others with dt::place or dt::type and a help line: a second at= on one entry, a thing given a line, a scatter given a point, a nesting that has no meaning. The message names what the element accepts.
A thing is one of itself
Things share one vocabulary. A rock (and stone, boulder, pebble), a tree and a flower are placed the same way, with at= a point or a region they stand in, and sized the same way, by size=, which takes a number, a range or any weighting (size="low(1dmm .. 6dmm, 11)"); a tree's size is its height and a flower's the width across its petals. Many of them are a scatter whose children are things: scatter at=meadow perSquare=4 { flower size="4dmm .. 6dmm" }. A scatter holds rocks, flowers and trees, alone or mixed: each placed item picks its child by weight=, and one gap keeps every two things apart (trees are placed first, then rocks, then flowers); trees keep their crowns clear of one another, and scatter at=road count=3 { tree } is a row of trees along a line. A thing is one of itself. How many is never its own control: tree count=3 is an error whose help says to use a scatter. With no at= a thing goes anywhere in its area. Either way its footprint is kept inside the tile and clear of other solids, nudged inward rather than clipped.
More than one of a thing is a scatter
More than one of a thing is a scatter. It says how many and where; its children say what.
| Control | Takes | What you get |
|---|---|---|
count | number, or a weighted range | How many, in total. |
perSquare | number, or a weighted range | How many per square of the area, or per square of length along a line. |
reach | a length | With at="foot(…)": how far out from the foot. |
clumps | per square | Gathers them into clumps. Default: spread evenly. |
gap | a length | Least space between neighbours. |
child weight= | number | Share of the mix when there are several children. Default: equal. |
A scatter must have exactly one of count and perSquare; reach needs at="foot(…)". A scatter inside a surface (dirt { scatter … }) lands on that surface.
Errors this page explains
dt::placeThat place is not one the element can use The ruledt::scatterThat element cannot be scattered The rule
Next
Next: values and ranges, the numbers that sizes and counts are written as.