Learn / Verse Basics Lesson 2 / 6

Run Your First Verse Program

In this lesson you'll learn to

  • Open UEFN, create a new project using the Verse Device template, and add a Verse device to your island.
  • Read and understand the basic parts of a Verse program (the device class and the OnBegin function).
  • Run your island and find your program's output in the Log.
  • Modify the Verse code to print your own custom message and see it appear in the Log.

🎮 Welcome to Your First Verse Program!

You are about to write real code — the same kind of code that powers Fortnite islands! The language is called Verse. It is Epic Games' programming language for UEFN (Unreal Editor for Fortnite).

Don't worry if you have never coded before. We will go step by step. You've got this! 🚀


🧰 What Is UEFN?

UEFN stands for Unreal Editor for Fortnite. Think of it like a giant toy factory. You use it to build your own Fortnite islands. Verse is the language you use to give your island a "brain" — to make things happen in your game.


📦 What Is a Verse Device?

A device is a special object you place on your island. Think of it like a LEGO brick with a tiny computer inside. When the game starts, the device's code runs automatically.

In this lesson, your device will print a message. Printing doesn't mean paper — it means showing text in a special log screen inside the game. It's how programmers check that their code is working.


🗂️ Setting Up Your Project

Here's how to get started in UEFN:

  1. Open UEFN. In the Project Browser, click Feature Examples.
  2. Find and click Verse Device template, then give your project the name MyVerseProject. Click Create.
  3. In the Menu Bar at the top, go to Verse > Verse Explorer. This panel shows all your Verse files — like a folder for your code.
  4. Right-click your project name in Verse Explorer. Choose Add new Verse file to project.
  5. In the window that pops up, click Verse Device, then click Create. This creates a starter code file called hello_world_device.verse. 🎉
  6. Go to Verse > Build Verse Code so UEFN notices your new file.
  7. Open the Content Browser (bottom of the screen). Find your hello_world_device and drag it into your level (the big 3D world in the middle of UEFN).

💡 Level means the map or island you are building. Dropping the device into it is like placing a LEGO brick on your baseplate.


🏃 Running Your Island

  1. Click Launch Session in the toolbar. A window may ask you to save — click Save Selected.
  2. When it loads, open the Main Menu and click Start Game.
  3. Once in the game, press Escape, click Island Settings, then click Log at the top.
  4. Look for the line that says "Hello, world!" followed by "2 + 2 = 4". Those came from your Verse code! Your program ran! 🥳

🔍 What Is the Log?

The Log is like a notebook the game keeps while it runs. Your code can write notes into it. This is super useful — it tells you "Hey, my code ran!" or "Here is what happened." Programmers call this logging or printing to the log.


✏️ Modifying Your Code

Now let's look at the code and change it!

  1. Go to Verse > Verse Explorer and double-click hello_world_device.verse. It opens in VS Code (Visual Studio Code) — a free program for writing code. Think of VS Code like a super-smart notepad.
  2. You will see the starter code. We will look at it together in the next section.
  3. You can add a new Print line to show your own message. After you edit and save the file, go back to UEFN, click Verse > Build Verse Code, and launch your session again to see your changes!

🔑 Key Words to Know

Word What It Means
Verse The coding language for Fortnite islands
Device A code-powered object you place on your island
Log A screen that shows messages from your code
Print Sending a text message to the Log
Build Verse Code Telling UEFN to read your latest code changes

Worked Example

📖 Let's Read the Starter Code

When you open hello_world_device.verse in VS Code, you see something like this:

# This is your first Verse device!
# Lines that start with # are called "comments."
# Comments are notes for humans — the computer ignores them.

using { /Fortnite.com/Devices }       # Lets us use UEFN devices
using { /Verse.org/Simulation }        # Lets us use game timing tools
using { /UnrealEngine.com/Temporary/Diagnostics }  # Lets us use Print

# A "class" is like a blueprint for your device.
# creative_device is the base type — all island devices inherit from it.
hello_world_device := class(creative_device):

    # OnBegin is a special function that runs automatically when the game starts.
    # Think of it like the "Start" signal on a race — when the game goes, this runs!
    OnBegin<override>()<suspends>:void=
        Print("Hello, world!")    # Shows "Hello, world!" in the Log
        Print("2 + 2 = {2 + 2}") # Shows "2 + 2 = 4" — Verse does the math!

🧩 Breaking It Down

  • using { ... } — These lines are like packing your backpack before school. They load tools you need, such as the ability to Print text.

  • hello_world_device := class(creative_device): — This creates a class. A class is a blueprint. Just like a blueprint for a house tells builders what to build, this blueprint tells UEFN what your device does. It inherits from creative_device, meaning it's built on top of an existing UEFN device type — like inheriting your parent's eye color, but for code!

  • OnBegin<override>()<suspends>:void= — This is a function. A function is a set of steps. OnBegin is special — UEFN calls it automatically the moment the game starts. It's like the "GO!" in a race.

  • Print("Hello, world!") — This is a function call. You are telling Verse: "Run the Print function and give it this message." The message appears in the Log.

  • Print("2 + 2 = {2 + 2}") — The curly braces { } inside a Print message let you put math or code right inside your text! Verse calculates 2 + 2 and writes 4 for you.


🎯 What You Should See in the Log

After you Launch Session and Start Game, open the Log and you'll find:

Hello, world!
2 + 2 = 4

That means YOUR code ran in a real Fortnite island. You are officially a Verse programmer! 🌟

Try It Yourself

🛠️ Your Turn — Make It Your Own!

You have seen how Print works. Now let's make the program say something new!

Your challenge:

  1. Open hello_world_device.verse in VS Code.
  2. Inside OnBegin, add two new Print lines below the existing ones.
    • One line should print your name (example: "My name is Alex!")
    • One line should print a math fact using { } (example: "5 + 3 = {5 + 3}")
  3. Save your file in VS Code (press Ctrl+S on Windows or Cmd+S on Mac).
  4. In UEFN, go to Verse > Build Verse Code.
  5. Click Launch Session, start the game, and check the Log for your new messages!

🤔 Hints:

  • Every Print line goes inside OnBegin, with the same indentation (spacing) as the other Print lines.
  • Make sure your message text is always inside "quotation marks".
  • If you want to show math, wrap it in { } inside the quotes — like "10 - 4 = {10 - 4}".
  • If the Log doesn't show your new line, double-check that you saved the file AND ran Build Verse Code again!

🌟 Bonus Challenge:

Can you add a third Print line that says how old you are? Like: "I am 11 years old!"

(No math needed — just type the number right in the message!)

🏴‍☠️

Take on the Challenge

Pass the 4-question challenge to master this lesson and chart the quest in your journal.

Recap

🏆 Great Work — Let's Recap!

You just wrote and ran your very first Verse program inside a real Fortnite island! 🎉 You learned that a Verse device is a code-powered object you drop into your level, and that the OnBegin function runs your code the moment the game starts. You used Print to send messages to the Log, and you even used curly braces { } to do live math inside a message. Keep experimenting — every great game developer started exactly where you are right now! 🌟

Pass the quiz above to chart this quest in your Journal.
Source
Verse Island

© Biloxi Studios Inc. — original Verse Island content.

Sources & licensing

Turn this into a guided course

Add Run Your First Verse Program 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.

🧭 The Keeper's log

Quest complete? Chart your next heading from the Verse Basics expedition.