Talk:RGBx01:Draft:Data:Assets/recipes

From Starbounder - Starbound Wiki
Jump to: navigation, search

/!\ DRAFT /!\ Data:Assets/recipes /!\ DRAFT /!\

Recipes define what ingredients are required to make an item, and where the item can be made. A recipe can require multiple item types, but only produce a single type as output (however, the amount is only limited by maximum stack size). Spelling and capitalization are very important! Double and triple check the reference ID name, otherwise you will get a Perfectly Generic Item (or PGI for short).

Important Notes

  • Only one output type is currently allowed.
  • You can have multiple recipes for the same item - using the same file name, but if you wish the recipe to be unlocked differently, you should use a different recipe name.
  • Recipes require to be "unlocked" before they can be used by the player. This is either done by adding it through the player.config - for general unlock. Species file - for species specific unlock. Or added as a loot drop using the syntax "recipefilename-recipe".
  • Subgroups of crafting objects are defined via the associated config file.
  • You can create recipes for randomly generated items.
  • Some vanilla items do not follow the standard format of lower-case reference IDs! Ceruliumbar, Ceruliumore, Rubiumbar, Rubiumore are classic examples (as of Enranged Koala).

Syntax

Variable Value Description
input [{"item": string, "count": int},...] Input items and the amount of each required. This Array can hold multiple Objects, each defining a separate required input item type and amount.
output {"item": string, "count": int} Output item type and amount crafted. Only a single Object!.
groups [string, ...] Groups the recipe is attached too. Each crafting object has its own group, and subgroups such as "weapon", "armor" or "tools".

By default all recipes specifying that crafting object's group will be shown on the first page. Specific subgroup items will be filtered onto associated sub group tabs defined by the interface .config file of that crafting object.

Sample

This is recipes/starter/crafting table/stoneaxe.recipe, the recipe for crafting a Stone Axe at the Crafting Table:

{
  "input" : [
    { "item" : "darkwoodmaterial", "count" : 15 },
    { "item" : "cobblestonematerial", "count" : 10 }
  ],
  "output" : {
    "item" : "stoneaxe",
    "count" : 1
  },
  "groups" : [ "craftingtable", "tools", "all" ]
}

Randomly generated objects

For an example of how to specify a randomly generated object as output, see assets/recipes/starter/anvil/basicshield.recipe:

...
"output" : { "item" : "generatedshield", "count" : 1,
  "data" : { "definition" : "startershield", "level" : 1 } },
...

As you can see, you can break long lines into several shorter ones (done here so the wiki layout won't break). Just make sure to follow the JSON syntax rules. As a rule of thumb, only break after ',' or ':' and you're safe.