Updated Resources: spread functions (markdown)

Azgaar 2021-05-09 03:56:27 +03:00
parent 75bfe1c21d
commit 692a3787c0

@ -18,6 +18,12 @@ Build-in functions make models syntax easier to read:
* `nth(number)`: true for each nth cell only, e.g. `nth(2)` skips 50% of cells, `nth(5)` skips 80% of cells
* `random(number)`: percentage of true, e.g. `50` will return true in 50% of cases
Let's say we want a resource to be generated in hot and highly elevated areas. If altitude is medium, let it also be allowed, but pretty rarely. The model will be something like `minTemp(15) && (minHeight(70) || minHeight(40) && nth(5))`.
-----
const fn = new Function("i", "minTemp(15) && (minHeight(70) || minHeight(40) && nth(5))");
fn(i);
Default biome ids:
* 0: Marine
* 1: Hot desert