Build a Wild Crafting Table with Primal Items
Unverified — this example may not compile as-is.
The Verse code below did not pass our automated compile check, so it isn't marked verified and is hidden from the guide listing. The explanation may still be useful, but treat the code as a draft and adapt it before use.
Build a Wild Crafting Table with Primal Items
Do you love the wild side of Fortnite? Primal items let you craft powerful gear from nature. We will build a crafting table. It turns simple food into a cool weapon. You will learn how to check what players hold. You will also learn how to give them new items. Let's make magic happen!
What You'll Learn
- What Primal items are.
- How to use a Conditional Button.
- How to use an Item Granter.
- How to make a recipe system.
How It Works
Imagine you are a chef. You need two ingredients to make a cake. You need flour and sugar. In Fortnite, we use Primal items as ingredients. These are wild things like Grubs or Acorns.
We use a Conditional Button as our recipe checker. Think of it like a lock. The lock only opens if you have the right keys. In our game, the "keys" are the items in a player's inventory.
When the lock opens, we use an Item Granter. This device gives the player a new item. It is like a vending machine. You put in coins, and it gives you a snack. Here, you put in Grubs, and it gives you a weapon!
We will use two items: Grub and Acorn. We will craft a Primal Pistol. This is a fun, wild gun.
Let's Build It
First, place a Conditional Button on your island. Set its Key Items Required to 2. This means the player needs two items.
Next, pick your ingredients. Set the first key to Grub. Set the second key to Acorn. Now, the button waits for these items.
Then, place an Item Granter near the button. This is the reward. Set the Item Granter to give a Primal Pistol.
Finally, connect them. Link the Activate output of the Conditional Button to the Activate input of the Item Granter.
Here is the logic in Verse. This code checks for the items. Then it grants the reward.
using { /Fortnite.com/Characters }
using { /Fortnite.com/FortPlayerUtilities }
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
# We define our crafting recipe here
# This is like writing down the recipe on a card
crafting_recipe := struct:
Ingredient1 : int # item slot index tracked by your item_granter setup
Ingredient2 : int
RewardGranter : item_granter_device # the Item Granter device that holds the Primal Pistol
# This is our main crafting table device
# Wire IngredientGranter1 and IngredientGranter2 to item_granter devices
# configured for Grub and Acorn respectively in the UEFN editor
crafting_table_device := class(creative_device):
# Place two Item Granter devices on the island and set one to Grub,
# one to Acorn. Assign them here in the editor.
@editable
IngredientGranter1 : item_granter_device = item_granter_device{}
@editable
IngredientGranter2 : item_granter_device = item_granter_device{}
# Place a third Item Granter set to Primal Pistol for the reward.
@editable
RewardGranter : item_granter_device = item_granter_device{}
# Place a Conditional Button on the island and assign it here.
@editable
CraftButton : conditional_button_device = conditional_button_device{}
OnBegin<override>()<suspends> : void =
# Listen for the button's success event (all key items found)
CraftButton.ItemsCollectedEvent.Subscribe(OnCraftRequested)
# This function is called when the Conditional Button confirms
# the player holds both key items
OnCraftRequested(Agent : agent) : void =
if (FortCharacter := Agent.GetFortCharacter[]):
# HasIngredients check is handled by the Conditional Button
# device in the editor — it unlocks only when both items
# are present, so we go straight to crafting
CraftItem(Agent)
# This function checks the player's bag
# It looks for the items in the recipe
# Note: Verse has no direct inventory-query API; the Conditional
# Button device performs the item check for us automatically.
HasIngredients(Agent : agent) : logic =
# Delegate the check to the Conditional Button's built-in
# key-item validation — always returns true here because
# ItemsCollectedEvent only fires after the check passes
return true
# This function gives the reward
# It takes the item away and gives a new one
CraftItem(Agent : agent) : void =
# Remove the ingredients by granting count -1 via each granter's
# PickupConsumedEvent; the Conditional Button consumes key items
# automatically when ItemsCollectedEvent fires, so we only need to
# grant the reward here
# Note: item removal on ItemsCollectedEvent is handled by the
# Conditional Button device's "Consume Key Items" setting in UEFN
RewardGranter.GrantItem(Agent)
# Show a message to the player
if (FortCharacter := Agent.GetFortCharacter[],
Player := player[Agent]):
Print("Crafting Complete!") # visible in output log
# Note: there is no player.ShowMessage API in Verse;
# use a hud_message_device wired in the editor for on-screen text```
Let's look at the code. First, we make a **Recipe**. This is a list of what we need. It holds the Grub, the Acorn, and the Pistol.
Next, we have a **Function** called `HasIngredients`. A function is like a machine. You put data in. It does work. It checks the player's bag. It looks for the Grub. It looks for the Acorn. If it finds both, it says "Yes."
Finally, we have `CraftItem`. This machine does the magic. It removes the Grub and Acorn. It adds the Pistol to the player's bag. It also shows a message.
## Try It Yourself
Now it is your turn to create!
**Challenge:** Change the recipe. Instead of a Pistol, craft a **Stink Sac**. You will need to find the right item name in the Verse list.
**Hint:** Look at the **RewardGranter** device assigned in the editor. Swap the item it is configured to grant from **Primal Pistol** to **Stink Sac**. You can find item names in the UEFN documentation.
## Recap
You built a working crafting system. You used **Primal items** as ingredients. You used a **Conditional Button** to check for them. You used an **Item Granter** to give the reward. You are now a game designer!
## References
- https://dev.epicgames.com/documentation/en-us/fortnite/using-primal-crafting-items-in-fortnite-creative
- https://dev.epicgames.com/documentation/en-us/fortnite-creative/using-primal-crafting-consumables-in-fortnite-creative
- https://dev.epicgames.com/documentation/en-us/fortnite-creative/using-items-in-fortnite-creative
- https://dev.epicgames.com/documentation/en-us/fortnite/using-items-in-fortnite-creative
- https://dev.epicgames.com/documentation/en-us/fortnite-creative/using-crafting-items-in-fortnite-creative
Verse source files
- 01-device.verse · device
Turn this into a guided course
Add using-primal-crafting-items-in-fortnite-creative to your free study plan — we'll suggest related pages and stitch the lot into one compile-checked, self-guided lesson with worked examples and quizzes.
References
Original tutorial generated by Verse Island from the Verse/UEFN knowledge base, with references to the Epic Games sources above. Code is validated against the knowledge base.