
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:

* your pack is named PACK
* your new cell is named NAME

You will have to edit files in:

```sh
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:

```ini
[NAME]
collision = solid   ; has collision
opacity = opaque    ; 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:

```ini
[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](howto_item.md).

## 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`:

```ini
[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`:

```ini
[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`:

```ini
[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:

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

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