Creating a Recipe

This example will cover making a new recipe for Solid Biofuel from Coal that can only be made in the Constructor. It will be unlocked by the existing Schematic 1-1 (the first Milestone in Tier 1).

Make sure to follow the Setting Up tutorial first!

In order to write your own recipes, you will need the following:

  • The internal names of the ingredients and products in your recipe

  • The internal name of the building(s) that can use your recipe (a few are listed below)

  • The internal name of the schematic that will unlock your recipe

First, here’s two example recipes to show some of what’s possible:

Example Starter Simple Recipe

Below is an example recipe and a screenshot of it within the Item Codex in game.

{
    "$schema": "https://raw.githubusercontent.com/budak7273/ContentLib_Documentation/main/JsonSchemas/CL_Recipe.json",
    "Name": "BioFuel",
    "Ingredients": [
        {
            "Item": "Desc_Coal",
            "Amount": 1
        }
    ],
    "Products": [
        {
            "Item": "Desc_Biofuel",
            "Amount": 10
        }
    ],
    "ManufacturingDuration": 1,
    "ProducedIn": [
        "Build_ConstructorMk1"
    ],
    "UnlockedBy": [
        "Schematic_1-1"
    ]
}

Recipe

Example Complex Recipe

Here’s an example recipe for the Blender made by McGalleon.

{
    "$schema": "https://raw.githubusercontent.com/budak7273/ContentLib_Documentation/main/JsonSchemas/CL_Recipe.json",
    "Name": "Synthetic Crystal",
    "Ingredients": [
        {
            "Item": "Desc_RawQuartz",
            "Amount": 16
        },
        {
            "Item": "Desc_QuartzCrystal",
            "Amount": 7
        },
        {
            "Item": "Desc_Water",
            "Amount": 4800
        }
    ],
    "Products": [
        {
            "Item": "Desc_QuartzCrystal",
            "Amount": 20
        }
    ],
    "ManufacturingDuration": 8,
    "ProducedIn": [
        "Build_Blender"
    ],
    "UnlockedBy": [
        "Schematic_1-1"
    ]
}

Blender example ingame

Setting Up

After setting up your text editor, go ahead and create a new file called Recipe_YourNameHere.json in your mod’s Recipes folder and copy in the "Example Starter Recipe" from above.

It is important that your recipe name is formatted in this way because the file name will become the internal recipe blueprint name once the recipe is loaded.

It’s important to make sure that the names of your files do not conflict with the names of any existing assets. If a conflict is found, it will appear in the logs, which will be discussed later. For now, try to be unique and specific with your file names to avoid any possible conflicts.

Notice the $schema line at the top of what we copied in - that tells your editor what kind of format the file will follow.

If you’ve set up your editor correctly, you should be able to hover over fields to get a description of their purpose, or press Ctrl+Space, and your editor will suggest other fields you could add.

If you don’t see these, go get a good text editor as described on the Setting Up page!

Locate Asset Names

Next, you need to find the item, building, and schematic names. These names are part of the 'blueprint path' of the items in the game’s files. Thankfully, this mod will automatically resolve part of the blueprint path into the full name, saving you from having to type out the full name. You can exclude the "_C" from the end as well.

Find out how to track down asset names here.

Watch out - if you’re using fluids in your recipes, you need to multiply the item count by 1000. Learn more on the Fluids page.

Here are a few Vanilla building names. You can also use the JSON Schema auto-suggest feature and your editor will auto-suggest them from a list.

  • Smelter: Build_SmelterMk1

  • Constructor: Build_ConstructorMk1

  • Assembler: Build_AssemblerMk1

  • Foundry: Build_FoundryMk1

  • Manufacturer: Build_ManufacturerMk1

  • Refinery: Build_OilRefinery

  • Packager: Build_Packager

  • Blender: Build_Blender

  • Particle Accelerator: Build_HadronCollider

These particular base game buildings can all be found in subdirectories of /Game/FactoryGame/Buildable/Factory/.

There is currently a bug preventing the Craft Bench (/Game/FactoryGame/Buildable/-Shared/WorkBench/BP_WorkBenchComponent) and Equipment Workshop (/Game/FactoryGame/Buildable/-Shared/WorkBench/BP_WorkshopComponent) from being detected correctly by ContentLib. In the mean time, you can use the producer name manual (case sensitive) to add your Recipe to every manual crafting station.

I’m not really sure why this works - McGalleon figured it out. This bandaid is not ideal, because it means every modded manual crafting station will also contain your recipe. I plan to add a warning message when it’s used in the future. But it’s a passable workaround for now.

Schematic names for HUB milestones will generally follow the format Schematic_1-1, but you can find out specific ones via the approaches described here.

You can also create your own schematic to unlock the recipe by following the Create a Schematic tutorial.

Use the values you’ve selected and the example recipe above to create your recipe, then place it in the FactoryGame/Configs/ContentLib/Recipes directory and launch the game to try it out. If you’ve done everything correctly, you should see your recipe unlocked by the schematic you specified, and you can use it in the machines you added to ProducedIn.

Next Steps

There are a lot more fields you can use that this tutorial did not discuss.

Check out the hover-tooltips and auto-suggested fields that the JSON schema provides to see some more possibilities.

You can also out the Recipe page for more info.

Common Errors

Make sure to read the Troubleshooting page.

  • Nothing showing up at all in the logs

    • Make sure your recipes are in the FactoryGame/Configs/ContentLib/Recipes directory.

  • Wrong Naming Convention ! "Recipe" expected followed by a Name

    • Your recipe file should be names like this: Recipe_YourNameHere.json

  • Item not showing up in-game

    • Did you give your Item or Recipe a Category? If not, it will only show up when searched for.

    • This could be the fault of the item, or the custom recipe you made to grant it. Check the logs as described on the Troubleshooting page.