Traitor/mods/plants
Nathan Salapat e4a345c43d Added some new plants and artwork. 2022-07-11 21:24:21 -05:00
..
models Added some new plants and artwork. 2022-07-11 21:24:21 -05:00
textures Added some new plants and artwork. 2022-07-11 21:24:21 -05:00
bushes.lua Added some new plants and artwork. 2022-07-11 21:24:21 -05:00
crops.lua Added a bunch more plants and trees. 2021-02-06 21:44:10 -06:00
flowers.lua Made flowers pickable. 2022-05-01 21:33:38 -05:00
fungi.lua added a bunch of new nodes. 2021-02-06 12:05:06 -06:00
grass.lua Added a bunch of plants. 2021-01-31 11:42:50 -06:00
init.lua Added some new plants and artwork. 2022-07-11 21:24:21 -05:00
license.txt Added a bunch more plants and trees. 2021-02-06 21:44:10 -06:00
misc.lua Added things, lol. 2021-12-31 22:22:49 -06:00
mod.conf fixes #13 2021-02-06 16:15:54 -06:00
readme.txt Documentation and code refactor. 2021-02-09 22:25:19 -06:00
sapling.lua Added multihome mod. 2021-12-17 21:06:59 -06:00

readme.txt

This mod can register three different types of nodes, crops, grass, and plants.
Crops come in two versions, and include a craft item that can be picked by punching the mature crop.
Grass registers as five variations of the same plant, doesn't have to be grass.
Plants are single nodes that have an option of glowing.

Register a crop with plants.register_crop(name, desc, bit1, bit2)
name will be the name of the node, as is also part of the texture file.
desc is the node description, and will be used for all three items.
bit1 and bit2 are used for the meshoptions bitflag. (Both are optional.)

`paramtype2 = "meshoptions"`
   * Only valid for "plantlike" drawtype. `param2` encodes the shape and
      optional modifiers of the "plant". `param2` is a bitfield.
   * Bits 0 to 2 select the shape.
      Use only one of the values below:
      * 0 = a "x" shaped plant (ordinary plant)
      * 1 = a "+" shaped plant (just rotated 45 degrees)
      * 2 = a "*" shaped plant with 3 faces instead of 2
      * 3 = a "#" shaped plant with 4 faces instead of 2
      * 4 = a "#" shaped plant with 4 faces that lean outwards
      * 5-7 are unused and reserved for future meshes.
   * Bits 3 to 7 are used to enable any number of optional modifiers.
      Just add the corresponding value(s) below to `param2`:
      * 8  - Makes the plant slightly vary placement horizontally
      * 16 - Makes the plant mesh 1.4x larger
      * 32 - Moves each face randomly a small bit down (1/8 max)
      * values 64 and 128 (bits 6-7) are reserved for future use.
   * Example: `param2 = 0` selects a normal "x" shaped plant
   * Example: `param2 = 17` selects a "+" shaped plant, 1.4x larger (1+16)

When a crop is registered two nodes will be created, you need to provide two textures.
textures must be named as follows,
plants_[name]_1.png  This is the harvested version.
plants_[name]_2.png  This is the full grown version.

A craftitem is also registered for the object that is harvested. It's texture is,
plants_[name].png


Register grass with
plants.register_grass(name, desc)
As with crops, name is the name of the node, and part of the texture. desc is the node description.
Textures must be named accordingly;
plants_[name]_1.png
plants_[name]_2.png
plants_[name]_3.png
plants_[name]_4.png
plants_[name]_5.png

The inventory image of a grass will be the _3 texture, and will placing one of the five nodes will be randomly placed.


Register a plant with
plants.register_plant(name, desc, light)
As in the above two functions name and desc do what you expect. The light field is optional, and lets a plant glow.
The texture must be named plants_[name].png

Plants get a random rotation upon placement using the paramtype2 of degrotate.