Crafting & Enchanting

From RPG Creation Kit
Jump to navigation Jump to search

In this tutorial we are going to take a look at the new Crafting and Enchanting systems, features that came with Update 2.1.

Crafting allows the Player to turn ingredients into new items at a Crafting Station, Enchanting allows the Player to apply magical effects to weapons and armors at an Enchanting Station. Both systems are recipe based, so all you have to do is create the recipe assets and place a station in the world.

How Crafting Works

A Crafting Recipe is an asset that describes an output item and the ingredients needed to create it. The Player interacts with a Crafting Station in the world, selects one of the recipes available on that station, chooses how many times to craft it and presses the craft button. The ingredients are removed from his Inventory and the output item is added to it.

The ingredients can also be stolen items, in that case the stolen ones are consumed first, and the crafted item is always "clean" (see Items Ownership, Metadata and Stealing).

Creating a Crafting Recipe

Right click in the Project Window and select Create > RPG Creation Kit > Crafting > New Crafting Recipe.

Craft 1.png

For each recipe you can set:

  • Recipe ID: the unique ID of the recipe.
  • Recipe Name: the name shown in the crafting UI.
  • Recipe Icon: the icon shown in the crafting UI.
  • Output Item: the item the Player will receive.
  • Output Amount: how many of the output item are given per craft.
  • Ingredients: the list of the required items, for each one you can set the item and the amount.

Important: after creating a Crafting Recipe, you have to update the database.

Creating a Crafting Station

Now we need a station in the world where the Player can use our recipes. Take any 3D Model, such as a forge or a cooking pot, and:

1) Set its Tag to "RPG Creation Kit/Crafting Station".

2) Add a Physical Collider (non-trigger) to it.

3) Add a "Crafting Station" component to it.

The component has the following fields:

Craft 2.png

  • Station ID: the unique ID of the station.
  • Station Name: the name shown at the top of the crafting panel.
  • On Use Sound: the sound played when the Player opens the station.
  • Available Recipes: the list of the Crafting Recipes this station offers.

Different stations can offer different recipes, so you can have a forge that crafts weapons and a cooking pot that crafts food, just by referencing different recipes in this list. You can also have different stations with different recipes, and exploit the use of Mutables to mutate stations into more powerful ones, for example as the player progresses in the game.

At this point, it is a good idea to make this object a Prefab, so when you want to add a new station you will only have to set its unique ID.

Looking at the station in game will show the interact prompt, pressing it opens the crafting panel. The panel shows all the recipes of the station, you can search them by name, and for each ingredient you will see how many you have and how many you need (in green if you have enough, in red if you don't).

With the + and - buttons you can craft the same recipe multiple times at once.

Craft 3.png

How Enchanting Works

Enchanting applies an Enchanting Recipe to a weapon or an armor of the Player. An enchanted item:

  • Gets a suffix appended to its name, for example "Iron Helmet" becomes "Iron Helmet of the Magi".
  • Grants its effects to the Player as long as the item is equipped.
  • Gets its value increased, both in the inventory and in the merchant prices.
  • Shows an enchanted icon in the inventory, and it will not stack with non-enchanted copies of the same item.

An item can only have one enchantment. The enchantment is stored on the item itself, so it survives saving and loading, dropping the item in the world, selling it to a merchant and buying it back.

Creating an Enchanting Recipe

Right click in the Project Window and select Create > RPG Creation Kit > Enchanting > New Enchanting Recipe.

Craft 5.png

For each recipe you can set:

  • Recipe ID: the unique ID of the recipe.
  • Recipe Name: the name shown in the enchanting UI.
  • Recipe Icon: the icon shown in the enchanting UI.
  • Enchantment Suffix: the text appended to the name of the enchanted item.
  • Added Value: golds added to the base value of the item while it is enchanted.
  • Applies To: if the recipe can be applied to Weapons, Armors or Both.
  • Ingredients: the materials consumed from the Inventory when enchanting.
  • Effects: the constant effects granted while the enchanted item is equipped. Only the Fortify and Damage types are allowed (Attribute, Health, Stamina and Mana), the duration is ignored since the effect is constant.
  • Items Granted On Disenchant: the items that may be given back to the Player when the item is disenchanted, each entry has its own probability (0-100%).

Important: after creating an Enchanting Recipe, you have to update the database.

Creating an Enchanting Station

The Enchanting Station works exactly like the Crafting Station:

1) Set the Tag of your 3D Model to "RPG Creation Kit/Enchanting Station".

2) Add a Physical Collider (non-trigger) to it.

3) Add an "Enchanting Station" component to it.

Craft 6.png

The component has the following fields:

  • Station ID: the unique ID of the station.
  • Station Name: the name shown at the top of the enchanting panel.
  • On Use Sound: the sound played when the Player opens the station.
  • On Enchanted Sound: the sound played when an item is enchanted.
  • On Disenchanted Sound: the sound played when an item is disenchanted.
  • Available Recipes: the list of the Enchanting Recipes this station offers.

Enchanting and Disenchanting In Game

The enchanting panel has two tabs.

Craft 4.png


In the Enchant tab the left list shows all the weapons and armors of the Player that can be enchanted, the right list shows the recipes of the station that are compatible with the selected item. For each ingredient you will see how many you have and how many you need, and the recipes you can afford are shown first.

In the Disenchant tab you can select an enchanted item and destroy it to get back some of the materials, based on the "Items Granted On Disenchant" of its recipe. Equipped items are not shown in this list, you have to unequip them first. Disenchanting destroys the item.

If you want to prevent a specific item from being enchanted (such as a quest item or the torch), just disable the Is Enchantable checkbox on the item asset.