tweaks to the documentation/comments for the mapgen function

This commit is contained in:
Vanessa Ezekowitz 2013-01-19 03:26:45 -05:00
parent 7db6ed7fb9
commit 21e43912ff
1 changed files with 26 additions and 18 deletions

44
API.txt
View File

@ -121,35 +121,43 @@ plantslib:register_generate_plant(biome)
Where "biome" is a table containing about a dozen variables: Where "biome" is a table containing about a dozen variables:
biome = { biome = {
surface = "string", -- [*] what nodes to spawn on surface = "string", -- [*] what nodes to spawn on.
avoid = {table}, -- [*] what nodes to avoid when spawning avoid = {table}, -- [*] what nodes to avoid when spawning.
radius = num, -- [*] how much distance to leave between radius = num, -- [*] how much distance to leave between
objects the object to be added and the objects
seed_diff = num, -- perlin seed-diff value. Defaults to 0. to be avoided.
neighbors = {table}, -- table of what ground nodes must be right seed_diff = num, -- perlin seed-diff value. Defaults to 0,
next to and at the same elevation as the which causes the function to inherit the
node to be spawned on. Defaults to the global value of 329.
value of the "surface" string. neighbors = {table}, -- What ground nodes must be right next to and
ncount = num, -- how many of the above nodes must be nearby at the same elevation as the node to be
(at least this many). spawned on. Defaults to the value of the
"surface" string.
ncount = num, -- at least this many of the above nodes must
be next to the node to spawn on. Any value
greater than 8 will probably cause the code
to never spawn anything. Defaults to 0.
depth = num, -- how deep/thick of a layer the spawned-on depth = num, -- how deep/thick of a layer the spawned-on
node must be (typically used for water). node must be. Typically used for water.
Defaults to 62000 (unlimited). Defaults to unlimited.
min_elevation = num, -- minimum elevation in meters/nodes. min_elevation = num, -- minimum elevation in meters/nodes.
Defaults to -31000 (unlimited). Defaults to -31000 (unlimited).
max_elevation = num, -- maximum elevation. Defaults to +31000 max_elevation = num, -- maximum elevation. Defaults to +31000
(unlimited) (unlimited).
near_nodes = {table}, -- what nodes must be in the general vicinity near_nodes = {table}, -- what nodes must be in the general vicinity
of the object being spawned. of the object being spawned.
near_nodes_size = num, -- how wide of a search area to look for near_nodes_size = num, -- how wide of a search area to look for
the nodes in that list. the nodes in that list.
near_nodes_count = num, -- how many of those nodes must be in the near_nodes_count = num, -- at least this many of those nodes must be
area in the area.
temp_min = num, -- minimum perlin temperature value needed to temp_min = num, -- minimum perlin temperature value needed to
spawn an object (=hottest allowable temp.) spawn an object (represents the hottest
temp_max = num, -- maximum perlin temperature value (=coldest) allowable temperature).
temp_max = num, -- maximum perlin temperature value (coldest
allowable temperature).
exec_funct = "string", -- [**] name of the function to use to exec_funct = "string", -- [**] name of the function to use to
actually build the object. actually build the object if the code
decides it is time to do so.
} }
[*] These entries are required for the spawn code to work. Everything else [*] These entries are required for the spawn code to work. Everything else