Skip to content

Variables

Arcweave supports the use of global variables to store data during play. These variables help track the game's state and influence its progression. The supported variable types are:

  • boolean
  • string
  • integer
  • float

Variables are the mechanism through which the game can "remember" what has happened. For example, if the player finds a key, you might store this information in a boolean variable named has_key, assigning it the value true. Later, when the player encounters a locked door, a branch can check the value of has_key using an if statement, such as if has_key....

Another common use of variables is to display dynamic values to the player during Play Mode using the show() function, e.g. show(player_health).

Global variables can be used in arcscript segments within elements and branches.

✅ Arcscript does not enforce strict type checking. When type conversion occurs, it follows JavaScript's type coercion rules.

Variables list

To view and manage your project's global variables, click Global variables at the bottom of the sidebar. This opens a panel listing all variables, including their names, types, and initial values.

ℹ️ A variable's initial value is the value it holds at the start of Play Mode.

Creating variables

To create a new variable follow the next steps:

  1. Click Global variables at the bottom of the sidebar, to open their panel.
  2. If variables already exist, click New variable (orange button). Otherwise, click New global variable.
  3. Select the variable's type from the dropdown menu.
  4. Enter its initial value.

ℹ️ Arcweave will prevent you from entering an invalid initial value for a variable's type (e.g. a string like "John Smith" for an integer).

Reordering variables

To reorder variables:

  1. Click Global variables at the bottom of the sidebar, to open their panel.
  2. Click and hold the handle icon at the beginning of the variable's row.
  3. Drag and drop the row to the desired position.

Deleting a variable

  1. Click Global variables at the bottom of the sidebar, to open their panel.
  2. Locate the variable in the list.
  3. Click the three dots icon at the end of its row.
  4. Select Delete variable.