Recipe Tutorials - dredmor-com/dungeons-of-dredmor GitHub Wiki
In this tutorial, you'll be taught how to make the 'craftDB.xml' file, which tells the game what new recipes to add onto the available crafting stations, what is needed to output a certain item and how much skill a character needs to perform the crafting. This also applies to Encrusting, a way to upgrade your equipment at a risk.
-
Crafting Recipes
1.1. Simple Recipes
1.2. Multiple Outputs
1.3.Syntax -
Encrusting Recipes
2.1. Simple Encrusting
2.2. Adding Powers
2.3. Adding Buffs - See Also
After making a valid mod setup, both a directory and basic mod data, you'll perhaps want to add new crafting recipes for the game. If so, you can begin by creating a file named 'craftDB.xml' on your mod folder. When editing, make sure it starts with <craftDB>
and ends with </craftDB>
, or the mod community might never see you back alive.
In the game's XML files, recipes look like this:
<craft hidden="1">
<output skill="4" name="Steeled Robe" amount="1" />
<tool tag="alchemy"/>
<input name="Robe" />
<input name="Potion of Steeling" />
<input name="Steel Ingot" />
</craft>
We can break this down in parts:
Code | Explanation |
---|---|
<craft hidden="1"> |
Each recipe starts with <craft> and ends with </craft>, with each set of these counting as one recipe. Its hidden tag is a boolean to mark the recipe as hidden. In our case, it will be hidden. This means the user can only access it by "discovering" it, either through a bookshelf, the Paranormal Investigator skill or specific level-ups. |
<output skill="4" name="Steeled Robe" amount="1"/> |
The <output.../> tag determines what item is created when the "Craft!" button is pressed. 'skill="1"' means that you'll need a skill of 1 to craft this. In the example, you'd need 4. 'name="Steeled Robe"' will define the name of the item to output, in this case, a Steeled Robe. 'amount="1"' means that this recipe will yield 1 item on the exchange. Omitting this will yield a single item by default, otherwise, you can adjust the number to your liking. |
<tool tag="alchemy"/> |
The <tool.../> tag indicates what tool is needed for crafting and what kind of skill should be verified via the 'tag' attribute. In this case, the player would need an Alchemy toolkit and their Alchemy level would be tested. There are other values for this tag, like "smithing", "tinkerer", etc. |
<input name="Robe"/> <input name="Potion of Steeling"/> <input name="Steel Ingot"/>
|
Lastly, the <input.../> tags determine what items are needed to proceed with the craft. Each tag corresponds to one and only one item, with a maximum of four inputs. For example, to create a recipe for Deep Omelettes, you'd need to write <input name="Diggle Egg"/> four times. |
You may have outputs listed for a single recipe, even giving different items. Let's take a look at an example with Steel Bolts:
<craft>
<output skill="0" name="Steel Bolt" amount="6"/>
<output skill="1" name="Steel Bolt" amount="7"/>
<output skill="2" name="Barbed Steel Bolt" amount="8"/>
<output skill="3" name="Barbed Steel Bolt" amount="9"/>
<output skill="4" name="Cruelly Barbed Steel Bolt" amount="10"/>
<output skill="5" name="Cruelly Barbed Steel Bolt" amount="11"/>
<output skill="6" name="Ingeniously Scythed Steel Bolt" amount="12"/>
<output skill="7" name="Ingeniously Scythed Steel Bolt" amount="13"/>
<tool tag="tinkerer" />
<input name="Steel Ingot"/>
</craft>
As long as each <output.../>
tag has a different skill level and the skill levels are listed in ascending order, the recipe will work. In this case, we have four different items being crafted at eight different quantities, depending on the player's Tinkering level.
Here, we shall explain how different tags and attributes work on a crafting recipe. Take a look at the recipe for Tesla's Bolt.
<craft hidden="1">
<output skill="2" name="Tesla's Bolt" amount="1"/>
<output skill="3" name="Tesla's Bolt" amount="2"/>
<output skill="4" name="Tesla's Bolt" amount="3"/>
<output skill="5" name="Tesla's Bolt" amount="4"/>
<tool tag="tinkerer" />
<input name="Iron Ingot"/>
<input name="Copper Wire" />
<input name="Voltaic Cell" />
</craft>
Tag | Attribute | Description |
---|---|---|
craft | hidden="1" | Determines if you can make this recipe from the get-go or if you must discover it first. |
output | skill="2" | The crafting level needed to make this recipe. |
name="Tesla's Bolt" | The name of the output, this is, what the recipe is for. This should exist in an itemDB.xml either in the base game or in a mod. | |
amount="1" | For stackable crafs like bolts and thrown weapons, this gives the quantity output for a given set of ingredients. | |
tool | tag="tinkerer" | The crafting tool that's used to craft this recipe and also the skill type needed for it. Refer to the 'skill' argument above. |
input | name="Iron Ingot" | One of up to four items needed to craft this recipe. |
If you possess Dungeons of Dredmor's third expansion pack, the Conquest of the Wizardlands, you'll have access to its Encrusting mechanic, alongside normal crafting. Its recipes are similar to crafting ones while also having the properties of spells. Here's an example from the game.
<encrust name="Hive Weapon">
<description text="Turn any ordinary weapon into a nest for hungry Thaumites." />
<tool tag="alchemy" />
<slot type="weapon" />
<input name="Potion of Mana" />
<input name="Potion of Mana" />
<input name="Aqua Vitae" />
<input name="Arcane Wand" />
<skill level="2" />
<power name="Thaumite Infection" chance="0.10" />
<encrustwith name="wickedly gleaming barbs" />
<instability amount="10" />
</encrust>
Following the same setup from Crafting Recipes, you can also create a file named 'encrustDB.xml' in your mod folder. It should start with <encrustDB>
and end with </encrustDB>
, lest your mod highly probably explodes your computer, and your neighbor's, for good measure.
Once this is done, every encrust needs to be sorrounded by the <encrust>
tags, as above. Next up, some details:
Code | Explanation |
---|---|
<encrust name="Hive Weapon"> ... <-- Your code here </encrust>
|
In the opening tag, before your code, name="Your Recipe Name" is the name of the encrust you're making. You can also add the argument hidden="1" if you want this recipe to be found before being able to craft it. |
<description text="Turn any ordinary weapon into a nest for hungry Thaumites./> |
The description tag gives a description to show in-game. Its text attribute will be displayed when hovering over the recipe in the Encrusting menu. |
<tool tag="alchemy"/> |
This tag does the same as on the Crafting section above: it determines the toolset and skill level needed to use the encrust. |
<slot type="weapon"/> |
The slot tag wil determine which type of item can be encrusted with this recipe. Use one of these lines for each type of item you want to be able to encrust. The available values are 'weapon', 'shield', 'ranged', 'chest', 'legs', 'hands', 'waist', 'ring', 'neck', 'feet' and 'head'. This also determines the icon to be used in the Encrusting menu. |
<input name="Potion of Mana"/> |
This works just like in the Crafting section above. You can only use this tag up to four times per encrust. You must set the name of the input item and every item gets its own line and tag, even duplicates. |
<skill level="2"/> |
Like in Crafting, this tells you what skill level is needed to encrust the item. The type of skill is determined by the 'tool' tag. |
<power name="Thaumite Infection" chance="0.10"/> |
Power tags are reserved for weapons and crossbows, along with any buffs. The chance argument indicates the chance that this item uses an especified power, in this case, 0.10 or 10%. More details below. |
<encrustwith name="wickedly gleaming barbs"/> |
The attribute of this argument will show up in the weapon's description text after the encrust is completed. |
<instability amount="10"/> |
Finally, this is how much Instability is added to the item when this recipe is used.For more on instability and how it works, check out the Instability mechanic. |
Encrusts wouldn't be much good without effects! Here's what you can add with an encrusting recipe:
<power name="Thaumite Infection" chance="0.10"/>
Powers only apply to Melee Weapons and Crossbows. The name attribute must be the name of a power listed in itemDB.xml, either in the game's files, an existing mod or your own. The chance attribute must be a number between 0 and 1, which is multiplied by 100 to get a concrete percentage, which is the chance this power has to be activated upon attacking a foe.
In 'itemDB.xml', power tags look like this:
<power name="Thaumite Infection" description="infects your enemies with ravenous thaumites." spell="Thaumite Infection"/>
The name attribute must match the name provided in the encrusting recipe. The description attribute will be added to the weapon's description text. Finally, the spell attribute will cast the given spell when the weapon procs, and must point to a spell entry in 'spellDB.xml'. You may use an existing spell or one of your own. See the Spell Tutorial for more information.
You'll usually be adding buffs to your encrust, no matter what the item is. The buff tags will add stats to the item that will get added to (or substracted from) the item's base stats when encrusted.
The four possible buffs are <primarybuff> for the six primary stats, <secondarybuff> for calculated stats such as Counter or Sneakiness, <damagebuff> to affect damage added by the item and <resistbuff> to add (or substract) resistances.
<primarybuff id="2" amount="-3"/> <!-- -3 to Nimbleness -->
<secondarybuff id="10" amount="1"/> <!-- +1 to Armour Absorption -->
<damagebuff acidic="3" putrefying="3" /> <!-- +3 Acidic damage and +3 Putrefying damage -->
<resistbuff existential="4" /> <!-- +4 to Existential resistance -->
You can use as many of these as you want. See the pages on Player Stats and Damage Types for what id's and damages to use.