Items.json

## Overview

items.json is the file that contains the item description for all items. It does not contain the descriptors for buildings once they're placed or for vehicles in use.

## Structure

### Format

The file is approximately JSON but appears to use a custom parser. Stripping the comments and then running it through a JSON validator to fix a few errors1 will make it compliant. There are also enough oddly placed linefeeds to conclude that it's a custom writer2 as well.

1 Currently, the only errors outside of the comments are 2-3 lists that terminate with a comma.

2 Most likely the file is handcrafted, which would easily explain the excess commas and linefeeds, as well as the existence of comments.

### Contents

The tree's root is named itemDataList and contains all the descriptors.

There are 23 possible fields to define an item, however an item need only contain the id and sprite fields to show up in game.

#### Used for display:

* id: Name of the item in code. Also used with the giveItem command in the command console.
* sprite: Name of the image shown in various places including the hotbar, inventory and crafting interfaces. 3
* useAnimName: Name of the animation instructions used for this item in inventory. Currently only tool interaction is defined for swinging the tool.

#### Used for crafting:

* craftedIn: A list of ID names for the stations this item can be crafted in.
* craftTime: How long the item takes to craft.
* techReq: ID name for the tech required to craft this item.
* requires: A list of entries for each item needed for crafting.
	+ id: ID of the ingredient.
	+ quantity: How many of the item to require.
* craftingQuantity: How many of the item are made each time.

#### More crafting, but specifically farming:

* craftingBonusItems: A list of bonus items gained when crafting. Currently only used for crafting plants in Garden Patches/Greenhouses to ensure you receive a seed.
	+ id: ID of the bonus item.
	+ quantity: How many of the item to get.
	+ probability: How likely you are to get this item.
* growsInto: ID of the plant a seed grows into.
* growSprites: List of the names of images to display growing.

#### Tools:

* durability: How many times you can use a tool before it breaks.
* minMeleeDamage: The minimum amount of extra damage caused when using a tool as a weapon.
* maxMeleeDamage: The maximum amount of extra damage caused when using a tool as a weapon.

#### Placement

* placementSpriteScale: Presumably used to change the size of an item when placing it in the world.
* placementSpriteOffset: Presumably used to change the position of an item when placing it in the world. (Perhaps used when it overlaps other tiles?)
* proxyTiles: Used for multi-tile objects placed in the world. Currently only mining rig and launch pad qualify in user-placable items.

#### Misc:

* maxCarry: How many of an item you can place in a stack. Defaults to 99, overridden by notStackable.
* notStackable: Overrides maxCarry and makes it so that items can never stack.
* actions: What happens when you right-click with this item.
	+ Type: The actual action; createBuilding, heal, rechargeVehicle and paint are a few examples.
	+ Value: A little more detail. For createBuilding, it's the building being created; for heal, it's how much to heal.
	+ buildTime: Only useful for the actions that place things in the world (createBuilding, createFloor, createItemDropper); this determines how long it takes.
	+ buildNoAdjacentIndicator: Only useful for the actions that place things in the world; this is what shows the marks around a wind turbine.
	+ consumeLocMessage: Only useful for eating, this is the message to display.
* recyclable: Whether or not an item can be recycled. Even if true, an item with no recipe can't be recycled.
* rotatable: Only usable for items that can be placed in the world, determines if it can be rotated when placing.
* researchPoints: Only used by artifacts, determines the points gained when researching.

3 Actually, this is the identifier in the image atlas. This defines not only the file the image is sliced from but also its location in the greater image and its sizing.

## Notes

Since there's no direct link between a -builder item and the building it places, its trivial to give, for example, a seed the ability to place an airlock.

Particularly since there are unused images in the files, it should be easy to create entirely new items as long as you don't require new actions. However, buildings are not yet exposed to the user for modifying so you're stuck with the existing ones for now.