Variable

From Castle Wiki
Revision as of 19:57, 10 May 2022 by Lukalot (talk | contribs) (remove old image)
The global variables tab of the Tools panel

A variable is a method of saving a number value to be used later in an expression or as a parameter for a response. Variables can be used for accumulating player scores in a game, tracking player money and transactions, remembering properties of objects in a simulation deck, or can just be used as conveniently editable parameters which you can tweak later.

Variable types

Actor variables

The actor variables section of a blueprint

Local variables are variables that are accessible by only the actor that owns it and its values cant be edited by other actors

Global variables

Global variables are variables that are accessed by all actors in all cards in the deck. Global variables have 2 possible lifetimes, 'deck play' and 'persistent per player'.

Global variable lifetime

Deck play

Variables that have deck play lifetime have values that only last for one deck play before reseting to their initial value either by the player restarting the deck or leaving the deck and returning to it.

Persistent per player

Variables with 'persistent per player' lifetime save progress between deck plays. Leaving and returning to a deck with a persistent variable will preserve the value of the variable, as will restarting the deck.