Global Variables are project wide where you can store temporal and non-temporal values which can be changed in runtime. For example, if you allow users to pick the name of their characters, you can store the name they picked for their character in a String Global Variable.
To create and edit global variables open the Preferences Menu [⌘+P] and select the Variables option.
To create a new global variable type in the name and press return or click on the
+ button. You'll create a variable of type
null, which means it holds no value.
Choose which type of value a variable will hold. You can then initialize its default value.
Some variable types (strings, numbers, booleans, Colors, ...) can be saved between game sessions. This allows the player to pick up the game where they left when closing the application.
To save a variable between sessions, mark the little checkbox next to its name. The header of the variable then will inform you that this variable is savable.
A game can end up with thousands of global variables. Game Creator doesn't put any limit to the amount of variables you can create, but searching through them can become quite a daunting task. That's why we implemented a feature called Tags.
Tags allow you to categorize global variables in groups. To create a tag click on Edit Tags and type in the name of your tag. For example: Potions. You can also choose the tag's color.
To categorize a variable with a tag, simply open it and tick the tags you want to include. A variable can have as many categories as you like.
A variable's tag name will be represented with the name and a background color next to it.