{ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "https://raw.githubusercontent.com/budak7273/ContentLib_Documentation/main/JsonSchemas/CL_Recipe.json", "title": "ContentLib Recipe", "description": "ContentLib Recipe struct definitions can be made from this JSON, and when converted to JSON, will follow this form.", "$comment": "This is NOT a copy-paste template! Check the docs to see how to use this! https://docs.ficsit.app/contentlib/latest/index.html", "type": "object", "additionalProperties": false, "properties": { "Name": { "type": "string", "description": "Override for the recipe's name, which is displayed inside the manual crafting bench, build gun, or any machines you set it to be used in. By default, recipes take the name of their first product item." }, "Ingredients": { "type": "array", "description": "ItemAmounts which form the ingredients. Be sure to not exceed an item's stack size, and remember that 1000 fluid units displays as 1 Liter ingame. See 'ClearIngredients' to append instead of replace.", "items": { "$ref": "./Components/CL_ItemAmount.json" }, "examples": [ [ { "Item": "Desc_CopperIngot", "Amount": 1 }, { "Item": "Desc_Water", "Amount": 5000 } ] ] }, "Products": { "type": "array", "description": "ItemAmounts which form the recipe outputs. Be sure to not exceed an item's stack size, and remember that 1000 fluid units displays as 1 Liter ingame. Manual recipes should only have 1 product. See 'ClearProducts' to append instead of replace.", "items": { "$ref": "./Components/CL_ItemAmount.json" }, "examples": [ [ { "Item": "Desc_Biofuel", "Amount": 10 } ] ] }, "ProducedIn": { "type": "array", "description": "Automatic name resolved asset. Machines/builders which this recipe can be used in. The examples are not an exhaustive list, see game logs for a list of all detected producers. See 'ClearBuilders' to append instead of replace.", "uniqueItems": true, "items": { "$ref": "./Components/CL_NameResolvedAsset.json", "examples": [ "BP_WorkBenchComponent", "BP_WorkshopComponent", "BP_ManualManufacturingComponent", "Build_SmelterMk1", "Build_ConstructorMk1", "Build_AssemblerMk1", "Build_FoundryMk1", "Build_ManufacturerMk1", "Build_OilRefinery", "Build_Packager", "Build_Blender", "Build_HadronCollider", "Build_Converter", "Build_QuantumEncoder", "BP_BuildGun" ], "allOf": [ { "$comment": "The `manual` workaround is no longer needed, use the actual crafting component name.", "if": { "const": "manual" }, "then": { "const": "<`manual` workaround no longer needed! Use BP_WorkBenchComponent or BP_WorkshopComponent instead!>" } }, { "$comment": "[Crafting Bench] Manual crafting must use the crafting component name, not the build name.", "if": { "anyOf": [ { "const": "FGWorkBench" }, { "const": "Build_WorkBench" }, { "const": "Build_WorkBenchIntegrated" } ] }, "then": { "const": "BP_WorkBenchComponent" } }, { "$comment": "[Workshop] Manual crafting must use the crafting component name, not the build name.", "if": { "const": "Build_Workshop" }, "then": { "const": "BP_WorkshopComponent" } } ] } }, "OverrideCategory": { "type": "string", "description": "By default, recipes take on the category of their first product item. Specifying something here causes it to be used as the category instead. Either a base-game category, or a string which ContentLib will automatically turn into a category for you.", "examples": [ "Cat_Other", "MyCustomAutoCreatedCategory" ] }, "ManufacturingDuration": { "type": "number", "description": "The time it takes for a machine to process this recipe in seconds. Recipe energy consumption is usually this times the machine's power usage." }, "ManualManufacturingMultiplier": { "type": "number", "description": "If you want to use the same recipe for machines and the craft bench, this defines how much longer the crafting of this recipe should take in the craft bench. With the multiplier set to the default of 0, the number of clicks to craft is the number of seconds it takes to craft divided by two.", "examples": [ 0.0 ] }, "UnlockedBy": { "type": "array", "description": "Automatic name resolved asset. Schematics to add this recipe to. Alternative way of tying recipes to schematics; the standard way is to use the schematic's 'Recipes' field. This is useful if you don't want to also make a patch to add your recipe to a base-game schematic. Something must unlock the recipe, else it will never be accessible in-game. If you want it to be unlocked by default, use Schematic_StartingRecipes.", "items": { "$ref": "./Components/CL_NameResolvedAsset.json" }, "examples": [ [ "Schematic_StartingRecipes" ], [ "Schematic_1-1" ] ] }, "VariablePowerConsumptionFactor": { "type": "number", "description": "Only works in variable consumption machines (the Particle Accelerator in base game). Added to the VariablePowerConsumptionFactor to get the 'maximum' power consumption the recipe can scale up to over its cycle." }, "VariablePowerConsumptionConstant": { "type": "number", "description": "Only works in variable consumption machines (the Particle Accelerator in base game). The 'minimum' power consumption the recipe can scale down to over its cycle." }, "ManufacturingMenuPriority": { "type": "number", "description": "Controls the order that recipes appear within their category. Lower values means earlier in the menu. Negatives and decimals allowed." }, "OverrideName": { "type": "boolean", "description": "For patches, should the Recipe this is used on have its 'use override name' flag enabled? Default is true when 'Name' exists, false when not. This can be used to ex. revert a recipe's displayed name to that of its first product, instead of the custom name that was specified for it." }, "ClearIngredients": { "type": "boolean", "description": "For patches, should the Recipe this is used on have its existing Ingredients array cleared before adding to it? Default is true when 'Ingredients' exists, false when not." }, "ClearProducts": { "type": "boolean", "description": "For patches, should the Recipe this is used on have its existing Products array cleared before adding to it? Default is true when 'Products' exists, false when not." }, "ClearBuilders": { "type": "boolean", "description": "For patches, should the Recipe this is used on have its existing ProducedIn array cleared before adding to it? Default is true when 'ProducedIn' exists, false when not." }, "RequireItemValidation": { "type": "boolean", "description": "When true, all ingredient and product items will be checked to ensure they exist before the recipe is created or patched. If an invalid item is encountered, this recipe will not be created (creation) or the patch will not be applied (patches). False by default, but this is planned to become true in ContentLib 2.x.x" } }, "allOf": [ { "$comment": "Manual and buildgun recipes should only have one product", "if": { "required": [ "ProducedIn" ], "properties": { "ProducedIn": { "contains": { "anyOf": [ { "const": "BP_WorkBenchComponent" }, { "const": "BP_WorkshopComponent" }, { "const": "BP_ManualManufacturingComponent" }, { "const": "BP_BuildGun" } ] } } } }, "then": { "properties": { "Products": { "maxItems": 1 } } } } ], "patternProperties": { "schema": { "$comment": "Allow the $schema line in files", "type": "string" }, "comment": { "$comment": "Allow the $comment line in files", "type": "string" } } }