13:07 ST
Variables

Variables are a custom counter that the adventure tracks. A variable can be set for anything that you might need the adventure to “remember” at later stage, usually so that the adventure can automatically execute a consequence. Variables are tracked across nodes, meaning that if you create them at the start of the adventure, you can call on them at the end, and the adventure will still have access to that information.

Variables are incredibly versatile, since their main function is to tell the adventure to keep track of anything you might need it to, without needing the adventurer to remember what they selected. Some examples of cases where variables may be used:

  • Money: You might use variables to keep track of how much money an adventurer has earned/spent over the course of the adventure.
  • A morality meter: You can create a morality meter with ‘good’ and ‘evil’ variables, with each choice the adventurer makes adding to either the ‘good’ or ‘evil’ variable
  • Keeping count of how many times a command was selected: If you needed a door to be knocked on three times before it was open, you can create a counter for ‘door’ that adds one every time the command ‘Knock on door’ is selected.

 

Did you know?
These are just a few examples of what variables might be used for! The application of variables is practically limitless, and you can use them for just about anything!
Kerric

 

Variable-Specific Actions

Variables have several actions associated with them that allows the adventure to modify them. If one of these actions uses a variable that does not yet exist in the adventure, it will automatically be created,

Increment Adds 1 to the specified variable.
Decrement Subtracts 1 from the specified variable.
Var Set Allows you to add or subtract a specified number from the variable. This action has various sub-fields to be filled in in order for the variable to set correctly:
Variable The variable name. If the name is multiple words, it should be linked with underscores.
{var:a} + 3 This tells the adventure how much to add to that variable. Simply put the variable where the ‘a’ is and change the “+ 3” to whatever positive/negative value you want.

 

Careful!
The curly brackets are very important. They make sure the adventure knows exactly what you’re telling it to do. Keeping the formatting correct is crucial to keeping the adventure working!
Kerric

 

Adventure and Individual Variables

All of the actions associated with variables have a checkbox labelled Individual. This is because the adventure tracks two kinds of variables, Adventure variables and Individual variables.

Adventure variables apply to the adventure as a whole, and any action that affects those variables will affect them in the same way for everyone in the adventure.

 

For example!
If you have the global variable ‘coins’ set to 10, and someone else in the adventure buys something that decrements ‘coins’, you will have 9 coins remaining.
Kerric

 


Individual variables only apply to the adventurer who triggered them, and any action that affects those variables will only affect the adventurer who triggered the action.

 

For example!
If you and someone else both have the individual variable ‘rocks’ set to 3 and they throw one of their rocks, your ‘rocks’ will still be at 3, whereas their ‘rocks’ will be 2.
Kerric

 


Toggling between the two is done through clicking on the Individual checkbox. Whether the variable should be Adventure or Individual depends on both the adventure and the variable.

 

Careful!
The adventure system cannot differentiate between individual and global variables with the same name, so be sure to call all your variables different things so that the adventure knows which one you want.
Kerric