Skip to reading
Buttons, Labels & Text Boxes

Write tokens that cannot be misread

Edition 0.86.4.1 HF1

0.86.4.1 Hotfix 1 edition. Earlier lessons and screenshots retain their original version context; revised references and supplements describe the newer behavior.

Download PDFView PDF page
On this page
Source table from Write tokens that cannot be misread, page 14
Write thisAvoid assuming this
$$visitor_nameA display name with spaces can replace the variable ID.
@PlayerName@playername is the same spelling. It is not.
$$score points$$scorepoints means score followed by points. It asks for a different variable.
Score: $$score.A punctuation mark after the variable is part of its ID. The period is separate.
A script computes a value first.$$score + 5 performs arithmetic. The + 5 is ordinary displayed text.
The exact variable keyThe wildcard automatically reads a property such as $$player.health.
An output label with a tokenAn editable text box expands the same token. Its contents stay literal.

Choose clear variable IDs#

The dollar form recognises a letter or underscore first, then letters, numbers or underscores. Use IDs such as visitor_name, score and clue_count. Avoid a leading digit, spaces or dots for values you intend to display this way.

Keep inserted values straightforward#

A wildcard converts the stored value to text. It does not loop through an Array and create a polished list, format a date or choose singular/plural wording. Build a display String in a script when you need those choices.

Do not rely on nested token expansion. Keep your source sentence in the label and ordinary player-facing words in its variables. That is easier to translate and much easier to diagnose.

The runtime also accepts a legacy variable key beginning with one dollar sign as a fallback for the $$ form. For new work, use ordinary IDs such as score and let $$ be the display marker.

Page 14 of 46Permalink
Go to page