Skip to main content

Reuse game-wide values with variables

A variable stores one value that can be reused across designs. Change it once when a shared label, colour, logo, or switch changes across the game.

Game variables in Game Piece Studio

Choose a variable or dataset column​

Use a variable for:

  • Game title, copyright line, or rules version.
  • Brand and rarity colours shared by several designs.
  • Publisher logo or another shared image.
  • A number used by several bound properties.
  • A boolean used as a game-wide expression switch.

Use a dataset column when the value changes between individual cards or pieces.

Variables support Text, Number, Boolean, Color, and Image. They do not support Enum.

Create a variable​

  1. Open Variables and choose Add variable.
  2. Give it a purpose-based name, such as Foil colour.
  3. Choose its type and enter the value. An image variable takes an image URL, or choose Upload to add a file.
  4. Studio saves each change automatically; the status beside Add variable shows Saved when it is done.
  5. Select the token in the Token column to copy it if you will type it into an expression.

The first name produces an expression key, so Foil colour becomes a token such as:

{{ var.foil_colour }}

Bind and combine variables​

In the Designer, select the database icon beside a compatible property and choose the variable. You can also type its token into an expression:

{{ var.game_title }}
{{ if(row.foil, var.foil_colour, row.frame_colour) }}
{{ concat(row.title, " - ", var.game_short_name) }}

The picker filters out incompatible types. For example, a colour variable can drive a paint field, while an image variable can drive an image source.

Change or delete a variable​

Edit the value, wait for Saved, then preview representative designs. Changing a variable's type clears its value, so enter a new one afterwards. Renaming the display name does not change its expression key, so existing var tokens continue to work. Create a new variable if you deliberately need a different key.

The delete confirmation checks known usage in designs, datasets, other variables, and the Scratch Pad. Studio disables deletion when the usage check is incomplete. Update every listed reference first whenever possible; a deleted token remains unresolved until its consumer is changed.