# waitForEventFlag

<p class="callout info">An eventCall that waits until a trigger is activated, or a "flag" is raised.</p>

## Usage

```
item[0] = {
	eventCall = {
		eventDef = "waitForEventFlag";
		args = {
			num = 4;
			item[0] = {
				eEncounterEventFlags_t = "ENCOUNTER_EVENT_FLAG_USER_EVENT";
			}
			item[1] = {
				string = "User_Flag"; // Flag Name
			}
			item[2] = {
				bool = false; // set to true if looking for flag before the encounter has reached this point
			}
			item[3] = {
				bool = false;
			}
		}
	}
}
```

Flag Triggers can activate when entering a certain section of the map or when [activateTarget](https://wiki.eternalmods.com/books/5-level-modding/page/activatetarget) for the entity is used.  
This is useful if you want to activate Energy Barriers to lock you in an arena, or if you need to enter a section of the arena for the encounter to progress.

[idEncounterTrigger\_RaiseUserFlag](https://wiki.eternalmods.com/books/5-level-modding/page/idencountertrigger-raiseuserflag) is the entity that this eventCall looks for when it is activated.

<p class="callout warning">The Encounter Manager must contain the **idEncounterTrigger\_RaiseUserFlag** entity for it to recognize the flag name.</p>