-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New Contributor Guide Recipes
Mark Langsdorf edited this page Jun 17, 2020
·
1 revision
Recipes determine what you can craft. They're relatively easy to add.
Recipes are stored in data/json/recipes. There are some subfolders there and subfiles like recipe_food.json. Just pick one that seems appropriate.
This is the JSON object for the salt (made from boiling water) recipe:
{
"type": "recipe",
"result": "salt",
"id_suffix": "from_salt_water",
"category": "CC_FOOD",
"subcategory": "CSC_FOOD_OTHER",
"skill_used": "cooking",
"difficulty": 0,
"time": "90 seconds",
"autolearn": true,
"batch_time_factors": [ 80, 4 ],
"qualities": [ { "id": "BOIL", "level": 1 } ],
"tools": [ [ [ "water_boiling_heat", 3, "LIST" ] ] ],
"components": [ [ [ "salt_water", 10 ], [ "saline", 50 ] ] ]
},
Important bits:
-
"type"
has to be"recipe"
-
"result"
is the"id"
of the item that the recipe creates. items are defined in data/json/items/ and its subfolders. -
"id_suffix"
is used to differentiate two recipes that have the same results. It doesn't really mean anything and you can put anything here as long as every recipe with the same result has a different id_suffix, but it's good practice to use something that makes it easy to tell why each recipe is different. -
"category"
and"subcategory"
are where the recipe will end up in the craft menu. You have to use a valid string in both cases, so look through the recipes to find one in the same category as your new recipe and use those values. -
"skill_used"
is the"ident"
of the primary skill for the recipe. possible skills are in data/json/skills.json -
"difficulty"
is the number of the skill level where you have a high chance of automatically making this recipe. -
"time"
a string specifying the time to create a single result. Time strings should be of the form "NUMBER UNIT", where NUMBER is a number of or more and UNIT is one of "seconds", "minutes", "hours, or "days"."time"
can also be specified in ticks, where 100 ticks is 1 turn which is 1 second, but please use the time strings as they're easier for everyone to read and understand. -
"autolearn"
istrue
if you learn the recipe automatically when your skill reaches difficulty. Otherwise, there should be a"book_learn"
entry, with a list of lists of references books and the skill level at which you get the recipe, like"book_learn": [ [ "cookbook_sushi", 3 ] ]
for sushi veggy rolls. The books are refered to by "id" from data/json/items/ again. -
"qualities"
is a list of tool qualities you need to make the recipe. Available qualities are in data/json/tool_qualities.json and items define what tool qualities they provide. Items that provide qualities are not consumed by the recipe. -
"tools'
is a list of tool types you need, in addition to the qualities. While qualities is a list of objects, tools is a list of lists. Items that provide tools are not consumed by the recipe. -
"components"
is a list of lists of components that are consumed by the recipe. They break down like this:[ "water", 1]
is a single component, where the first string is"id"
of the item in the component, and the second number is the number of that item that is required.[ [ "water", 1 ], [ "water_clean", 1 ] ]
is an options list. it's a list of single components. either component can be used to satisfy the recipe. It can have as a single entry.
"components": [
[ [ "scrap", 1 ] ],
[ [ "water", 1 ], [ "water_clean", 1 ] ],
]
is the full components list, made up of options lists. So this recipe requires a piece of scrap metal and a unit of water or clean water.
So adding a new recipe requires that you have:
- the id of resulting item
- the ids of all components and tools
- the qualities of any tools specified by quality
- the ident of the skill
- the difficulty of the crafting
- the ids of any books used to learn the recipe
- the time to make the recipe.
Back to the Guide for first time contributors