Device References: Handing Verse the Remote Control
Tutorial beginner compiles

Device References: Handing Verse the Remote Control

Updated beginner Devices Code verified

What a Device Reference Is: Handing Verse the Remote Control

You already know what a device is. Every button, timer, item spawner, and trigger you drag into your island from the device gallery is a device. They are the little machines that make a Fortnite island do things.

This lesson teaches the one idea that connects your Verse code to those machines: a device reference. Once you have it, the rest of devices-in-Verse is just looking up which buttons to press.

A device reference is a remote control. Your code holds the remote; pressing its buttons makes the real device in the level do something.

The problem a reference solves

<!-- section-art:the-problem-a-reference-solves --> Device References: Handing Verse the Remote Control: The problem a reference solves

Remote Control

Picture a TV across the room. You can see it. But you cannot change the channel by staring at it — you need the remote that is paired to that TV.

Your Verse code is the same. There might be ten buttons in your level. Your code cannot do anything to a button until it is holding the remote for one specific button. That remote is a device reference.

Your code lives inside a device too

Before we can hold a remote, our code needs a home. In Verse, your script is itself a device — a creative device. You write it as a class:

using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }

# Our script is its own device. creative_device is the base
# class every Verse script device is built from.
welcome_sign := class(creative_device):

Read it as a sentence, exactly like the Grammar lesson taught: "welcome_sign is a creative device." The two using lines at the top are "I want to use the Devices toolbox and the Simulation toolbox" — they unlock the names like button_device that we are about to use.

This welcome_sign device is what you will drag into your level. Everything else goes inside it (indented underneath).

Holding the remote: @editable

Now we give our device a remote for a button. Here is the whole pattern:

using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }

welcome_sign := class(creative_device):

    # @editable makes this remote show up as a slot in the UEFN
    # Details panel, so you can drag the real button onto it.
    @editable
    StartButton : button_device = button_device{}

Two new pieces, both simple:

  • StartButton : button_device = button_device{} is the sentence shape you already know — "StartButton is a button device, starting as a new button device." This is the remote.
  • @editable is the magic word above it. It means "show this remote as a slot in the editor." Think of @editable as drilling a socket into your device's control panel so you can plug a real button into it.

button_device is a real Verse type — it is the kind of remote that pairs with a Button device. Item spawners use item_spawner_device, timers use timer_device, and so on. The type always matches the device.

Pairing the remote to the real device

Code alone does not pair the remote. You finish the job in the editor, with the mouse:

  1. Drag your welcome_sign Verse device into the level.
  2. Place a real Button device in the level too.
  3. Click the welcome_sign device. In its Details panel you will see a slot named Start Button (the @editable socket you drilled).
  4. Drag the real Button into that slot.

Done. Now StartButton in your code is the remote for that exact button. Press a button on the remote in code, and that button in the level reacts.

If you forget step 4, the remote is paired to nothing. That is the single most common beginner mistake with devices. An empty socket does nothing.

Many remotes, one device

A real game script holds several remotes at once:

Three sockets, three remotes: a button, a timer, and an item granter. Each one is its own @editable line with the matching type. In the editor you get three slots to drag three real devices into. That is how one Verse brain controls a whole machine.

Why this makes you better at directing an AI

<!-- section-art:why-this-makes-you-better-at-directing-an-ai --> Device References: Handing Verse the Remote Control: Why this makes you better at directing an AI

Precise Control

If you can say "give the device an @editable RoundTimer : timer_device," you have spoken exact, correct Verse — and any helper, human or AI, knows precisely what to build and how to wire it. Vague requests like "add a timer somehow" produce vague code. Naming the reference, its type, and the @editable marker is the difference.

Quick recap

  • A device reference is a remote control your code holds for one real device in the level.
  • Your script is itself a device: my_device := class(creative_device):.
  • A reference is the familiar sentence: Name : device_type = device_type{}.
  • @editable drills a socket in the Details panel so you can drag the real device onto the reference.
  • The type (button_device, timer_device, …) must match the device.
  • You must drag the real device into the slot, or the remote controls nothing.

Next: Reading and Using a Device — actually doing things with the remotes you now hold.

References

Get the complete code — free

You've read the full walkthrough. The complete, copy-paste-ready Verse solution is free for members — sign in to unlock it.

Free with your BrainDead.TV / BrainDeadGuild Discord account. The walkthrough above is always free.

Verse source files

Check your understanding

Test yourself with an interactive quiz and track your progress + earn XP — free for members.

Up next · Devices with Verse Reading and Using a Device: When the Game Wakes Up Continue →

Turn this into a guided course

Add Devices in Verse — @editable device references 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