Summon Your First Monster Squad with Verse
Summon Your First Monster Squad with Verse
Imagine you are building a haunted house. It is quiet at first. Then, suddenly, ghosts pop out of the walls! We will use Verse to make that happen. You will create a device that spawns monsters automatically. This makes your island feel alive and scary. It is like magic, but it is actually code. Let's start summoning!
What You'll Learn
- How to use a Creature Spawner device.
- What a variable is (a changing value).
- How to write a simple function (a set of instructions).
- How to connect devices using events.
How It Works
Think of a Creature Spawner like a popcorn machine. You put in the kernels. You turn it on. Popcorn comes out! In Fortnite Creative, the "popcorn" is monsters. The "machine" is the Creature Spawner device.
We need to tell the machine two things. First, what kind of monsters to make. Second, when to make them. We use Verse to control this.
A variable is like a labeled box. You put a number inside. The number can change. For example, you might have a box labeled "Monster Count." When a monster appears, you add one to that box.
A function is like a recipe. It is a list of steps. When you call the function, the game follows the steps. We will write a recipe to start the spawner.
We also use events. An event is a trigger. It is like a doorbell. When someone rings the bell, something happens. We will set up an event so the monsters start when a player steps on a button.
Let's Build It
First, place your devices in the Creative Universe.
- Place a Creature Spawner.
- Place a Button.
- Place a Creature Manager (this helps manage the monsters).
Now, let's write the Verse code. This code tells the spawner what to do.
# This is our main script file.
# It connects the button to the spawner.
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
# We declare our device class, which holds references
# to the devices we placed in the editor.
monster_squad_device := class(creative_device):
# These @editable fields let us drag our placed
# devices into the script from the UEFN Details panel.
@editable
CreatureSpawner : creature_spawner_device = creature_spawner_device{}
@editable
Button : button_device = button_device{}
# OnBegin runs automatically when the game starts.
# We use it to connect the Button to our function.
OnBegin<override>()<suspends> : void =
# Now we connect the Button to the function.
# When the button is pressed, we run StartSpawning.
Button.InteractedWithEvent.Subscribe(StartSpawning)
# We define a function called StartSpawning.
# A function is a reusable block of code.
# It receives the agent (player) who pressed the button.
StartSpawning(Agent : agent) : void =
# This line tells the spawner to begin.
# We use the spawner's Enable method to start it.
CreatureSpawner.Enable()
# We also print a message to the console.
# This helps us know it worked.
Print("Monsters are coming!")
Walkthrough
Let's look at the code line by line.
The first line is a comment. Comments start with #. The game ignores them. They are just notes for you.
Next, we define StartSpawning. This is our function. It is like a name for our recipe. When we call StartSpawning, the game runs the code inside.
Inside the function, we see CreatureSpawner.Enable(). This is the magic line. It tells the Creature Spawner device to start spawning. It activates the spawner.
The Print line is optional. It helps you debug. It shows text in the output log.
Finally, we connect the Button. Button.InteractedWithEvent.Subscribe(StartSpawning) means: "When the button is pressed, run the StartSpawning function." This links your input to the output.
Try It Yourself
You have the basics! Now, let's add a twist.
Challenge: Make the monsters stop spawning after 10 seconds.
Hint: You will need a timer. Look for a Timer device in the Creative inventory. You can connect the Timer's "Finished" event to a "Stop" event on the Creature Spawner. Try to add a second function called StopSpawning that calls the spawner's stop method.
Recap
You learned how to use Verse to control a Creature Spawner. You used a function to start the spawning. You connected a button to trigger the function. This makes your island interactive. You are now a monster summoner!
References
- https://dev.epicgames.com/documentation/en-us/fortnite/using-creature-spawner-devices-in-fortnite-creative
- https://dev.epicgames.com/documentation/en-us/fortnite-creative/using-creature-spawner-devices-in-fortnite-creative
- https://dev.epicgames.com/documentation/en-us/fortnite-creative/spawner-123-in-fortnite-creative
- https://dev.epicgames.com/documentation/en-us/fortnite/creature-manager-device-design-examples-in-fortnite-creative
- https://dev.epicgames.com/documentation/en-us/fortnite/spawner-123-in-fortnite-creative
Verse source files
- 01-device.verse · device
Turn this into a guided course
Add using-creature-spawner-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.