By the end of Lesson 5, your UEFN map can run complete matches with spawns and objectives using mostly devices. Now it’s time to introduce Verse so your game can respond to events in smarter, more flexible ways.

In this lesson you’ll:

  • Learn the Verse mental model inside UEFN.
  • Wire up a small event-driven script that reacts to game state.
  • Safely connect Verse to devices you already placed in your map.

The goal is not to become a Verse wizard overnight—it’s to feel comfortable writing and editing small, focused scripts that actually ship.


1. What Verse Is (and Is Not) in UEFN

Verse is:

  • A scripting language that runs server-authoritative logic in Fortnite.
  • How you:
    • Listen to events (players spawning, entering zones, completing objectives).
    • Manipulate devices and game state in response.

Verse is not:

  • A full replacement for all devices.
  • Something you must use for every interaction.

The most productive pattern for this course:

  • Use devices for standard behaviors (spawns, timers, score).
  • Use Verse for glue and special rules:
    • Custom win logic.
    • “If X happens three times, do Y.”
    • Simple progression systems across rounds.

2. Creating Your First Verse File in UEFN

With your UEFN project open:

  1. In the Content Browser, create a new folder (if needed) called Verse.
  2. Right-click inside it and choose Add → Verse File (or the equivalent option in your version).
  3. Name it something descriptive, such as:
    • GameLogic.verse
    • MatchEvents.verse

Open the file; UEFN will show a Verse editor with a basic template.

You’ll usually see:

  • A using section for Fortnite and device APIs.
  • One or more class definitions that act as your script entry points.

You’ll edit this template rather than starting from a blank file every time.


3. The Core Verse Pattern You’ll Use a Lot

Most practical Verse scripts in this course follow a pattern:

  1. Declare a class as your script object.
  2. Expose device references as editable properties.
  3. Hook into lifecycle events (like OnBegin).
  4. Bind to device events and respond in functions.

Conceptual skeleton:

using { /Fortnite.com/Game, /Fortnite.com/Devices }

game_logic := class():
    @editable ScoreDevice: score_manager_device = score_manager_device{}

    OnBegin():void =
        # Runs when the script is ready
        Initialize()

    Initialize():void =
        # Subscribe to events, set up state
        # e.g. ScoreDevice.SomeEvent.Subscribe(handler)
        ()

Key ideas:

  • @editable lets you hook UEFN devices into this script from the Details panel.
  • OnBegin runs once when the script is loaded and ready.
  • You can define your own helper functions to keep logic tidy.

4. Exposing Devices to Verse With @editable

To let Verse talk to devices already in your level:

  1. In your Verse class, add fields with @editable:
using { /Fortnite.com/Devices }

game_logic := class():
    @editable RoundDevice: game_state_device = game_state_device{}
    @editable ScoreDevice: score_manager_device = score_manager_device{}
  1. Compile your Verse file so UEFN knows about these fields.
  2. In your level:
    • Select the Verse script component (or the actor that holds it).
    • In the Details panel, you’ll see RoundDevice and ScoreDevice slots.
    • Assign the corresponding devices from your map.

This pattern keeps your script reusable:

  • You can point it at different devices without rewriting code.

5. Writing a Simple Event-Driven Rule

Let’s implement a tiny rule:

“When the match starts, announce a clear objective to all players.
When a team reaches the target score, end the round.”

Assuming you have:

  • A round/game state device controlling rounds.
  • A score device tracking eliminations or control points.
  • Optionally an announcement/message device.

Your Verse could look like:

using { /Fortnite.com/Game, /Fortnite.com/Devices }

game_logic := class():
    @editable RoundDevice: game_state_device = game_state_device{}
    @editable ScoreDevice: score_manager_device = score_manager_device{}

    TargetScore : int = 20

    OnBegin():void =
        # Runs when the script is ready
        RoundDevice.OnRoundStart.Subscribe(HandleRoundStart)
        # Poll score in the background
        MonitorScore()

    HandleRoundStart(Event:game_state_round_start_event):void =
        # This could trigger a device-based announcement
        Print("Round started - First to {TargetScore} points wins!")

    MonitorScore():void =
        loop:
            Sleep(1.0)
            score := ScoreDevice.GetScoreForTeam(TeamIndex:=1)
            if (score >= TargetScore):
                Print("Target score reached, ending round.")
                RoundDevice.EndRound()
                break

Notes:

  • Subscribe hooks your function into a device event.
  • loop with Sleep is a simple way to poll state without blocking everything.
  • Print writes to the Verse log; you’ll replace it with real HUD/announcement behavior later.

6. Compiling and Testing Verse in UEFN

After writing or editing Verse:

  1. Click Compile in the Verse editor (or the global script compile button).
  2. Fix any errors shown in:
    • The Verse panel.
    • The Output/Log window.
  3. Once compilation is clean:
    • Start a playtest session.
    • Watch for Print output or visible effects (round ending early, etc.).

If nothing seems to happen:

  • Confirm your script class is actually instantiated (often via a Verse device or script component placed in the level).
  • Make sure @editable fields are set:
    • RoundDevice pointing to the right round manager.
    • ScoreDevice pointing to the scoring device you configured in Lesson 5.

7. Keeping Verse Scripts Small and Focused

It’s tempting to put all logic into one giant game_logic script. Resist that.

Instead, aim for:

  • One Verse file or class per responsibility:
    • GameModeLogic.verse – round start/end, win conditions.
    • RewardLogic.verse – XP or cosmetic rewards.
    • DebugTools.verse – simple commands for testing.

Benefits:

  • Easier to debug.
  • Safer to change one system without breaking others.
  • More reusable across maps.

If a function starts getting long or hard to follow, split it:

  • SetupEvents()
  • HandleRoundStart()
  • CheckWinCondition()

8. Mini Challenge – One Custom Rule for Your Map

In your current UEFN project, use Verse to add one small custom rule that devices alone don’t cover nicely, such as:

  1. Comeback warning
    • When a trailing team gets within 5 points of the leader, print or announce a “comeback” message.
  2. Sudden death
    • If the round timer ends with a tie, extend the round until the next elimination.
  3. First blood
    • Announce the first elimination of the match with a custom effect or message.

Checklist:

  • [ ] Verse file compiles with no errors.
  • [ ] @editable fields are wired to the correct devices.
  • [ ] Your rule clearly fires during a real playtest round.
  • [ ] The game still works if your Verse script is disabled (devices handle the basics).

Once you can add and test one rule, you’re ready for more ambitious systems in later lessons.


What’s Next – Progression and Rewards With Verse

You now:

  • Understand the Verse mental model inside UEFN.
  • Know how to reference devices with @editable.
  • Have shipped at least one event-driven rule in your own project.

In the next lesson, you’ll build on this by:

  • Tracking basic player stats across a match.
  • Using Verse to power persistent progression hooks inside your UEFN experience.
  • Laying the groundwork for cosmetics, XP, or unlocks that make players want to come back.

Keep your Verse scripts checked into version control—you’ll evolve them across the rest of the course.