VerseBuilderDocs

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 coins variable 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

  1. 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.
  2. Add a coins variable

    Switch to Game Data → make sure the Variables sub-tab is selected (it's the default). Click + Add Variable, name it coins, leave Type as int, Scope as player, Default 0, and tick Persist.
    Variables tab with a coins row: name=coins, type=int, scope=player, default=0, persist=on
    One row, five settings — that's a Variable.
  3. Add a rule

    Switch to Rules. Click + Add Rule. Pick:
    • WHENOn Elimination
    • IF → leave empty (always runs)
    • DOIncrement Variable with target coins and amount 10
    A rule with WHEN On Elimination DO Increment Variable coins by 10
    Your first rule. Three slots, one trigger, one action.
  4. 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:

  • Statete_player_stats is the persistent record per player, with a Coins field.
  • Subscription — your WHEN On Elimination becomes 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:

See also