# Help with a very basic crafting system

**URL:** <https://forums.unrealengine.com/t/help-with-a-very-basic-crafting-system/289533>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [July 28, 2014, 10:34pm UTC](https://forums.unrealengine.com/t/help-with-a-very-basic-crafting-system/289533 "2014-07-28T22:34:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![BioTech\_Games\_Inc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BioTech\_Games\_Inc](https://forums.unrealengine.com/u/BioTech_Games_Inc)\
**Post date:** [July 28, 2014, 10:34pm UTC](https://forums.unrealengine.com/t/help-with-a-very-basic-crafting-system/289533/1 "2014-07-28T22:34:47Z")

</div>

I need help on a starting point to make a crafting system using blueprint or C++. I have an inventory system made already with blueprint, with a rock and a log as 2 of my objects right now. Can someone please point me in the right direction on how to make it to where I can add those 2 together to make a simple hatchet. I have the hatchet as an item but its not coded yet for my inventory…  
Thanks,  
Charles

---

<div class="post-metadata">

**Author:** ![iniside](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/iniside/32/866315_2.png) [@iniside](https://forums.unrealengine.com/u/iniside)\
**Post date:** [July 28, 2014, 10:46pm UTC](https://forums.unrealengine.com/t/help-with-a-very-basic-crafting-system/289533/2 "2014-07-28T22:46:33Z")

</div>

What are you asking fir is actually pretty simple and there no magic involved!

First you must decide how you will store information about your crafting componenets. Objects, Actors, structs ?

Then, you must find a way to identify types of components, to make right interaction between them. There are essentialy two way I can think:

1. Create separate subclass for each type of component. I don’t recommend this approach.

2. Use GameplayTags module.

Assuming you pick up option three, you will need to create your basic UCraftingComponenet class, or something like that. In that class add

```
FGameplayTagContainer OwnedTags;
FGameplayTagContainer RequiredTags;

```

Owned tags are tags, that this crafting component owns. Required tags, are tags that other crafting componenet must have to interact with this component.

Then you will need to add some delegate events, which will send around Tags, when componenets are added togather.

You might also want to create something like Master crafting class, which will handle all interaction between componenets. Like adding them to array by player, and then checking and comparing tags to see if there is any possible outcome.

You will probably need to iterate a bit and check things out, as I have never done crafting system, though I have similar system for creating spells, feats, skills, weapons etc.Albeit I haven’t exposed it players only to blueprints.

In anycase to general rule is to:

1. Identify types of object.

2, Compare objects with each other to check if they meet their requirements.

1. If the objects meet recipe (container of required tags in final item), that item can be created.

---

<div class="post-metadata">

**Author:** ![BioTech\_Games\_Inc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BioTech\_Games\_Inc](https://forums.unrealengine.com/u/BioTech_Games_Inc)\
**Post date:** [July 29, 2014, 1:18am UTC](https://forums.unrealengine.com/t/help-with-a-very-basic-crafting-system/289533/3 "2014-07-29T01:18:18Z")

</div>

Do you have an example pic? I really need a point in the direction on the components.

---

<div class="post-metadata">

**Author:** ![iniside](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/iniside/32/866315_2.png) [@iniside](https://forums.unrealengine.com/u/iniside)\
**Post date:** [July 29, 2014, 6:15am UTC](https://forums.unrealengine.com/t/help-with-a-very-basic-crafting-system/289533/4 "2014-07-29T06:15:31Z")

</div>

This will only work for C++. To use GameplayTags you will need to load them at editor start, and to do that, you will need custom Engine/EditorEngine classes.

Coding them is fairly easy:

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

As for componenets. I don’t mean an componenet added in componenets panel ;). I mean just very simple class which contain data, about what it is, and with what it can interact.

The general idea, is that you add crafting objects into single array, and then check if they match required composition to actually craft (spawn) another object.
