Docs/Getting started/Your first rule
Your first rule
In about 5 minutes: open a blank project, add a coins variable, write one rule, and read the Verse code your rule produced.
Last updated 2026-06-06
The goal
By the end of this page, you'll have:
- A per-player
coinsvariable that persists across sessions. - A rule that increments it by 10 every time a player eliminates someone.
- Generated Verse code you can paste into UEFN.
Build it
Open Verse Builder
Head to /builder. You land on a blank project with a single device file. The activity bar on the left shows Rules, Game Data, Code, HUD tabs.Add a coins variable
Switch to Game Data → make sure the Variables sub-tab is selected (it's the default). Click + Add Variable, name itcoins, leave Type asint, Scope asplayer, Default0, and tick Persist.
One row, five settings — that's a Variable. Add a rule
Switch to Rules. Click + Add Rule. Pick:WHEN→ On EliminationIF→ leave empty (always runs)DO→ Increment Variable with targetcoinsand amount10

Your first rule. Three slots, one trigger, one action. Peek the Verse
Hit ⌘ + . (or Ctrl + . on Windows) or click the Code tab. You'll see the generated Verse for your device. Read the next section — that's the most important bit.
💡 Tip
If you don't see On Elimination in the event picker, click the pill once to open the atom browser and type “elim”. Same trick works for actions and conditions.
Read the Verse
Your one rule produced something like this:
# Persistent per-player state
te_player_stats := class<final><persistable>:
Version:int = 0
Coins:int = 0
# Inside your device:
EliminationManager.EliminatedEvent.Subscribe(OnElim)
OnElim(Result:elimination_result):void=
if (Raw := Result.EliminatingCharacter?, Agent := Raw.GetAgent[]):
SetCoins(Agent, GetCoins[Agent] + 10)
Three parts:
- State —
te_player_statsis the persistent record per player, with aCoinsfield. - Subscription — your
WHEN On Eliminationbecomes a subscribe call on the elimination manager. - Handler — when the event fires, we extract the agent (the eliminator), read their current coins, and write back +10.
What just happened?
You designed game behavior. The Composer wrote the Verse. The result is real, idiomatic Verse you could've written by hand if you wanted to spend hours on it — but you didn't need to.
Three natural follow-ups from here:
- Pair this with the score recipe → Recipe: Score tracker ends the game when a player hits a kill target.
- Take it to UEFN → From Verse Builder to UEFN covers the export + paste + wire steps.
- Master the model → The WHEN / IF / DO model explains every nuance of the rule system.
See also