Add license (MIT)
[minetest_pedology.git] / README.md
blob55f2ac4144d788e34cad21ecdc7f99205b7f2db9
1 #Mod developer’s documentation for the Pedology mod for Minetest
2 ##Nodes
3 ###Ground nodes
4 The ground nodes are the most basic nodes in this mod. They mainly differ in density. Except coarse sand, all ground nodes can be wet between a wetness level between 0 (dry) and 5 (slurry). Each ground type has a maximum wetness level. It is intended for later versions to reserve wetness levels 4 and 5 for mud (high-viscosity liquids), whereas levels 0-3 are used for solid blocks.
6 Here is the list of ground blocks with the maximum wetness level:
8 * clay: 5
9 * fine silt: 5
10 * medium silt: 4
11 * coarse silt: 3
12 * fine sand: 2
13 * medium sand: 1
14 * coarse sand: 0
15 * fine gravel: 1
16 * medium gravel: 2
17 * coarse gravel: 2
19 Currently, sand and gravel are *not* affected by gravity.
21 ###Air and vacuum
22 As an experimental feature, Pedology adds two new air node type and a vacuum node type:
24 * thin air
25 * very thin air
26 * vacuum
28 All three behave like the ordinary air. The vacuum is special as it removes 4 hearts per seconds for any lifeform which is inside it. The other node types have no special properties.
30 It has yet to be decided wheather these nodes are kept.
32 ###Liquids
33 Yes, there are some water and lava nodes, but are currently experimental.
35 ##Itemstrings
37 ###Ground nodes
38 The itemstrings of all ground nodes follow this pattern:
40     pedology:<type>_<wetness>
42 where “`<type>`” is replaced with the ground type and “`wetness`” with the wetness level
44 ####Types
45 * clay: `clay`
46 * fine silt: `silt_fine`
47 * medium silt: `silt_medium`
48 * coarse silt: `silt_coarse`
49 * fine sand: `sand_fine`
50 * medium sand: `sand_medium`
51 * coarse sand: `sand_coarse`
52 * fine gravel: `gravel_fine`
53 * medium gravel: `gravel_medium`
54 * coarse gravel: `gravel_coarse`
56 ####Example
57 The itemstring for “dry clay” is “`pedology:clay_0`”
59 ###Air
60 - thin air: `pedology:air_thinair1`
61 - very thin air: `pedology:air_thinair2`
62 - vacuum: `pedology:vacuum`
64 ##Groups
65 ###Used groups
66 The mod uses the following existing groups:
67 * `water`: A value of 1 means the node is water. This group is used to wetten `sucky` nodes.
68 * `not_in_creative_inventory`: For value of 1: This node type should not be added into creative inventories. This group is used by the `creative` mod of `minetest_game`, for example.
69 * `crumbly`: Used for compatibility with `minetest_game`. Usage may change in the future.
70 * `sand`: 1 means the node is sand. Used for compatiblity with `minetest_game`. Usage may change in the future.
71 * `flammable`: Used by turf (value: 1), indicates the nodes are flammable. Value can range from 1-3, 1 being the slowest.
73 ###New groups
74 The mod introduces the following groups:
76 * `wet`: Wetness level. Currently, the wetness level ranges from 0 to 5. The wetness descriptions are:
77  * `0`: dry (solid) (node is not member of the `wet` group)
78  * `1`: wet (solid)
79  * `2`: watery (solid)
80  * `3`: sludgy (solid)
81  * `4`: muddy (now solid, liquid in later versions)
82  * `5`: slurry (now solid, liquid in later versions)
83 * `sucky`: Suckyness. Declares a node to “suck” wetness from `water` and `oozing` nodes. Any non-zero value makes the node a “sucky” node
84 * `oozing`: Oozing level. Members of this group can transfer their wetness to `sucky` nodes. Any non-zero value makes the node an “oozing” node. Maybe different oozing levels will be used in future.
85 Nodes should be only added to this group if they are also wet.
86 * `melting_point`: the minimal temperature at which the node becomes destroyed. This depends on the `hot`ness of neighbor nodes. Planned for later versions.
87 * `hot`: The temperature of the node. Not used yet, but intended for lava, therefore planned for late versions.
88 * `sun_dry`: If 1, the node may dry off over time when it is in direct sun light
90 ##Functions
91 ###`pedology.dry(pos)`
92 Reduces the `wet`ness level of the node at `pos` by `1`, if possible. This is done by replacing the node with a “drier” version of it, if available.
93 ####Parameters
94 * `pos`: Position of node, specified as a table of the format `{ x = x, y = y, z = z}`
96 ####Return value
97 `nil`
99 ###`pedology.wetten(pos)`
100 Increases the `wet`ness level of the node at `pos` by `1`, if possible. This is done by replacing the node with a “wetter” version of it, if available.
101 ####Parameters
102 * `pos`: Position of node, specified as a table of the format `{ x = x, y = y, z = z}`
103 ####Return value
104 `nil`
106 ###`pedology.register_sucky_group(basename, basedescription, lumpdescription, maxwet, oozeinterval, oozechance, melttable, dropcount, sounds, additional_groups)`
107 Registers a bunch of `sucky` and `oozing` nodes to Pedology . This function assumes that textures are ready for the node, one texture for each `wet`ness level (up to `maxwet`). They have to be named according to the pattern `pedology_<basename>_<wetness>.png` and must reside in the `textures` folder. Example name: `pedology_clay_0.png` is the texture for dry clay, `pedology_clay_1.png` is texture for wet clay, and so on.
108 ####Parameters
109 * `basename`: A part of the internal itemstring of all the nodes to be registered. The full itemstring for a node would be “`pedology:<basename>_<wetness>`, where “`<basename>`” is replaced with the given `basename` and “`<wetness`>” is replaced with the wetness level (a single digit). This parameter is also used to find the textures.
110 * `basedescription`: A part of the user-visible description for each node. The full description is built from the template “`<wetnessstring> <basedescription>`. `<wetnessstring>` would be “dry”, “wet”, “watery”, “sludgy”, “muddy” or “slurry”.
111 * `lumpdescription`: The full description of the “lump” version of the block (if any)
112 * `maxwet`: The maximum `wet`ness level of the nodes. Must be at least 0 and at most 5.
113 * `oozeinterval`: The interval in seconds in which the node may ooze its wetness to other nodes (Minimum: 1)
114 * `oozechance`: The interted chance (`1/oozechance`) to ooze each time the `oozeinterval` has passed.
115 * `melttable`: Table of `melting_point` values for each `wet`ness level. The table length must equal `maxwet+1`. This parameter may alternatively be nil (all nodes are indestructible by heat then). Note that lava and melting points are not implemented yet.
116 * `dropcount`: How many lumps nodes of this group drop, when mined. If 0, they simply drop themselves (NOT recommended)
117 * `sounds`: Sound specification for every node (Definition is the same as for `minetest.register_node`).
118 * `additional_groups`: Table of additional groups for every node. May also be empty or nil, meaning no additional groups will be added.
120 ####Return value
121 `nil`
124 # License
125 This mod is free software. The entire mod (code, textures, everything) is licensed under the MIT License. Enjoy! :-)