For storing data during play Arcweave supports the use of global variables. Supported variable types are:
Variables are the tool the game has to "remember" what has happened. For example, if the player finds a key, you may want to store this information in a variable of the boolean type and the name has_key
, giving it the value of true
. Then, when the player reaches the relevant locked door, the game can introduce a branch that checks whether the player has the key with an if
statement, as in: if has_key...
.
Another use of variables is to display dynamic content to the user during Play Mode, through the show()
function, as in show(player_health)
.
Global variables can be used in arcscript code blocks inside elements and branches.
{primary} Arcsript does not perform strict variable type checking. Whenever there is a type conversion taking place, JavaScript's type conversion mechanisms are used.
You can see and edit your project's variables by clicking on Global variables, at the bottom of the sidebar.
This opens a window with all the variables, their name, type, and initial value.
{info} A variable's initial value is the value it carries when the Play Mode begins.
To create a new variable:
{info} Arcweave will not allow initial values of the wrong type, for example "John Smith" for an integer.
To reorder variables in the list:
To delete a variable: