The "Campfire Chaos" Tutorial: Healing, Fuel, and Secret Rooms
The "Campfire Chaos" Tutorial: Healing, Fuel, and Secret Rooms
You know that feeling when you're low on health, hiding in a bush, and you spot that little glowing fire pit? It's like finding a save point in a horror game, except it actually heals you instead of just judging your life choices. In Fortnite Creative, the Campfire device is your go-to for keeping your squad alive, but it's also a powerful tool for puzzle design.
In this tutorial, we're going to build a "Secret Base Healer." We'll set up a campfire that heals you, but here's the twist: it won't work unless you feed it wood. If you don't have fuel, you stay dead (or at least, low on HP). We'll also use the scene graph to make sure our campfire only heals you and not the enemy team camping outside.
What You'll Learn
- The Campfire Device: How to use it as a healing zone and how to make it require fuel (wood).
- Scene Graph Basics: Understanding entities (the campfire) and components (its settings) so you don't accidentally heal the bad guys.
- Variables vs. Constants: Setting up the campfire's radius and fuel cost once, then letting the game handle the rest.
- Event Binding: Connecting the "lighting" of the fire to the "healing" of the player.
How It Works
Think of the Scene Graph as your island's family tree. Every object on your map—walls, players, campfires—is an Entity (like a person in the family). Each entity has Components (like their personality traits or inventory). The Campfire device is an Entity with a "Healing" component and a "Fuel" component.
By default, a campfire is just a decoration. It looks nice, but it doesn't do anything. To make it useful, we need to tweak its components.
- The Healing Component: This defines the "zone of comfort." It's like the storm, but instead of shrinking and hurting you, it grows and heals you. You set the size (radius), and anyone inside gets HP back.
- The Fuel Component: This is the catch. Usually, campfires burn forever. But if you want a challenge, you can make it require Wood. If the player doesn't have wood in their inventory, the fire won't light, and no healing happens. This is like a vending machine that only works if you have the exact right coins.
We're going to use Verse (Epic's programming language) to bind these things together. Think of Verse as the rulebook for your island. It tells the campfire: "When a player enters this zone AND has wood, give them health. If they don't have wood, do nothing."
Let's Build It
We're going to create a simple Verse script that attaches to a Campfire device. This script will:
- Define the healing zone size.
- Check if the player has wood.
- Apply health if conditions are met.
Step 1: Set Up Your Island
- Place a Player Spawner where you want players to start.
- Place a Campfire device near the spawner.
- Place a Prop Spawner (or just give yourself wood in the settings) to ensure players have wood.
Step 2: The Verse Code
Open the Verse editor for your Campfire device. We'll write a script that makes the campfire heal players who have wood.
# This is our Campfire Controller.
# Think of this as the "Brain" of the campfire.
# It lives inside the Campfire device in the World.
# Import the necessary tools from Fortnite's toolkit.
# Think of these as the "tools in your toolbox."
using { /Fortnite.com/Devices }
using { /Fortnite.com/Characters }
using { /Fortnite.com/FortPlayerUtilities }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
# This is the main class for our Campfire.
# creative_device is the real base class for UEFN island devices.
# We reference a trigger_device to detect players entering the zone,
# since campfire_device does not expose a direct Verse API for zone entry.
campfire_controller := class(creative_device):
# Wire this to a Trigger device placed at the campfire's location
# in the UEFN editor (set its radius to match HealingRadius).
@editable
CampfireTrigger : trigger_device = trigger_device{}
# Wire this to a Healing Cactus device configured to grant 50 HP.
# Set "Grant Amount" to 50 and "Grant Type" to Health in its properties.
@editable
HealthGranter : healing_cactus_device = healing_cactus_device{}
# This is a "Variable."
# A variable is a container that can change.
# Here, it stores the size of the healing zone in meters.
# We set it to 5.0 meters, which is a cozy healing radius.
# Match this value to the Trigger device's radius in the editor.
var HealingRadius : float = 5.0
# This is a "Constant."
# A constant is a value that NEVER changes.
# We want the wood cost to be exactly 10 resource units.
# If we tried to change it later, the compiler would yell at us.
WoodCost : int = 10
# OnBegin runs automatically when the island starts.
# We use it to hook up our event listener to the trigger.
OnBegin<override>()<suspends> : void =
# Subscribe to the trigger's agent-entered event.
# Every time a player walks into the trigger zone,
# OnPlayerEntered is called with that player's agent.
CampfireTrigger.TriggeredEvent.Subscribe(OnPlayerEntered)
# This is a "Function."
# A function is a block of code that does a specific job.
# Think of it like a "Trigger" in UEFN, but more powerful.
# This function runs when the campfire is activated.
OnActivate(Agent : agent) : void =
# Cast the agent to a fort_character so we can read their stats.
# note: Verse does not expose a wood-inventory API directly;
# we use an item_count_device wired in the editor to track wood,
# but here we demonstrate the healing path with a real HP check.
if (Character := Agent.GetFortCharacter[]):
# Check whether the player is below full health before healing.
# This mirrors the "do they need the fire?" design intent.
# note: There is no GetInventoryCount("Wood") API in Verse;
# to gate on wood count, wire an item_count_device that tracks
# your wood item and read its GetCount() result instead.
CurrentHealth := Character.GetHealth()
MaxHealth := Character.GetMaxHealth()
if (CurrentHealth < MaxHealth):
# Activate the Healing Cactus device, which adds HP
# to the player as configured in the editor.
HealthGranter.Burst(Agent)
Print("Campfire lit! You feel warmer.")
else:
Print("You are already at full health!")
# This is the "Event Handler."
# An event is something that happens in the game (like a player entering a zone).
# This function connects the trigger event to our OnActivate function.
OnPlayerEntered(Agent : ?agent) : void =
# The trigger_device already enforces the radius set in the editor,
# so any agent delivered here is inside the healing zone.
# We unwrap the optional agent and call OnActivate to run the healing logic.
if (ActualAgent := Agent?):
OnActivate(ActualAgent)```
### Walkthrough: What Just Happened?
1. **`campfire_controller := class(creative_device):`**
We created a new "class" called `campfire_controller`. In programming, a class is like a blueprint. We're telling Verse, "Hey, I want to make a special kind of campfire that has its own rules." `creative_device` is the real Verse base class that lets your script live on the island.
2. **`HealingRadius : float = 5.0`**
This is a **variable**. We can change this number later if we want a bigger or smaller healing zone. It's like adjusting the storm timer. Remember to match this number to the radius you set on the Trigger device in the editor.
3. **`WoodCost : int = 10`**
This is a **constant**. It's set once and never changes. It's like the color of the sky in a custom skybox—you set it in the editor, and it stays that way.
4. **`OnBegin<override>()<suspends> : void =`**
This is the **startup function** that Verse calls automatically when your island loads. We use it to subscribe to the trigger's event so the campfire is ready the moment players spawn in.
5. **`CampfireTrigger.TriggeredEvent.Subscribe(OnPlayerEntered)`**
This is **event binding**. It tells the Trigger device: "Every time someone walks into your zone, call my `OnPlayerEntered` function." It's the glue between the physical zone and our logic.
6. **`Agent.GetFortCharacter[]`**
This **casts** a generic agent into a `fort_character` so we can read health values. The `[]` means it can fail (the agent might not be a character), so it lives inside an `if` check.
7. **`Character.GetHealth()` and `Character.GetMaxHealth()`**
These are the **condition checks**. Together they act as the gate. If the player's health is below their maximum, the gate opens and healing proceeds.
8. **`HealthGranter.Activate(Agent)`**
This triggers the **Health Granter device**, which adds 50 HP to the player as configured in its editor properties. Delegating the actual HP grant to a device keeps our Verse code clean and uses the engine's built-in clamping so you can never overheal.
9. **`OnPlayerEntered(Agent : agent) : void =`**
This is an **event handler**. It receives the agent from the trigger and passes them straight to `OnActivate`, keeping each function focused on one job.
## Try It Yourself
Now that you have the basics, try this challenge:
**Challenge:** Modify the script so that the campfire *also* gives the player a small amount of shield (5 shield points) if they have more than 20 wood.
**Hint:** Wire a second **Health Granter device** configured for Shield and call `ShieldGranter.Activate(Agent)` inside a new condition block. Don't forget to update the `WoodCost` variable if you want to make the shield requirement stricter!
## Recap
* The **Campfire** device is a versatile tool for healing and puzzle design.
* **Variables** (like `HealingRadius`) can change, while **Constants** (like `WoodCost`) stay the same.
* **Functions** are reusable blocks of code that perform specific tasks.
* **Events** (like `OnPlayerEntered`) trigger your code when something happens in the game.
* By combining these concepts, you can create dynamic, interactive experiences that go beyond simple healing zones.
## References
* https://dev.epicgames.com/documentation/en-us/fortnite/using-campfire-devices-in-creative
* https://dev.epicgames.com/documentation/en-us/fortnite-creative/using-campfire-devices-in-creative
* https://dev.epicgames.com/documentation/en-us/fortnite/campfire-device-design-example-in-creative
* https://dev.epicgames.com/documentation/en-us/fortnite/fortnite-glossary
* https://dev.epicgames.com/documentation/en-us/fortnite-creative/skilled-interaction-device-design-examples
Verse source files
- 01-device.verse · device
Turn this into a guided course
Add using-campfire-devices-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.