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 thesvTinkers
sovereign) and components (for any items with thetinkers
attribute) - UAS Armor Forge recipes (stored in the
<Recipes>
GlobalData on theunidUASArmorForge
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 craftcount
number of items in batch (for ammo etc)enhancement
enhancements to apply to the itemcomponents
list of items required to craft the itemmarkUp
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 pricetotalCost
specifies a total price (markUp
andextraCost
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
Also see: Tinker updates
This is awesome! Thank you.