Set up game states for your game.
Game states are found in System > Game States.
Game state condition templates are found in System > Game State Condition Templates.
Game states are an easy way to keep track of what’s currently happening in your game. A game state is either Active or Inactive, the game can have multiple active states at the same time. They’re used for checking conditions, e.g. when to display a HUD or block a machine from executing.
E.g. if the Game Paused state is active you’d most likely want to hide some HUDs and block machines handling custom control mechanics.
Changing Game States #
Game states can be changed by schematics (using a Change Game State node) or automatically through certain events or other game states being activated or inactivated.
Auto Activate/Inactivate #
A game state can be automatically activated or inactivated by the following events:
- Battle End
When a battle ends. - Battle Start
When a battle starts. - Block Camera Control
When the camera control is blocked. - Block Player Control
When the player control is blocked. - End Blocking Machine
When ending a ‘Blocking’ execution type machine. - End Scene Change
When ending a scene change (after fading in). - Item Collection End
When an item collection ends (via ‘Item Collector’ component). - Item Collection Start
When an item collection starts (via ‘Item Collector’ component). - Menu Close
When a menu is closed. - Menu Open
When a menu is opened. - Pause Game
When the game is paused. - Performing Action End
When a battle action ends performing (no active action afterwards). - Performing Action Start
When a battle action starts performing (previously no active action). - Shop Close
When a shop is closed. - Shop Open
When a shop is opened. - Start Blocking Machine
When starting a ‘Blocking’ execution type machine. - Start Game
When the game is started (‘Start Game’ node). - Start Scene Change
When starting a scene change (before fading out). - Stop Game
When the game is stopped (‘Stop Game’ node). - Target Selection End
When player group member ends selecting targets. - Target Selection Start
When player group member starts selecting targets. - Unblock Camera Control
When the camera control is unblocked. - Unblock Player Control
When the player control is unblocked. - Unpause Game
When the game is unpaused/resumed.
The events can be added in the game state’s settings.
You can also create custom events by deriving your class from the BaseGameStateChangeType class. Check the classes for the available events for examples.
Examples #
The game state Game Running is auto activated by the event Start Game and auto inactivated by the event Stop Game.
While the player is playing the game (e.g. started through a main menu), the Game Running state will be active and can be used to display HUDs.
The game state In Control is auto activated by the event Unblock Player Control and auto inactivated by the event Block Player Control.
The machine handling player control (e.g. a tick machine) and all interaction machines will only start if the In Control state is active. The game can only be controlled while the player controls aren’t blocked.
Changing by other Game States #
You can add game states that will be changed when a game state is activated and inactivated in the game state’s settings.
Game State Conditions #
The current state of game states can be checked by Game State Conditions.
Checking Conditions #
Game state conditions can check multiple conditions. Either all or only one of the check conditions must be valid for the game state condition to be valid.
A single condition can check:
- Game State
Checks if a single game state is active or inactive. - Conditions
Checks multiple game states, either all or only one of the game state checks must be valid.
This can be used to create complex game state conditions. - Template
Checks a game state condition template.
Example #
A game state condition has 2 conditions, one of them must be valid:
- Condition 1 (Game State)
Checks if the single game state A is active. - Condition 2 (Conditions)
Checks if the game states B and C are active (i.e. all checks must be valid).
Game states A and C are inactive, game state B is active – the whole condition is invalid.
Game state A is active – the whole condition is valid, game states B and C don’t matter.
Game state A is inactive, B and C are active – the whole condition is valid.
Templates #
Usually, you’ll keep checking the same game state conditions very often in a game. To prevent setting up a condition each time you need it, you can create a Game State Condition Template, that can be used by game state conditions.
Game state condition templates are found in System > Game State Condition Templates.

