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
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 Functionaction. - Stable wording you maintain yourself inside custom helpers.
Walkthrough: declare a message
Open Game Data → Messages
Each row is a Name (the Verse identifier) + a Text value.Name + text
+ Add Message, name itMsgWinner(PascalCase — it maps to a Verse identifier), text"You win!".Reference it from custom code
In the Module tab’sCustom Methods & Messageseditor, useMsgWinnerby 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.
Add a dictionary
Set the function name (GetItemName), a message prefix (MsgItem), and a fallback for unknown IDs.Add entries
1 → Sword,2 → Shield, …Call it from a rule
Use theCall Device Functionaction with functionGetItemNameand the ID as an argument. The returnedmessagecan feed a HUD/billboard action.
Gotchas
⚠️ Watch out
{coins} substitution and no parameters. To show a live value, use a HUD/billboard action wired to a variable instead.⚠️ Watch out
Call Device Function for dictionaries.📌 Note
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