Currently we support two crafting systems: the tinker recipe system used for Tinkers and the UAS Armor Forge, and the Item Components system introduced in API 29

The new Item Components system allows more flexibility in specifying the required items (e.g. the component list can be randomized so different items are required in each play through). However, the older recipe system currently has more features for controling the price and applying enhancements etc. to the crafted item.

Current Use

As of 1.8a2 (API 37) the systems are available:

  • Tinkers supports both recipes (stored in the <Recipes> GlobalData on the svTinkers sovereign) and components (for any items with the tinkers attribute)
  • UAS Armor Forge recipes (stored in the <Recipes> GlobalData on the unidUASArmorForge type)
  • Mechanist Foundry components (for any items with the erebienFoundry attribute)

Components

The components needed to craft an item are defined in the XML. For example:

<ItemType unid="&itNanoforgedTitaniumArmor;"
   ...
   />

   <Components>
      <Item count="6" item="&itTitaniumOre;"/>
   </Components>
</ItemType>

NOTE: It is perfectly valid to have the component list be randomized. In that case, the engine determines the actual list of components at the beginning of the game and keeps it consistent throughout.

Crafting Cost

The cost to craft from components depends on the total cost of all the components (if the component is a device we assue a damaged device):

  • When crafting armor, the work price is 25% of the component cost
  • When crafting a device, the work price is 50% of the component cost
  • Otherwise, the work price is 20% of the component cost

Recipes

Crafting recipes are specified with a struct using the following supported elements:

  • item item to craft
  • count number of items in batch (for ammo etc)
  • enhancement enhancements to apply to the item
  • components list of items required to craft the item
  • markUp markup relative to component price either as an integers (interpreted as a percentage e.g. 10 = 10%) or as a double (such that 0.1 = 10%)
  • extraCost constant price added to work price
  • totalCost specifies a total price (markUp and extraCost ignored)

Crafting Cost

  • If a totalCost is specified in the recipe we use that value and skip all other cost calculations
  • If markUp is specified then crafting cost is: markUp * componentPrice + extraCost
  • Otherwise crafting cost is: itemCost - componentPrice + extraCost
giantcabbage 3 Jul 2017:

Also see: Tinker updates

george moromisato 7 Jul 2017:

This is awesome! Thank you.