The Big Rig Rampage: A Verse Tutorial for Vertical Madness
Tutorial beginner

The Big Rig Rampage: A Verse Tutorial for Vertical Madness

Updated beginner

The Big Rig Rampage: A Verse Tutorial for Vertical Madness

So, you want to build an island that doesn’t just sit there looking pretty? You want to launch players into the stratosphere with a semi-truck and a timer ticking down? Welcome to the world of Verse, Epic’s programming language for Fortnite Creative.

Forget "Hello World." That’s for people who enjoy watching paint dry. We’re going to build a "Vertical Victory" mini-game. The goal is simple: Get into a Big Rig, drive up a gravity-defying ramp, and smash a button before the storm (or a timer) eats you alive.

In this tutorial, we’ll stop relying on the clumsy "Device Browser" (where you connect wires like it’s 2005) and start writing actual code. We’ll use Verse to make the game start, track the timer, and declare a winner. By the end, you’ll have a playable, chaotic hill-climb challenge.

What You'll Learn

  • What Verse is (and why it’s better than drag-and-drop for complex games).
  • The Scene Graph: Understanding how your island is made of "Entities" (objects) and "Components" (what they do).
  • Variables & Constants: Tracking the timer and the win condition.
  • Events: Making things happen when the game starts or the button is pressed.

How It Works

Before we write a single line of code, we need to understand the mental model. In Fortnite Creative’s old way, you placed a device and connected a wire. In Verse, you are the architect of reality.

The Scene Graph: Your Island’s Skeleton

Imagine your island is a tree. At the top is the Game Instance (the whole island). Hanging off it are Entities (your Big Rig, your button, the ground). Hanging off those Entities are Components (the script that makes the button work, the physics that make the truck drive).

When you write Verse, you aren’t just moving boxes; you are attaching logic to these components.

The Gameplay Loop

  1. Start: The game begins. A timer starts counting down.
  2. Play: The player spawns in a Big Rig. They drive.
  3. Win: The player hits a specific button. The timer stops. The player wins.
  4. Fail: The timer hits zero. The player loses.

We are going to code steps 1, 3, and 4. Step 2 is just... driving.

Let's Build It

We need three things in our island editor first:

  1. A Big Rig Spawner (to give the player the truck).
  2. A Button (the goal).
  3. A Timer (the pressure).

Now, open the Verse editor. Create a new file. Let’s call it VerticalVictory.verse.

Here is the code. Don’t panic at the syntax. We’ll break it down line-by-line.

// 1. The Script Header
// This tells the game: "I am a script that runs when the game starts."
script class VerticalVictoryScript: IScript {
    
    // 2. Components (The "What")
    // These are references to devices you place in the level.
    // Think of these as "slots" where you plug in your real devices.
    button_device: ButtonDevice = Self.GetActor()
    timer_device: TimerDevice = Self.GetActor()
    
    // 3. Constants (The "Rules")
    // These values never change. Like the max health in a standard match.
    const WIN_TIME := 60.0 // 60 seconds to win
    
    // 4. Variables (The "State")
    // These change during the game. Like your shield level.
    game_active: bool = false
    
    // 5. Events (The "Triggers")
    // This runs once when the island loads.
    OnBegin<override>()<suspends> {
        // Start the timer immediately
        timer_device.StartTimer(WIN_TIME)
        
        // Mark the game as active
        game_active = true
        
        // Wait for the timer to finish OR the button to be pressed
        WaitForGameEnd()
    }
    
    // This event runs every time the button is pressed
    OnButtonPressed<override>(pressed: bool) {
        if (pressed and game_active) {
            // Player hit the button!
            timer_device.StopTimer()
            game_active = false
            
            // Tell everyone they won
            Print("Winner Winner, Truck Dinner!")
            
            // End the game with a win state
            EndGame(1, 0) // 1 win, 0 losses
        }
    }
    
    // This event runs when the timer hits zero
    OnTimerFinished<override>() {
        if (game_active) {
            // Time's up!
            game_active = false
            Print("Time's Up! You're Toast.")
            
            // End the game with a loss state
            EndGame(0, 1) // 0 wins, 1 loss
        }
    }
}

Breaking Down the Code

1. script class VerticalVictoryScript: IScript

This is the container. In programming, a Class is like a blueprint for a house. We are creating a blueprint for our game logic. IScript is a special interface that tells the game engine, "Hey, I’m a script, pay attention to me."

2. button_device: ButtonDevice = Self.GetActor()

This looks scary, but it’s simple. We are creating a Variable (a box that holds data) named button_device. The type is ButtonDevice.

  • Game Analogy: Think of this like equipping a weapon slot. You haven’t put the gun in yet, but the slot is reserved.
  • Self.GetActor() is a placeholder. When you attach this script to a device in the editor, you’ll tell it which specific Button Device to watch.

3. const WIN_TIME := 60.0

This is a Constant. It’s set once, like the color of the sky in the editor, and it never changes. If you want the game to be harder, you change this number from 60.0 to 30.0.

4. game_active: bool = false

This is a Boolean (a true/false switch).

  • Game Analogy: It’s like the "Game Active" toggle on a console. true means the game is running. false means it’s over. We start it as false and flip it to true in the OnBegin event.

5. OnBegin<override>()<suspends>

This is an Event. An event is a hook that the game engine calls automatically.

  • OnBegin runs exactly once when the island starts.
  • StartTimer(WIN_TIME) tells the timer device to count down from 60 seconds.
  • game_active = true flips the switch. Now the game is live.

6. OnButtonPressed<override>(pressed: bool)

Another event. This runs every time someone presses a button.

  • We check if (pressed and game_active). This ensures we don’t count a button press if the game is already over.
  • If the player hits the button, we stop the timer, print a message, and call EndGame.
  • EndGame(1, 0) is the victory condition. The first number is wins, the second is losses.

7. OnTimerFinished<override>()

The final event. If the timer hits zero, this runs.

  • We set game_active = false to prevent any late button presses from counting.
  • We call EndGame(0, 1) for a loss.

Try It Yourself

Now that you have the script, here’s how to make it work in Fortnite Creative:

  1. Place Devices: Put down a Button and a Timer in your level.
  2. Attach the Script: In the device settings for the Button, find the "Script" slot. Attach VerticalVictoryScript.
  3. Wire It Up:
    • In the script settings, you’ll see slots for button_device and timer_device.
    • Drag your Button device into the button_device slot.
    • Drag your Timer device into the timer_device slot.
  4. Test: Play the island. Does the timer start? Does pressing the button end the game with a win message?

Challenge: Modify the code to make the game harder.

  • Hint: Look at the WIN_TIME constant. What happens if you change it to 10.0?
  • Extra Credit: Can you make the button turn red when the timer is below 10 seconds? (You’ll need to look up how to change device colors in Verse, but you know how variables work now!)

Recap

You just built a functional game loop using Verse. You learned that:

  • Scripts are blueprints for logic.
  • Variables hold changing data (like the game state).
  • Constants hold fixed rules (like the timer length).
  • Events are the triggers that make things happen (start, press, finish).

You’re no longer just placing devices. You’re programming the rules of reality. Now go make something chaotic.

References

  • https://dev.epicgames.com/documentation/en-us/fortnite/big-rig-device-design-example-in-fortnite-creative
  • https://dev.epicgames.com/documentation/en-us/fortnite-creative/big-rig-device-design-examples-in-fortnite-creative
  • https://dev.epicgames.com/documentation/en-us/fortnite/device-design-examples-in-fortnite-creative
  • https://dev.epicgames.com/documentation/en-us/fortnite/using-big-rig-spawner-devices-in-fortnite-creative
  • https://dev.epicgames.com/documentation/en-us/fortnite-creative/device-design-examples-in-fortnite-creative

Verse source files

Turn this into a guided course

Add big-rig-device-design-examples-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.

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.

Comments

    Sign in to vote, comment, or suggest an edit. Sign in