mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-19 02:21:24 +01:00
Updated Resources: spread functions (markdown)
parent
75bfe1c21d
commit
692a3787c0
1 changed files with 6 additions and 0 deletions
|
|
@ -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
|
* `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
|
* `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:
|
Default biome ids:
|
||||||
* 0: Marine
|
* 0: Marine
|
||||||
* 1: Hot desert
|
* 1: Hot desert
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue