Switches and variables

Switches

A switch is ON or OFF. This is an important concept for activating a switch, you can change the course of the adventure of the hero. A switch can be activated with a command event.

Events can display or change the page with their switch condition.

Consider an example :

We placed two events on a map :

The chest is not present at the beginning of the game when the hero talks to the character on the left, this one shows the chest.

  1. In the event Character, add command event Switch ON

  2. Select the switch not used in your game

  3. The command is added to the list

  4. Then go to the event Chest.

  5. Click the Conditions and assign the switch used previously.

The chest will appear only if the swicht S-0001 is enabled. Initially, this is not the case, the chest is not present. But speaking in character, it activates the switch showing the chest.

Variables

A variable is a numeric value. Thus, you can test the value in the trigger condition of an event and if it is verified then the event will be executed. A value is assigned to the variable via a command event.

Continuing the example above the chest. This time, the hero must speak 3 times the character to reveal the chest.

  1. In the event Character, add the variable event
  2. Choose the identifier of the variable
  3. Turn the operation Add
  4. In constant, set the value 1
  5. Then go to the event Chest.
  6. Click the Condiitons and assign the variable used previously. The target value is 3

Thus, when the hero talks to the character, the V-0001 variable is incremented by 1. The chest will appear when the variable is 3 or more, ie, when the hero talked 3 times the character.

Detections

When an event emits a detection, it triggers all local switches other events in the detection area.

Consider an example.

On the above image, a character is surrounded by 3 chests. Each chest can be opened with this method the tutorial Create chest, ie, that each chest opens with the local switch A

The character makes a detection of 2 tiles and activate the local switch of events around.

  1. In the event Character, click the command event Detection.
  2. Put 2 in area and AD in self switch to activate

Thus, the 2 chests in the red square from image below will open when the hero talks to the character