Modding:Content Tutorial Further Recipes: Difference between revisions

From Vintage Story Wiki
m
mNo edit summary
Line 288: Line 288:


== Smithing Recipes ==
== Smithing Recipes ==
Smithing recipes are, once again, similar to both clayforming and knapping recipes. If you open the ''metalsheets.json'' file in the ''smithing'' recipe folder, you will see the following code:<syntaxhighlight lang="json">
{
  "ingredient": {
    "type": "item",
    "code": "game:ingot-*",
    "name": "metal",
    "allowedVariants": [ "copper", "brass", "tinbronze", "bismuthbronze", "blackbronze", "silver", "gold", "iron", "lead", "tin", "zinc", "bismuth", "chromium", "electrum", "platinum", "titanium", "molybdochalkos", "meteoriciron", "steel" ]
  },
 
  "output": {
    "type": "block",
    "code": "game:metalsheet-{metal}-down",
    "quantity": 4
  }
}
</syntaxhighlight>Smithing recipes will always start with an ingot as their ingredient, however you can specify what ingots can be used by using ''allowedVariants''. In this example, the recipe will create 4 metal sheets (an unused block) on an anvil.
You need to define a pattern for the recipe. Between the ingredient and output properties, add the following pattern:<syntaxhighlight lang="json">
"pattern": [
    [
      "###_###",
      "###_###",
      "###_###",
      "_______",
      "###_###",
      "###_###",
      "###_###"
    ]
  ],
</syntaxhighlight>Smithing recipes accept patterns similar to clayforming. As always, an underscore is blank and a hash sign is a full voxel. Each array (defined inside '''[ ]''') counts as a single voxel layer, starting from the bottom. This example only uses a single layer.
Smithing recipes can be 16x16 in width and length, and a maximum of 6 voxels high. Each ingot provides a total of 42 voxels to manipulate, so you can use this to calculate how many ingots your item will need to create. This example, although difficult to craft, can be made using a single ingot.
When the pattern is added, the smithing recipe can be tested in game.


== Conclusion ==
== Conclusion ==
Confirmedusers
637

edits