Skip to content

Custom Crafting Recipes

amione edited this page Oct 24, 2024 · 2 revisions

Editing CustomCraftingRecipes.json in Darkwood

This guide will walk you through how to edit CustomCraftingRecipes.json to modify crafting recipes using this mod. You will specify the required materials, the output item, and other relevant details.

Understanding CustomCraftingRecipes.json

The CustomCraftingRecipes.json file defines the crafting recipes for various items in the game. Each recipe includes details about the level required to craft it, the output item, and the necessary resources. The format consists of several key fields:

  • requiredlevel: The level required to craft the item.
  • resource: The item that will be produced by the crafting recipe.
  • givesamount: The quantity of the resource that is produced.
  • requirements: A list of items and their quantities needed to craft the resource.

Example format:

{
  "spring": {
    "requiredlevel": 2,
    "resource": "spring",
    "givesamount": 1,
    "requirements": {
      "junk": 1,
      "wire": 2
    }
  },
  "ammo_clip_mediumCal": {
    "requiredlevel": 3,
    "resource": "ammo_clip_mediumCal",
    "givesamount": 1,
    "requirements": {
      "ammo_single_mediumCal": 10,
      "spring": 1,
      "junk": 2
    }
  }
}

In this example:

  • The recipe for spring requires level 2 and produces 1 unit of spring using 1 unit of junk and 2 units of wire.
  • The recipe for ammo_clip_mediumCal requires level 3 and produces 1 unit of ammo_clip_mediumCal using 10 units of ammo_single_mediumCal, 1 unit of spring, and 2 units of junk.

Customizing Recipes

To create or modify recipes:

  1. Copy an existing recipe from the Config/ModDefaults/CustomCraftingRecipes.json file.
    • (and add it to your own (Config/Customs/CustomCraftingRecipes.json))
  2. Change the name and resource field to the item you want to craft.
  3. Adjust requiredlevel to set the crafting level.
  4. Modify givesamount to change the output quantity.
  5. Update the requirements to reflect the necessary crafting materials.

For example, to create a new crafting recipe for metal_pipe:

"pipe_metal": {
  "requiredlevel": 1,
  "resource": "pipe_metal",
  "givesamount": 1,
  "requirements": {
    "junk": 3
  }
}

In this recipe:

  • Crafting a pipe_metal requires level 1 and produces 1 unit of pipe_metal using 3 units of junk.

Tips:

  • Ensure that all item names used in requirements match the item IDs defined in your game.
  • You can add multiple recipes in the same CustomCraftingRecipes.json file by separating each recipe with a comma.
  • Check the game for errors after making changes to ensure everything works as expected.