How to add a new Cell Type to Voxel Garden.

[[TOC]]

The Basics

You’ll need the following tools:

  1. a text editor
  2. a sprite editor

We’ll assume:

You will have to edit files in:

PACK/
├── cell_types.cfg
├── cell_models.cfg
└── textures/
    └── NAME.png

PACK/cell_types.cfg

Each section in this file defines the properties of one cell in the world:

[NAME]
solid = true        ; has collision
opaque = true       ; is not see-through
drop = PACK.NAME    ; drops the PACK.NAME item

PACK/cell_models.cfg

Each section in this file defines how a cell displays, both graphically and audio-wise:

[NAME]
texture = NAME.png  ; uses PACK/textures/NAME.png for all faces

How do I Place my Cell

Cells can’t be stored in an inventory or held in your hand to place them; that’s what items do; to make the cell you just made placeable you’ll want to define an item for it.

Making a Container

Container cells are made by adding an inventory to them and by setting their interaction type to ‘container’; both of these things are added to PACK/cell_types.cfg:

[NAME]
; other cell properties here
capacity = N            ; has an inventory with N items
interact = container    ; allows access to its inventory when used

Making a Door

Door cells are made by setting their interaction type to ‘door’; this is added to PACK/cell_types.cfg:

[NAME]
; other cell properties here
interact = door         ; attempts to warp the player when used

Making a Crafting Bench

Crafting benches are made by setting their interaction type to ‘recipes’; this is added to PACK/cell_types.cfg:

[NAME]
; other cell properties here
interact = recipes

The recipes for this bench are configured separately by adding entries to PACK/recipes.cfg, all of them with the [PACK.NAME] section:

[PACK.NAME]
result = something
from = ingredient
from = ingredient

[PACK.NAME]
result = something else
from = ingredient
from = ingredient