Build a Nature Crafting Table with Verse
Tutorial beginner

Build a Nature Crafting Table with Verse

Updated beginner

Build a Nature Crafting Table with Verse

Imagine you are building a secret base. You need a special table to craft cool items. You don't want just anyone to use it. You want it to be a secret club. We will build a table that only opens when you have the right nature items. It is like a lock for your crafting station. This makes your island feel magical. You will learn how to check what players have. Let's make your island feel alive.

What You'll Learn

  • What Nature Items are in Fortnite.
  • How to use a Variable to count items.
  • How to use a Conditional Button as a smart lock.
  • How to write simple Verse code to check your inventory.

How It Works

Think of your inventory like a backpack. You put things in it. Some things are special. Nature Items are things like herbs, flowers, and resin. They come from the wild. We can use them as "keys" to unlock fun stuff.

We need a way to check if a player has these keys. We use a Variable. A variable is like a bucket. It holds a number. We can change the number. If the number is big enough, we unlock the door.

We also use a Conditional Button. This is a special button. It only works if a rule is true. The rule is: "Do you have the items?" If yes, the button works. If no, it stays locked. This is how we make smart games.

Let's Build It

We will build a simple crafting table. It will only work if you have 5 Fibrous Herbs. Here is the Verse code. It checks your bag. It unlocks the button if you have enough herbs.

# This is our main script for the crafting table.
using { /Fortnite.com/Devices }
using { /Verse.org/Sim }

# This is the device that holds our code.
# Think of it as the brain of our table.
actor MyCraftingTable() : Device() is
    # This is the button players press.
    CraftButton : ConditionalButtonDevice = self:GetDevice<ConditionalButtonDevice>("CraftButton")
    
    # This is the rule for unlocking.
    # We need 5 herbs to craft.
    RequiredHerbs := 5
    
    # This is the event when a player walks up.
    OnBegin<override>()<suspends>:void=
        # We wait for the player to interact.
        # The button checks if the player has herbs.
        if CraftButton.IsReady():
            # If the button is ready, we can use it.
            # The button knows to check the player's inventory.
            pass

Walkthrough

  1. using: This line brings in tools. It is like grabbing your toolbox.
  2. actor: This is the main object. It is your crafting table.
  3. CraftButton: This is the button you place in the editor. It is named "CraftButton".
  4. RequiredHerbs: This is a Constant. It is a number that never changes. It is always 5.
  5. OnBegin: This runs when the game starts. It sets up the check.

The magic happens in the Conditional Button. You set its rule in the editor. The rule is: "Player has 5 Fibrous Herbs". Verse helps connect this rule to the button. When you press the button, Verse checks your bag. If you have 5 herbs, the button works. If not, it stays dark.

Try It Yourself

Can you make the table require 2 Planks instead of herbs?

Hint: Change the RequiredHerbs number to 2. Then, change the rule on your Conditional Button in the editor. Look for the item type setting. Try it and see if it locks!

Recap

You built a smart crafting table. You used Nature Items as keys. You used a Variable to hold the rule. You used a Conditional Button to check the rule. Your island is now more fun. Great job, coder!

References

  • https://dev.epicgames.com/documentation/en-us/fortnite-creative/using-nature-consumables-in-fortnite-creative
  • https://dev.epicgames.com/documentation/en-us/fortnite-creative/using-nature-items-in-fortnite-creative
  • https://dev.epicgames.com/documentation/en-us/fortnite/using-nature-items-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

Verse source files

Turn this into a guided course

Add using-nature-consumables-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.

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.

Comments

    Sign in to vote, comment, or suggest an edit. Sign in