VerseBuilderDocs

Docs/Game data/Messages

Messages

Advanced & optional. Most rules create their display text automatically. Use this tab to declare named <localizes> text for custom Module code, or to map item IDs to names.

Last updated 2026-06-14

You usually don’t need this

Whenever a rule action shows text — Show Popup, Set Billboard, Set HUD Text — the builder automatically declares the underlying <localizes> message from the text you type. Identical text is de-duplicated, so two actions with the same string share one declaration. There is no message picker in rule actions, and editing a message here does not change text that a rule already typed.

📌 Note

If all you want is to show a sentence to the player, type it directly in the action. Skip this tab entirely.

When you DO need it

  • Custom Module code — when you hand-write Verse in the Module tab and need a named message (e.g. MsgWinner) to reference.
  • Item names — map integer IDs to display names with an Item Dictionary, then read them via the Call Device Function action.
  • Stable wording you maintain yourself inside custom helpers.

Walkthrough: declare a message

  1. Open Game Data → Messages

    Each row is a Name (the Verse identifier) + a Text value.
  2. Name + text

    + Add Message, name it MsgWinner (PascalCase — it maps to a Verse identifier), text "You win!".
  3. Reference it from custom code

    In the Module tab’s Custom Methods & Messages editor, use MsgWinner by name inside a helper you write. (Standard rule actions don’t reference declared messages — they create their own.)

Item Dictionaries

A dictionary maps integer IDs to display names. It generates a lookup function plus all the <localizes> messages it needs. Use it when you store an item/team/slot as a number but want to show its name.

  1. Add a dictionary

    Set the function name (GetItemName), a message prefix (MsgItem), and a fallback for unknown IDs.
  2. Add entries

    1 → Sword, 2 → Shield, …
  3. Call it from a rule

    Use the Call Device Function action with function GetItemName and the ID as an argument. The returned message can feed a HUD/billboard action.

Gotchas

⚠️ Watch out

No token interpolation. A message is plain text — there is no {coins} substitution and no parameters. To show a live value, use a HUD/billboard action wired to a variable instead.

⚠️ Watch out

No selector in rules. Declaring a message here does not make it appear in any action dropdown. It is only reachable from custom Verse you write in the Module tab, or via Call Device Function for dictionaries.

📌 Note

Names should be PascalCase + descriptive — MsgWinner, not msg2. The generated Verse uses your name as the identifier.

What gets generated?

Each Message becomes one <localizes> line in the device class; a dictionary adds its messages plus a lookup function:

my_device := class(creative_device):

    MsgWinner<localizes>:message = "You win!"

    # Item Dictionary (auto-generated)
    MsgItemSword<localizes>:message = "Sword"
    MsgItemShield<localizes>:message = "Shield"
    MsgItemUnknown<localizes>:message = "(empty)"

    GetItemName(Id : int):message=
        if (Id = 1): MsgItemSword
        else if (Id = 2): MsgItemShield
        else: MsgItemUnknown

See also