Skald Documentation

Using the Skald Language

The language powering dialogue, expressions, and variable manipulation in Skald

Skald Language is the expressive text and logic system behind Skald. It combines rich text formatting with embedded expressions to create dynamic, interactive narratives.

Overview

The language consists of three interconnected systems:

  1. Rich Text Language — Formatting and structured text for dialogue and descriptions
  2. Expressions — Logical conditions and arithmetic calculations
  3. Assignments — Variable updates and state changes

Quick Reference

TypeContentsExample
Rich Text@mentions, [rich text tags], {templates}, text formattingHey @Michael! Is that a new [color="red"] @Bike [/color]? It looks {bike_age > 1 ? "old" : "new"}.
Expressions&&, ||, ==, !=, <, >, +, -, *, /, !, ?, if/then/elsehas_potion == true
Assignments&&, ||, ==, !=, <, >, +, -, *, /, !, ?, if/then/elseplayer_money = experience * 10

Rich Text Language

Rich text is used for character dialogue, player choices and descriptions. It supports:

  • Plain text — Naturally written text
  • Tags — Apply styles like colours and formatting. Not to be confused with dialogue tags
  • Mentions — Reference characters and lore dynamically
  • Templates — Embedded expressions for dynamic content

Plain Text

Write natural language directly:

Hello there! It is nice to meet you.

Tags

Use square brackets to apply styling or set attributes:

MarkupPreview
[b]This text is bold[/b]This text is bold
[s]This text is strikethrough[/s]This text is strikethrough
[i]This text is italic[/i]This text is italic
[u]This text is underlined[/u]This text is underlined
[color="red"]This text is red[/color]This text is red
[b][u][i][s]This text is bold, underlined, italicised and strikethrough[/s][/i][/u][/b]This text is bold, underlined, italicised and strikethrough

Shortcuts

You can use keyboard shortcuts for bold and italics (Cmd/Ctrl + b for bold and Cmd/Ctrl + i for italic)

Mentions

Use the @ symbol to reference characters or lore items dynamically:

Oh, hi, @John!
Look at this cool @Stick I found!

Mentioning instead of plain text benefits

Referencing by name (e.g., @john) supports autocomplete and ensures you don't need to remember character or lore names and spelling. In addition, it makes for easier renaming because updating the character or lore name automatically updates all references.

Mentions can also have custom applications in your game project. For example, you could use them for tooltips to show character descriptions or custom text.

Templates

Embed expressions using curly braces:

You have {health} health points remaining.
You found {itemsCount} items.
The door is {isOpen ? "open" : "locked"}.

Templates evaluate expressions and insert the result:

{health < 100 ? "Damaged" : "Healthy"}
{health + 10} healing applied.

Expressions

Expressions are used in conditions, player choice preconditions, and assignments. They support arithmetic, comparison, and logical operations.

Expressions support strings, floats, integers, and booleans.

Expressions are used in Assignment Nodes, and Conditional Nodes but also in the Preconditionals that are used in Player Choice Nodes

Operators

Arithmetic

OperatorNameExample
+Additiona + b
-Subtractiona - b
*Multiplicationa * b
/Divisiona / b
%Moduloa % b

Mixing variable types

You can mix numbers and float, but they will always evaluate to a float. Meaning that 2 + 2.0 = 4.0

Type Mismatches

Type mismatches cause errors. For example:

// Error: Cannot compare string to number
'hello' == 42 // ❌ Error

// Valid: Same types
'hello' == 'world' //Valid (will evaluate to 'false')
10 == 10 //Valid (will evaluate to 'true')

See more about errors in Errors

String Concatination

string can use the + operator to combine strings. This means that He is + drunk evaluates to He is drunk.

Comparison

OperatorNameExample
==Equalitya == b
!=Inequalitya != b
<Less thana < b
<=Less than or equala <= b
>Greater thana > b
>=Greater than or equala >= b

true and false

Comparisons always evaluate to 'true' or 'false'.

If using 'true' and 'false' yourself, pay attention to case sensitivity as 'True' and 'False' are not valid values for booleans.

Logical

OperatorNameExample
&&Anda && b
||Ora || b
!Not!a

Ternary

You can use conditional expressions with ? :

health > 75 ? "You are healthy" : "You need healing"

Full syntax:

condition ? then : else

If/Then/Else

Alternative ternary syntax with keywords:

if (score >= 100) then showTitleScreen else showMenu

Parentheses

Use parentheses to control evaluation order:

(a + b) * c
d - (e + f)

Assignments

You assign expressions to variables using the = operator. This will assign the value on the right side to the variable on the left side.

health = 100
isOpen = false

You can perform operations on the right side of assignments that will be evaluated before the value is applied to the variable.

score = 100+100

You can use multiple variables in assignments.

score = playerPoints * multiplier

Assigning

The left side of the operation can only ever have a variable. It cannot be simple types nor be multiple variables. The following example will give an error in the inspector. See more below in Errors.

score + health = 100

How To Assign

  • Use = for assignment
  • Can assign any valid expression
  • Variables must exist in the project's variable list
  • Types must match the variable's declared type
  • Evaluations follow standard orders of operations

Errors

Errors come in multiple forms. All errors are highlighted in the inspector as red squiggles.

Error Highlighting

Hovering with the mouse will show the error message, as seen here:

Error Message

For the above example, isOpen has not been defined in the variables list.

Best Practices

  1. Use parentheses — Improves readability with complex operations
  2. Good naming — Use clear names for variables (flower_color is more descriptive than fc)
  3. Avoid "magic numbers" — Use named variables where possible instead of hard-coded values

On this page