Skald Documentation

Variables

Managing variables in your Skald project

Variables

Variables are reusable pieces of data that your narrative can store and use throughout your project. They let you track game state, player choices, and other important information across conversations.

Variables

Creating a Variable

To create a new variable:

  1. Navigate to the Variables page in your project
  2. Click "Add Variable"
  3. Enter a unique name for your variable
  4. Select the appropriate variable type
  5. Optionally, set a default value

Changes are saved automatically.

Variable Types

String Variables

String variables store text data. They're perfect for:

  • Dynamic dialogue text
  • The player's name
  • Values used for rich text

Tip

If a string variable is not going to change during the game, it would be better to use lore items instead.

Integer Variables

Integer variables store whole numbers only. They're ideal for:

  • Score counters
  • Item counts
  • Level numbers

Float Variables

Float variables store decimal numbers. They are great when precision beyond whole numbers matters. Use them for:

  • Percentages
  • Progress values

Boolean Variables

Boolean variables store true/false values. Perfect for:

  • Has weapon?
  • Is hidden?
  • Has completed quest?
  • Door unlocked?

Boolean default value

Boolean variables default to false. They cannot be undefined.

Using Variables in Your Narrative

Variables can be referenced throughout your project using syntax depending on where you want to use the variable.

Given the following variable definitions:

NameValue
player_nameJohn
player_age30
flower_colorred
door_unlockedfalse
Node TypeInputResult
Dialogue NodeThe flowers were a beautiful {flower_color} colourThe flowers were a beautiful red colour
Assignment Nodeplayer_age = 30From this point on, player_age will be 30
Conditional Nodedoor_unlocked == trueThis condition will evaluate to false

Tip

Variable names are case-insensitive. The variable PlayerName and playername cannot both exist.

On this page