Reading and Using a Device: When the Game Wakes Up
Reading and Using a Device: When the Game Wakes Up
In the last lesson you learned to hold a remote for a real device with @editable. A remote is no use sitting on the couch. This lesson is about picking it up and pressing buttons — and, just as importantly, when your code gets to do that.
The moment the game starts: OnBegin
<!-- section-art:the-moment-the-game-starts-onbegin -->

Island Awakening
Every creative device gets one special verb that the game calls automatically the moment the island starts up:
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
arena_controller := class(creative_device):
@editable
RoundTimer : timer_device = timer_device{}
# OnBegin runs once, automatically, when the island starts.
OnBegin<override>()<suspends> : void =
Print("The arena is open!")
OnBegin is your starting whistle. You do not call it — the game does, once, when play begins. Read the rest as grammar you already know:
<override>— "I am replacing the empty defaultOnBeginwith my own." Every creative device already has a blankOnBegin; you are filling it in.<suspends>— "this verb is allowed to pause and wait." Some device actions take time (waiting for a button press, sleeping a second), and<suspends>is the label that says "that's allowed in here." You will use that power in the events series.: void— "it hands nothing back." It just does things.
The indented lines under OnBegin are its steps, exactly like the bulleted-list rule from the Grammar lesson.
Pressing the remote's buttons
Once the game has woken up, you reach a device through its remote with a dot. The dot means "reach inside this device and use one of its verbs."
OnBegin<override>()<suspends> : void =
# Reach into the timer and start it.
RoundTimer.Start()
Read it left to right: "RoundTimer → reach inside → Start it." Start() is a real verb a timer_device gives you. The empty () means "Start takes no extra information."
Two verbs almost every device has: Enable and Disable
Most devices can be switched on and off from code. This is the on/off switch on the remote:
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
shop_controller := class(creative_device):
@editable
LootSpawner : item_spawner_device = item_spawner_device{}
OnBegin<override>()<suspends> : void =
# Start the spawner switched OFF, so nothing drops yet.
LootSpawner.Disable()
Disable() and Enable() are verbs almost every device shares. A common, real pattern is to Disable() something in OnBegin so it stays quiet until the player earns it, then Enable() it later. (You will wire up that "later" in the events series.)
Setting things up at the whistle
OnBegin is also where you arrange the starting state of your level — turn lights on, position movers, set timer length. Here we set a timer to 30 seconds before anything else:
SetActiveDuration(30.0) gives information to the verb — the 30.0 inside the () is the number of seconds. (The .0 makes it a decimal number, which is what a duration wants.) Notice the order: configure the device, then start it. Code runs top to bottom, so the timer is set to 30 seconds before it begins counting.
The mental model
<!-- section-art:the-mental-model -->

Referee Whistle
Think of OnBegin as the referee's whistle and your device references as remotes laid out on the table. When the whistle blows, your OnBegin steps run once, in order: pick up a remote, press a button, pick up the next, press a button. That is the entire shape of "using a device."
Why this helps you direct an AI
Now you can say something an AI can build with zero guessing: "In OnBegin, set the round timer to 30 seconds, start it, and disable the loot spawner." Every word maps to a real verb. You are describing what happens and when — the two questions every piece of game code has to answer.
Quick recap
OnBegin<override>()<suspends> : voidruns once, automatically, when the island starts.<override>= replace the blank default;<suspends>= this verb may pause and wait.- Reach into a device with a dot:
RoundTimer.Start(). Enable()/Disable()are the on/off switch most devices share.- Configure a device before you start it — code runs top to bottom.
Next: Calling Device Functions — a closer look at the verbs devices give you and the information they expect.
References
- creative_device class — Verse API Reference
- Devices in Verse — API Reference
- Part of the Devices with Verse series. Builds on Verbs, Functions, and Events.
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
- 01-device.verse · device
- 02-fragment.verse · fragment
- 03-device.verse · device
- 04-device.verse · device
Check your understanding
Test yourself with an interactive quiz and track your progress + earn XP — free for members.
Turn this into a guided course
Add Devices in Verse — OnBegin, calling verbs, Enable/Disable 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.
References
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.