Three Devices, End to End: A Reward Button
Tutorial beginner compiles

Three Devices, End to End: A Reward Button

Updated beginner Devices Code verified

Three Devices, End to End: A Reward Button

Time to put it all together. We will build a tiny but complete piece of a game: press a button, get a reward, and start a countdown. Three real devices — a Button, an Item Granter, and a Timer — controlled by one Verse brain.

This pulls together everything from the series: references, OnBegin, and calling verbs with arguments. It also previews the next series, Events & Subscribables, because the button has to tell us when it is pressed.

The plan, in plain words

  1. The player presses a Button.
  2. We grant them an item as a reward.
  3. We start a 30-second timer so the round is on.

Three devices, three remotes, one script.

Step 1 — Hold all three remotes

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

reward_station := class(creative_device):

    @editable
    RewardButton : button_device = button_device{}

    @editable
    PrizeGranter : item_granter_device = item_granter_device{}

    @editable
    RoundTimer : timer_device = timer_device{}

Three @editable sockets, three matching types. In the editor you will drag a real Button, Item Granter, and Timer onto these three slots.

Step 2 — Listen for the press

<!-- section-art:step-2-listen-for-the-press --> Three Devices, End to End: A Reward Button: Step 2 — Listen for the press

Button Listener

A button does not call your code out of nowhere; you have to start listening for its press. Every button gives you an event called InteractedWithEvent, and you connect a verb to it with Subscribe:

OnBegin<override>()<suspends> : void =
        # "When the reward button is interacted with, run OnRewardPressed."
        RewardButton.InteractedWithEvent.Subscribe(OnRewardPressed)

Read it as the sentence from the Grammar lesson: "RewardButton's interacted-with event → Subscribe → run OnRewardPressed." We do this once, in OnBegin, so the listening is set up the moment the game starts. (The full story of events is the next series — here we just use one.)

Step 3 — React to the press

Subscribe needs a verb to run. We write OnRewardPressed. The button hands it the agent — the player who pressed it — for free:

# The button hands us the player who pressed it, as an agent.
    OnRewardPressed(Player : agent) : void =
        # 1. Reward THAT player with the granter's item.
        PrizeGranter.GrantItem(Player)
        # 2. Put 30 seconds on the clock and start it.
        RoundTimer.SetActiveDuration(30.0)
        RoundTimer.Start()
        Print("Reward granted — round is on!")

Every line is a verb you already met: GrantItem(Player) rewards the player, SetActiveDuration(30.0) sets the clock, Start() runs it. The Player flowed in from the button press and straight into GrantItem. That is the agent story from the last lesson, working for real.

The whole thing

Here it is in one piece — a complete, working reward station:

Wiring it in the editor

Code is half the job; the mouse does the other half:

  1. Place a Button, an Item Granter (with an item chosen in its settings), and a Timer in your level.
  2. Drag your reward_station Verse device in too.
  3. Click reward_station. In its Details panel, drag the real Button onto Reward Button, the Granter onto Prize Granter, and the Timer onto Round Timer.
  4. Push your changes and play. Walk up, hold the button — you get the item and the clock starts.

If nothing happens, the usual culprit is an empty slot in step 3. A remote paired to nothing does nothing.

What you just proved you can do

<!-- section-art:what-you-just-proved-you-can-do --> Three Devices, End to End: A Reward Button: What you just proved you can do

The Interaction Loop

You built a real interaction loop: an input (button), an effect on a player (granted item), and a state change (running timer). That input → effect → state shape is the skeleton of almost every game mechanic. Swap the devices and you have a vending machine, a checkpoint, a boss-fight trigger — same shape.

Why this helps you direct an AI

You can now hand a helper a complete spec in plain Verse terms: "On a button's InteractedWithEvent, grant the pressing player an item via an item granter and start a 30-second timer." Every noun and verb in that sentence is real and points at exactly one thing. That precision is what turns a vague wish into working code on the first try.

Quick recap

  • A real mechanic = several device references + OnBegin + a reaction verb.
  • A button tells you it was pressed via InteractedWithEvent + Subscribe.
  • The button hands your reaction verb the agent (the player) for free.
  • Pass that agent straight into player-facing verbs like GrantItem.
  • Always finish the wiring in the editor — empty slots are the #1 bug.

That completes Devices with Verse. Next, dive into Events & Subscribables to fully understand the Subscribe you just used.

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 · Events & Subscribables What Events Are: The Announcer and the Crowd Continue →

Turn this into a guided course

Add Devices in Verse — button, item granter, and timer together 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