# Flags edition

The flags can be seen as indicators of a specific property. The meaning of this property is given by the name of the flag. If it is active, the property is fulfilled. The flags allow to give a sense of narrative to <e-Adventure> games. The way to give this sense of narration lies in the use of flags (including variables) within the conditions, when we check if the flags are either activated or deactivated.

For example, we define a flag called "phoneAnswered. We associate a condition to examine the action of an object "telephone" in which the flag should be enabled so that they will launch the effects associated with the action. If we intend to examine something when the flag "telephone" is on, there will be the effects associated with the action, and if not nothing happens.

## A simple condition

Suppose we have a game with two objects: a steak meat and fish. The idea is that the player can only catch the fish when the meat has been caught previously. In our adventure we translate this condition to "the language of flags", therefore we define a flag "meatTaken", which is inactive until the meat is caught. At that time the flag will be active, and therefore the fish will be available to the player. Consider the process:

1. First we need to add a new flag. For this purpose we will look on the Chapter menu, which can be found on the top bar. There, select the option "Edit flags of the Chapter" (abbreviated ctrl. + F). Then you will see a window like the one shown in Figure below. Click on the "Add flag" and type "meatTaken". Click OK and create a new flag with 0 referrals.
2. You can use this dialog to add or delete flags (and variables) of the chapter (the flags are unique to each chapter.) However, if you want to remove a flag, it must first have 0 references (speak with references to flags of those elements of the game using this flag, either in a condition or an effect). We also have to take into account some restrictions to define flags: no spaces are allowed and the first character must be a letter.
3. Once the flag has been created, you can make references to it. Then we can go to our object "Fish" and add a new "Take" action.
4. Expand the node for the object > Right click on "Actions" > Add "take" action. After that, click on the "Edit conditions" in the action panel. This opens a dialog to edit the conditions.
5. Press the "Add condition" and you will be asked which flag will form the condition, and in which state should be to assess the condition as true (active or inactive). In our case we selected "active" flag and "meatTaken".
6. Note that the drop-down list where you select the flag is editable. Thanks to this, we can just write there the name of the flag. If this does not yet exist, is created automatically, thus avoiding to open the chapter menu so often.