Territory Takeover: Build a Color-Stealing Base Battle with Verse
Tutorial beginner

Territory Takeover: Build a Color-Stealing Base Battle with Verse

Updated beginner

Territory Takeover: Build a Color-Stealing Base Battle with Verse

Forget boring capture-the-flag flags that just sit there looking pretty. We’re building a Territory Takeover arena where the floor itself is the enemy, the loot, and the score. Using Verse, we’ll create a system where stepping on a tile steals it from your opponent, turning their base into your color in real-time. It’s like editing a wall, but for the entire map, and with more screaming.

What You'll Learn

  • Scene Graph Basics: How Verse sees your island as a hierarchy of objects (the "Scene Graph").
  • State Management: Using variables to track which team "owns" a specific tile.
  • Event-Driven Logic: Triggering actions only when a player interacts with a device.
  • Team Logic: Checking who is standing on the tile and changing the tile’s appearance accordingly.

How It Works

In Fortnite Creative, you might drag and drop a Color Changing Tile device and tweak its settings. That’s great for a quick minigame, but it’s rigid. You can’t easily add custom rules like "If Red team wins, spawn a boss" or "If Blue team holds 50% of the map, the storm closes in."

Verse gives you the steering wheel.

Here is the mental model we need to understand before writing a single line of code:

1. The Scene Graph (Your Island’s Skeleton)

Imagine your Fortnite island is a giant LEGO set. Every piece you place—a wall, a player spawner, a Color Changing Tile—is a Component attached to an Entity.

  • Entity: The physical object in the world (the tile itself).
  • Component: The behavior or data attached to it (e.g., "This tile changes color").
  • Hierarchy: The parent-child relationship. Your tile is a child of the map, which is a child of the game instance.

In Verse, we don’t just "place" things; we reference them by their Handle (a unique ID tag). Think of a Handle like a specific player’s Epic ID. You can’t just say "give loot to a player"; you have to say "give loot to Player #12345." Similarly, we need to grab the Handle of our specific tile to tell it to change color.

2. Variables vs. Constants (The Storm vs. The Bus)

  • Constant: Like the Battle Bus route. It’s set once when the match starts and doesn’t change. In Verse, this is data that stays fixed.
  • Variable: Like the Storm timer. It changes constantly (counting down, shrinking). In Verse, this is data that updates as the game runs.

We need a variable to track Ownership. Is the tile Red? Is it Blue? Or is it Neutral (no one owns it yet)?

3. The Loop (The Respawn Cycle)

Games run on loops. The game checks: "Is a player here? If yes, do something." In Verse, we use Events to handle these checks efficiently. Instead of checking every millisecond if someone stepped on a tile (which would lag your island), we tell Verse: "Hey, only run this code when the OnEnter event fires."

Let's Build It

We are going to build a simple "Tile War" system.

  1. Place three Color Changing Tiles in a row.
  2. Use Verse to make them start Neutral.
  3. When a player steps on them, the tile takes the player’s team color.
  4. We’ll also print a message to the chat so everyone knows who took the tile.

The Setup

  1. Open UEFN.
  2. Go to the Devices tab.
  3. Search for Color Changing Tile.
  4. Place three of them in a line on your map.
  5. Crucial Step: Select all three, go to the Instance tab, and give them a Name so Verse can find them. Let's name them Tile1, Tile2, and Tile3. (You can also use a single tile and copy-paste the Verse logic, but three tiles make the "war" clearer).

The Verse Code

Create a new Verse script file. We’ll use the creative_device class because our tiles are devices.

using { /Fortnite.com/Devices }
using { /Fortnite.com/Teams }
using { /Fortnite.com/Players }

# This is our main script class. Think of it as the "Brain" for our tiles.
# We inherit from creative_device, which means we can control devices.
class TileWarScript is creative_device()

    # VARIABLES (The State)
    # These are the "scores" of our game.
    # We create a list to hold our three tiles.
    # In Verse, a list is like a squad roster.
    var tiles := [
        Tile1, # Reference the device named 'Tile1' in the editor
        Tile2, # Reference 'Tile2'
        Tile3  # Reference 'Tile3'
    ]

    # This variable tracks who owns the tile.
    # Team: Neutral means no one owns it yet.
    # Team: Red or Blue means a team has claimed it.
    var current_owner := Team.Neutral

    # EVENT: OnBegin
    # This runs ONCE when the match starts.
    # Like the bus flying over the island—only happens at the start.
    event OnBegin()
        # Let's make sure all tiles start neutral (gray/white)
        # We loop through our list of tiles.
        for tile in tiles
            # Set the tile's team to Neutral
            # This is like resetting the storm to no damage
            tile.SetTeam(Team.Neutral)

    # EVENT: OnInteract
    # This runs EVERY TIME a player steps on the tile.
    # This is the "Elimination" moment for the tile.
    event OnInteract(player: player, device: creative_device)
        # 1. Check if the player is actually a player (not a prop)
        # 2. Get the player's team
        player_team := player.GetTeam()

        # 3. Update our "Ownership" variable
        current_owner := player_team

        # 4. Change the tile's color to match the player's team
        # This is the visual feedback. Like healing yourself, the tile heals to your color.
        device.SetTeam(player_team)

        # 5. Announce the takeover in chat
        # We use the global chat system
        ChatMessage := $"{player.GetPlayerName()} just stole the tile for Team {player_team}!"
        SendChatMessage(ChatMessage)

Walkthrough: What Just Happened?

  1. class TileWarScript is creative_device(): We’re creating a new type of object. It’s not just a tile; it’s a smart tile that knows how to behave.
  2. var tiles := [...]: We created a List. Imagine a backpack. You can put multiple items in it. Here, we put our three named tiles into the list so we can talk to them all at once.
  3. event OnBegin(): This is the Spawn. When the match starts, Verse looks at the list and says, "Make sure everyone is neutral." This prevents bugs where a tile might start colored if you playtest it mid-match.
  4. event OnInteract(player, device): This is the Trigger.
    • player: The person who stepped on it.
    • device: The specific tile they stepped on.
    • player.GetTeam(): This asks, "What team is this guy on?" (Red, Blue, Green, etc.).
    • device.SetTeam(): This tells the tile, "Paint yourself the same color as the player."
  5. SendChatMessage(): This is the Kill Feed. It tells everyone what happened.

Try It Yourself

The code above works, but it’s a bit basic. Everyone can steal the tile, and there’s no score.

Challenge: Add a Score Counter.

  • Create a new variable called red_score and blue_score.
  • Inside OnInteract, check if player_team is Red. If so, add 1 to red_score.
  • If it’s Blue, add 1 to blue_score.
  • Hint: You can use red_score += 1 to increase the number.

Bonus Challenge: Prevent "Flip-Flopping."

  • Make it so a tile can only be stolen if it’s currently owned by the opposing team. If Red owns it, only Blue can steal it. If it’s neutral, anyone can take it.

Recap

You’ve just built your first interactive Verse system. You learned how to:

  1. Reference devices in the Scene Graph using names.
  2. Use Variables to track game state (who owns the tile).
  3. Use Events (OnBegin, OnInteract) to react to player actions.
  4. Manipulate device properties (SetTeam) to change the game world.

This is the foundation. Once you can control one tile, you can control the whole map. Go make your friends rage-quit over a floor tile.

References

  • https://dev.epicgames.com/documentation/en-us/fortnite/using-color-changing-tile-devices-in-fortnite-creative
  • https://dev.epicgames.com/documentation/en-us/fortnite-creative/using-color-changing-tiles-devices-in-fortnite-creative
  • https://dev.epicgames.com/documentation/en-us/fortnite/using-color-changing-tile-device-design-examples-in-fortnite-creative
  • https://dev.epicgames.com/documentation/en-us/fortnite-creative/color-changing-tile-device-design-examples-in-fortnite-creative
  • https://dev.epicgames.com/documentation/en-us/uefn/verse-api/fortnitedotcom/devices/color_changing_tiles_device

Verse source files

Turn this into a guided course

Add using-color-changing-tiles-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.

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