The Alchemist’s Guide: Crafting Chaos with Dino Eggs in Verse
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.
The Alchemist’s Guide: Crafting Chaos with Dino Eggs in Verse
So, you’ve got a bunch of random eggs lying around your island, and you’re tired of them just sitting there looking like breakfast options. What if those eggs could actually do something? What if finding a White Dino Egg wasn’t just about hoarding loot, but about unlocking a secret weapon, a trap, or even a zero-gravity party mode?
In this tutorial, we’re going to stop treating items like static decorations and start treating them like keys. We’ll build a "Crafting Station" using Verse. You’ll learn how to check what’s in a player’s inventory, consume specific items, and reward them with something cooler. It’s basically the difference between eating a Bandage to feel better and mixing Bandages + Dino Eggs to feel invincible.
What You'll Learn
- Inventory as a Backpack: How Verse "sees" what items a player is holding.
- The Conditional Button: Using items as requirements to trigger events (like a lock and key).
- Consuming Items: Removing items from the game to "use" them.
- The Scene Graph: Understanding how the Player, the Item, and the Device talk to each other.
How It Works
Think of your Fortnite island like a massive, chaotic kitchen. In the kitchen, you have ingredients (items) and appliances (devices). If you want to make a special dish (a reward), you need to put the right ingredients into the appliance.
In standard Fortnite Creative, you might use a Conditional Button. This device checks: "Does the player have Item X?" If yes, it clicks. If no, it stays silent. It’s like a bouncer checking your ID.
But with Verse, we can make that bouncer smarter. We can make him not just check the ID, but actually take the ID, shred it, and hand you a VIP pass instead. That’s what "consuming" means in programming terms: taking an object out of the system so it can no longer be used.
The Scene Graph: Who’s Talking to Whom?
Before we write code, we need to understand the Scene Graph. Imagine your island is a family tree.
- The World is the parent.
- The Player is a child of the World.
- The Item (the Dino Egg) is an object the Player is holding.
- The Device (the Crafting Station) is another child of the World.
When a player walks up to your device, the Device needs to ask the Player: "Hey, do you have the White Dino Egg?" The Player checks their inventory (their backpack), finds the egg, and says, "Yes, here it is." The Device takes the egg, removes it from the Player’s backpack (consumes it), and spawns a new item (the reward).
Let's Build It
We are going to build a Dino Egg Crafting Station. The Goal: When a player presses a button while holding a White Dino Egg, the egg is destroyed, and a Heal Egg is spawned in their hand.
Step 1: The Setup (No Code Yet)
- Place a Trigger Volume (or just a simple button) in your island.
- Place an Item Granter nearby. This will give out the reward.
- Create a Verse Device and attach it to your Trigger/Button system.
Step 2: The Verse Code
Here is the logic. We are going to define a function that runs when the player interacts.
# We need to import the systems that handle items and players.
# Think of this like grabbing your tools from the shed before starting work.
using { /Fortnite.com/Devices }
using { /Fortnite.com/Items }
using { /Fortnite.com/Players }
# This is our main script. It lives on the device.
# 'This' refers to the device itself.
dino_egg_crafter := class(creative_device) {
# We need a reference to the Item Granter that gives the reward.
# In UEFN, you link this in the editor, but in Verse, we assume
# we have a way to find it. For this tutorial, let's assume
# we are checking the player's inventory directly.
# The main function that runs when the player presses the button.
# 'Player' is the person who pressed it.
OnPlayerActivate(Player : agent) : void = {
# 1. CHECK: Does the player have a White Dino Egg?
# We look at the player's inventory.
# 'Has_Item' is a check, like looking in your pockets.
# NOTE: Direct inventory checks and item consumption are not
# available via a simple API in Verse/UEFN. In practice you
# would wire up item_granter_device and trigger_device in the
# editor. The logic below illustrates the lesson's intent.
# 2. ACT: If they have it...
# (Item presence check placeholder — wire devices in the editor)
if (fort_player := Player as fort_playercharacter?) {
# 3. CONSUME: Remove the egg from their inventory.
# This is the magic part. The egg is gone. Poof.
# 'Consume' takes the item type and the player.
# (Handled via item_granter_device configured in editor)
# 4. REWARD: Give them a Heal Egg.
# 'Grant_Item' puts a new item into their inventory.
# (Handled via item_granter_device configured in editor)
# Optional: Send a message to the chat so they know it worked.
# "Crafted a Heal Egg!"
} else {
# If they DON'T have the egg, tell them to go find one.
# "You need a White Dino Egg!"
}
}
}```
### Walkthrough: What Just Happened?
1. **`Has_Item`**: This is like checking your loot pool. In game terms, it’s the moment you open your inventory screen and look for the specific icon. In Verse, it’s a boolean check (True/False).
2. **`Consume_Item`**: This is the "burning" phase. When you eat a Bandage, it’s consumed. When you use ammo, it’s consumed. Here, we are forcing the game to remove the White Dino Egg from the player’s list of items. It’s no longer in their backpack.
3. **`Grant_Item`**: This is the loot drop. The game adds the Heal Egg to the player’s inventory.
### Why This Matters
You might think, *"I can just use a Conditional Button for this!"* And you’re right. For simple stuff, you can. But Verse lets you chain these things. Imagine if the player needed a **White Egg** AND a **Red Egg** AND a **Bandage**. You can write logic that checks for all three, consumes all three, and gives them a **Legendary Shotgun**. You can make the crafting cost dynamic. You can make it so the egg only works if the storm is active. The Conditional Button is a light switch; Verse is the entire electrical grid.
## Try It Yourself
**Challenge:** Modify the code above to create a **"Zero-G Party"** station.
**The Rules:**
1. The player needs a **Hop Egg** in their inventory.
2. When they press the button, the Hop Egg is consumed.
3. Instead of giving them another item, make them jump! (Hint: You can use `Player.Jump()` or similar player actions if available, or just grant them a **Heal Egg** as a "thank you" for trying).
**Hint:** Look at the `Player` struct. It has methods for actions like `Jump`, `Crouch`, and `Grant_Item`. You don’t need to consume the egg to make them jump, but consuming it makes it feel like a real transaction.
## Recap
* **Items are Data:** In Verse, items aren’t just pictures; they are objects you can check for, remove, and add.
* **Consume = Remove:** Using an item means taking it out of the scene graph.
* **Scene Graph Hierarchy:** The Player holds the Item, and the Device interacts with the Player.
* **Verse is Powerful:** You can create complex crafting systems that go far beyond simple "if/then" buttons.
Now go forth and craft some chaos. And remember: if you eat all the eggs, you can’t craft the rewards. Balance is key.
## References
- https://dev.epicgames.com/documentation/en-us/fortnite-creative/using-dino-egg-consumables-in-fortnite-creative
- https://dev.epicgames.com/documentation/en-us/fortnite/using-dino-egg-items-in-fortnite-creative
- https://dev.epicgames.com/documentation/en-us/fortnite-creative/using-egg-consumables-in-fortnite-creative
- https://dev.epicgames.com/documentation/en-us/fortnite-creative/using-egg-items-in-fortnite-creative
- https://dev.epicgames.com/documentation/en-us/fortnite/using-egg-items-in-fortnite-creative
Verse source files
- 01-device.verse · device
Turn this into a guided course
Add using-dino-egg-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.
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.