Generating Plate Text

To get a believable plate number without asking the player to type one, you may want to generate the license plate text by following a specific pattern.

The settings for generating the text are located in the vars.plate block.

A Simple Pattern

This example will generate text like BNG-042:

"vars": {
  "plate": {
    "type": "string",
    "default": "BNG-{d}{d}{d}",
    "charsets": {
      "d": "0123456789"
    },
    "maxLength": 8
  }
}

Anything outside braces is copied as-is. Anything inside braces is a token. In this example, {d} means “pick one character from the d charset”.

You can choose your own token names:

"default": "{letter}{letter}-{number}{number}{number}",
"charsets": {
  "letter": "ABCDEFGHJKLMNPQRSTUVWXYZ",
  "number": "0123456789"
}

A charset can also be a list of full strings. That is useful for regions, prefixes, or short words:

"default": "{region}-{d}{d}{d}",
"charsets": {
  "region": ["N", "S", "E", "W"],
  "d": "0123456789"
}

Several Possible Patterns

default can be a list. The game will pick one pattern when it generates a plate:

"default": [
  "{letter}{letter}-{d}{d}{d}",
  "{d}{d}-{letter}{letter}{letter}"
]

If you repeat an entry, it becomes more likely because the game chooses one item from the list:

"default": [
  "{letter}{letter}-{d}{d}{d}",
  "{letter}{letter}-{d}{d}{d}",
  "{d}{d}-{letter}{letter}{letter}"
]

Different Text Per Format

Sometimes the wide and square plate formats need different generated text. Put a formats block inside vars.plate:

"vars": {
  "plate": {
    "type": "string",
    "default": "{letter}{letter}-{d}{d}{d}",
    "formats": {
      "30-15": {
        "default": "{letter}{letter}\n{d}{d}{d}"
      }
    },
    "charsets": {
      "letter": "ABCDEFGHJKLMNPQRSTUVWXYZ",
      "d": "0123456789"
    },
    "maxLength": 8
  }
}

The format-specific pattern is used only when that plate format is being rendered.

Custom Text Limits

Players can type their own plate text. Use minLength and maxLength to describe what your design expects:

"minLength": 0,
"maxLength": 8

Keep maxLength realistic for your layout. A text node with "fit": "shrink" can prevent overflow, but very long plate text will still look cramped.

Stable Preset Variables

You can define extra variables with a preset list. The game picks one entry based on the plate text and keeps that choice stable for the same text:

"vars": {
  "plate": {
    "type": "string",
    "default": "{letter}{letter}-{d}{d}{d}",
    "charsets": {
      "letter": "ABCDEFGHJKLMNPQRSTUVWXYZ",
      "d": "0123456789"
    }
  },
  "stickerColor": {
    "preset": ["#2b6cff", "#24a148", "#f1c21b"]
  }
}

You can then use {stickerColor} in a node, for example as the color of a small box.

Splitting Text Across Nodes

The template automatically provides {plate}. Some layouts need more than one text node.

For a two-line plate, use limit and limit2 on the format:

"30-15": {
  "size": [512, 256],
  "limit": 3,
  "limit2": 5,
  "root": {
    "children": [
      { "type": "text", "text": "{line1}" },
      { "type": "text", "text": "{line2}" }
    ]
  }
}

line1 gets the first limit characters. line2 gets the next limit2 characters.

For more precise splits, use segments. Ranges are zero-based, and the end is not included:

"segments": [[0, 2], [2, 5], [5, 8]]

This creates {seg1}, {seg2}, and {seg3}.

Field Summary

Name
Type
Optional
Default Value
Description
Name
default
Type
string or array of strings
Optional
Default Value
none
Description
Pattern used to generate plate text. Tokens are written as {name} and resolved from charsets, or from built-in dynamic tokens.
Name
charsets
Type
object
Optional
Default Value
empty
Description
Defines custom tokens used by default. Each value can be a string of possible characters or an array of full strings.
Name
formats
Type
object
Optional
Default Value
empty
Description
Per-format overrides. Use formats..default when one plate size needs a different generated pattern.
Name
minLength
Type
number
Optional
Default Value
0
Description
Minimum length expected for player-entered custom text.
Name
maxLength
Type
number
Optional
Default Value
32
Description
Maximum length expected for player-entered custom text.
Name
preset
Type
array
Optional
Default Value
empty
Description
For non-plate variables, picks one stable value from the list based on the plate text.

Built-In Dynamic Tokens

Name
Example
Description
Name
{vid}
Example
2048
Description
Vehicle engine id.
Name
{vname}
Example
sunburst
Description
JBeam folder name of the vehicle model.
Name
custom tokens
Example
{d}, {letter}, {region}
Description
Any other token name must be defined in charsets. The names are up to you.
Last modified: July 30, 2026

Any further questions?

Join our discord
Our documentation is currently incomplete and undergoing active development. If you have any questions or feedback, please visit this forum thread.