A condition in game programming that causes a variable to change. Event Flags are set off when certain events take place — Boss Battles, Cutscenes, leveling up, One Ups — anything that's important to the plot or to your stats. Flags can also trigger anything, from changing a character's status to activating subquests or side-plots to adjusting what sort of Random Encounters show up.
It's important to note that there need not be any logical connection between the action and the results. Sometimes there is a relationship, as when the completion of one quest makes you eligible for others, but very often the game programmers just decided to enforce the order of events. If the door to the Black Tower is impenetrably sealed, but spontaneously unlocks itself after you give 10 flowers to a completely unrelated NPC on the other side of the world, an Event Flag is the little chunk of computer code that made it happen.
Setting off certain Event Flags is necessary for the computer to know when you've won most games. (In the case of a game with Multiple Endings, which Event Flags are set off will usually decide what ending you getnote .) Sequence Breaking in the wrong places can make the game Unwinnable if a flag that was supposed to be triggered gets stuck in the wrong state.
Event flags are also how a game knows when You Shouldn't Know This Already.
The term is often used for gags in Anime and Japanese games, where Genre Savvy characters talk about needing to set off flags for the plot or relationships to move in a favored direction. More commonly, it is a joke about Tempting Fate, where once a certain event has been set off, something inevitable will follow.note Anybody who talks about what they're going to do after a war, for example, has set a death flag.
- A bug in Castlevania: Portrait of Ruin makes the game Unwinnable this way: Death has some dialogue immediately after you beat him, and at the end of the dialogue, his "boss beaten" event flag is set. However, if you skip the cutscene, the flag never gets set, so re-entering the room seals the doors just as if you had a boss battle, but the boss never appears; you are locked in the room until you reset the game. Worse yet, if you went back out of the room to take advantage of the nearby savepoint, you can't get through the room, which is where the rest of the game is, and the only recourse is to restart the file.
- In one TIE Fighter mission, a different set of enemies would appear depending on the order in which the player destroyed his first two targets.
- Soulcaster and Soulcaster II make heavy use of event flags for controlling traps, ambushes, monster spawns, and other such triggers.
- Batman: Arkham City: If you try and sequence break by blowing up the six Titan containers before visiting Bane, you'll find one of them is missing. Only by talking to Bane is the event flag to make it appear set.
- In Super Metroid, the large crashed ship is supposed to be entered from the west; a boss fight there triggers an event flag which turns the power on. Through heavy-duty Sequence Breaking, it can also be entered from the east, but it will be completely empty until this flag is triggered.
- Lampshaded in Flower, Sun and Rain. In Scenario 4, there's a point when you will probably have already figured out the solution to a puzzle, but aren't actually offered the chance to solve it. You first have to talk to Stephen Charbonie, who, as part of his usual bizarre rant will mention that "digital games also need flags" and that he's going to "trigger a flag for you." From then on, he mentions "flags" every time he allows you to progress further.
- Partway through The Legend of Zelda: The Wind Waker, you're asked to provide a password to get back inside Tetra's pirate ship. However, even if you solve the password riddle perfectly, capital letters and all, the game still won't let you into the ship until you view the correct cutscene where Link overhears the password from two pirates (thus triggering the event flag).
- Opening the portal to Black Castle in An Untitled Story requires the player to talk to the girl on LongBeach. Aside from this, these two things are otherwise mostly unrelated.
- Metroid: Other M gives Samus upgrades merely for being in the right place with the right event flags triggered. Most noticeably, this happens with the Grapple Beam and the Wave Beam.
- In Peasant's Quest, an event flag is triggered by talking to Mendelev at the shooting range. Saying "haldo" to Dongolev before talking to Mendelev will trigger the following response:
Dongolev: "What'd you read that in the PQ Strategy Guide? Go talk to my brother first."
- In the AGD Interactive Fan Remake of King's Quest II: Romancing The Throne, at one point the player is supposed to trade a pearl to an unscrupulous merchant for a mermaid's shell comb. However, you have to talk to the merchant first to find out that he's interested in pearls; offering him the pearl straight out will result in the same "No thanks" message he gives if you offer him anything else in your inventory.
- Averted at one point in Myst. You might expect an event flag preventing you from starting a new game, flipping a couple levers, snagging a book page and toddling off to the library to enter a code and thereby win the entire game in less than two minutes. You would be wrong. The final combination code to beat the game is the same every time. As long as you know what to do, you don't have to solve any other puzzles.
- The scripting system introduced in Hexen allowed for event flags that affect other maps. The important ones are usually obvious by stating that part of a puzzle is solved by pulling a switch, but there's sometimes less visible ones such as crossing two specific lines in a map to raise a set of stairs in the associated hub's level.
- In one level of Medal of Honor: Frontline, you have to blow up several trucks. The last truck doesn't appear until you get the deployment roster. Destroying it collapses a girder, creating a ramp over the otherwise insurmountable wall to the next level.
- Left 4 Dead uses event flags mainly in finales. Until you trigger the button/radio/whatever to start the finale, you are stuck where you are until you start the event. Left 4 Dead 2 has two finales that are triggered by riding an elevator down to the lower floor but sometimes, due to a glitch or lag online, the finale event fails to start, thus the flag is never triggered. However, there's an object that can be "activated" to trigger the finale flag as a failsafe should the first flag fail in triggering.
- One spot in Super Paper Mario can only be passed via deliberate stupidity. If you try to delay doing what will trigger the bad event, the character you are conversing with will eventually bring up event flags.
- In Prince of Persia, one might expect that picking up the sword in the first level is an event flag (because you can't very well enter a sword fight without it). Turns out that it's not; through trickery, you can enter the second level even without the sword, at which point you'll magically be able to swordfight anyway.
- One walkthrough, purporting to be a translation of the ancient tale of the protagonist, Hand Waves this by explaining that the story splits into two different versions at this place, and speculating that the Prince might have (in the quick version) found the sword on the stairs.
- One point in Cave Story has a pretty transparent event flag—there's only critters and bats outside when you first enter Grasstown, but once you've talked to Chaco and she mentions you need to kill a Giant Jelly, the entire place is now magically filled with flying Jellyfish (including several visible from her doorstep).
- And, of course, it takes an Event Flag to trigger this Event Flag. You need to have gotten the Fireball from Santa first or she asks if you met Santa yet.
- Also in the Core Chamber: Curly notices something interesting and wants you to come look at it, and the cutscene leading directly to the Boss Fight is triggered when you go talk to her. It's significant because if you don't collect a hidden item in that room before triggering this event flag, you forfeit your chance at getting the good ending.
- Dr. Booster in the Labyrinth as well. If you talk to him after he falls into a pit, he dies, and the hidden item in the Core Chamber doesn't appear. If you instead leap over the pit, he gets better later on.
- The first Rayman game plays with the concept a little. First of all, event flags only affect the level in which you are. Secondly, the event that sets the flag is just getting into some area; this may mean anything from collecting a powerup through walking a platform up to leap of faith. Moreover, the effects of flag being set are sometimes visible immediately - the game is not above spawning enemies just behind you, and edutainment spinoffs spawn killing obstacles directly into you when you select a wrong answer - but sometimes the only thing you get to know is that you set a flag, due to a distinctive sound - that is, if you play with sound.
- An infamous bug is found in Ultima VII Part II, Serpent Isle. In a haunted house near a lighthouse you visit early in the game, speaking to certain ghosts shows you dialogue from much, much later in the game. This information is useless at that point and doesn't really make sense yet, but more importantly that conversation sets a few event flags that may cause future areas to become impassable.
- Rune Factory 2 has only a very few of these. Those it lacks often lead to rather humorous conversations where villagers ask what you think about their Love Interest after you've married her. And you still respond with "i dunno lol".
- Rune Factory 4 continues this spartan tradition by having NPCs greet you in a way that acknowledges you are in a relationship and/or expecting a child, then following it up with, "...so have you found anyone special yet?" A few other wallbangers include Dylas asking Frey if she will be his friend when she's his wife and the mother of his child, characters commenting that you're dating Dylas if you trigger the "Smiling Practice" event after tying the knot with another bachelor, and Leon continuing to refer to Frey as his girlfriend even after putting a ring on her finger.
- The Elder Scrolls IV: Oblivion is just about run by event flags, ranging from new enemies suddenly appearing based on your level and/or reaching a certain point in a quest all the way to keeping track of what every NPC is supposed to be doing at any given time of in-game day. However, some of these event flags are notoriously prone to glitching, sometimes with disastrous results.
- Fallout 3 upgraded that engine with a more sophisticated AI system, allowing for more flexible scheduling, conditionals and parameters. There's now quadruple redundancy possible, with event flags set by triggers, spell effects, dialog or AI. A dialog can set an AI flag, which will execute and set a Global variable, which will be checked when a door or object is triggered or a spell times out...and many other possible permutations and chained event flags. Unfortunately, this inconsistency makes it easier to break and harder to debug the chain, which a study of the game in the Construction Set shows many designers have done...
- Fallout 4 has such a sequence trigger only after you progress a certain point in the main quest. Entering Fort Hagen before you track down Kellogg with Dogmeat and Valentine will see the elevator that normally gets you down to the lower levels of the fort blocked by impassible boards.
- Skies of Arcadia has event flags. This presents a problem if you use a cheat to find all discoveries before going to the ice continent, as the discovery of a city on the continent is an event flag - you cannot progress in the game and have to start over.
- Phantasy Star relies heavily on event flags, to the point where you won't be able to access a chest that should be in plain sight until a person tells the characters about it.
- EarthBound uses event flags to an insane level. Random people you have to talk to to trigger events miles away, state changes that are never obvious...there are so many Guide Dang It! event flags in the game, Nintendo decided to include a guide with the game. Thankfully, the sequel improves massively.
- Albion's Beloveno Arc depends entirely on event flags, that are set off when talking to certain people in a certain order, a certain amount of times. For example, while collecting information on a plot to assassinate the council president, the player will be prompted to talk to a certain NPC once he discussed the issue with two particular individuals. Talking to the NPC in question, will trigger the assassination. If the president was warned before that happens, the attempt will be thwarted and the player will be rewarded for their service. Othervise, he will be killed.
- In Septerra Core, Maya's father won't know that Tori is in Outlaw Canyon until you ask Azziz the same question (he answers "I don't know, ask your father.") Lo and behold, Tori shows up in Outlaw Canyon instantly after talking to Maya's father.
- In Terraria boss fights and some other events happen using these flags. Examples include:
- Breaking a shadow orb may trigger (possibly with a delay) a landing meteorite or a goblin army, and breaking three shadow orbs summons an Eater of Worlds.
- You have to reach a certain amount of max HP before blood moons start to appear. Max HP also triggers some boss and NPC appearances.
- Gen V of Pokémon makes use of these in an attempt to prevent cheating. It's why using a Game Shark for things like a Liberty Pass to get Victini will give you the item, but you can't use it. You have to trigger the Wondercard first. Getting the item from Wi-Fi or the Entrelink triggers the Wondercard which will allow the associated event to occur. The Event Flags exist in all the games, but sharking is easier in earlier gens because just getting the item triggers the flag. There's no Wondercard to trigger when getting the item.
- In Yu-Gi-Oh! Monster Capsule GB, these crop up in-story in the various RPG worlds, signified by a chime.
- Justified in Paper Mario: The Thousand-Year Door when you have to learn Doopliss's name, which serves as his weakness. Unfortunately for anyone who already knows the name, you also need the letter P from his hideout to use in the name entry screen to fill it out properly.
- Undertale has a few interesting ones:
- There's one that causes the reflections in Waterfall's puddles to show the Fallen Child instead of Frisk. There was a rumor that this would happen after completing the Kill 'em All route and selling your SOUL, but in reality, the flag is Dummied Out and can only be activated through Debug Mode.
- The last flag that can lock you out of the Pacifist Run Golden Ending occurs slightly before the flag that disables the last remaining Random Encounters. This means that, if you time it right, you can engage in a bit of Script Breaking and get the "pacifist" ending after killing monsters in the CORE, or even wiping them out entirely.
- Nocturne: Rebirth has an interesting one after beating the Wind Guardian. After beating the boss, the next three dungeons become available at the same time. However, the story will progress each time you either complete the first half of a dungeon or defeat a boss. This can lead to a strange situation where the player can complete the first halves of two different dungeons, which will cause them to fight Idith and the Maxwell trio bosses before they fully complete any of the dungeons.
- Dragon Age: Inquisition has an unusual one in the form of Cullen's romance. While other characters with whom the Inquisitor may choose to have a relationship can be romanced fairly quickly, a romance with Cullen is tied to the actual plot. Any Inquisitor can flirt with him in Haven, although if they're not a female human or elf, that's as far as it will go. After the Inquisition moves to Skyhold, the romance can continue but is forced to move slowly by the events of the plot; completing major events and quests will trigger the event flags to allow the relationship to continue growing.
- Area 7 of RefleX features ZODIAC Virgo trapping the Phoenix and firing upon it until it's destroyed, causing the Phoenix to transform into ZODIAC Ophiuchus. However, this only happens if you let the Phoenix's shield meter run out first in a last-ditch defense attempt; those who have advance knowledge of the cutscene may be tempted to just not shield at all, only to learn the hard way that not having an empty shield meter when the Phoenix is destroyed results in a Game Over.
- Several of the Total War series games (notably Rome) have their historical progression events driven by the actions of one faction - eliminate that faction and history stands still for everyone else. This is often a lot more noticeable in realism mods like Europa Barborum, if only because a lot more happens on the back of the event flags.
- Omerta: City of Gangsters uses event flags to Level Up your gangsters. Usually, these happen after a significant battle between your gang and the enemy you're fighting. The stages of the game tell you beforehand if a Level Up event flag is coming.
- Friday the 13th: The Game has one in reference to one of the ones from most of the movies. Namely, Jason cannot be killed without first being subjected to a Dramatic Unmask (accomplished by hitting him enough times with certain weapons). In the films, Jason's face being revealed was one of these that happened at some point in the climax with a few exceptions.
- The whole premise behind the anime/manga The World God Only Knows is based on setting flags. The main character, Keima, is a hardcore Dating Sim otaku so interactions with other characters, mundane everyday tasks and random events all end up being flags.
- A running joke in Hikonin Sentai Akibaranger, a Super Sentai parody. Not only is it mentioned in the Theme Song, but Akiba Red remarks e.g. in the first episode that every time an enemy commander leaves saying something like "I leave it to you", this is a flag for the heroes to defeat the Monster of the Week. Sure enough, the Rangers suddenly start winning. However, the show also likes to play with the rules of sentai. When they expect the archvillain to embiggen the monster after its first apparent destruction, it doesn't. The monster is really dead. The team complains about that, just because it's not how it's supposed to go.
- Near the end of the first series, the heroes are trying to avoid triggering event flags for the series to end but Executive Meddling is trying to thwart them. The final enemy begins spitting out death flags left and right as the team panics and tries to stop him. "Before you die, I'll tell you this!" *Rangers panic* "My new armor is all-powerful!" *Rangers panic more* "And after I kill you, I'm going to go see my fiancee!" *Rangers go into full-on Oh, Crap! mode*
- In the second series, Malshina takes over the Super Sentai franchise and makes a Villain World. Red realizes he has to act Genre Blind because death flags are now victory flags! When they were losing to a monster, loudly talks about what he's going to do after the battle as everyone panics and tells him he's dooming himself, and finally his attack gets through. Eventually the whole team dies from Hakase accidentally setting off a death flag for them to make a Heroic Sacrifice, complete with a flag popping up on screen.
- In Seitokai Yakuindomo, Takatoshi's extreme case of Oblivious to Love toward his Unwanted Harem has led him to be called the "Flag Crusher" by Uomi. It was quickly appropriated by the fandom.
- In Daily Life with Monster Girl, when Kimihito tries to prove he isn't going to die, he starts spouting off Death Flags ranging from the oldest ones in the book to Shout Outs. This is lampshaded by Miia, who urges him to stop saying Death Flags for fear of Tempting Fate.
- In Kamen Rider Fourze's Movie, Shun pulls a Go Through Me moment for the rest of the heroes, which JK outright labels an almost assured death flag. Shun responds that he can't die until he gets back to Earth and has one last date with Miu; JK quietly mutters "He just keeps raising that flag..."
- Referenced in the Beach Episode of Haiyore! Nyarko-san, where Mahiro tries to cheer Cuko up following the depressing events of the previous episodenote . Cuko thanks him, but says that he's wasting his time if he thinks he can raise any romance flags with her; Mahiro responds "Don't worry, if any flags like that pop up I'll tear them down myself."
- Souta Hatate from If Her Flag Breaks has the ability to see flags over most people's heads, and alter them to change their fate, such as replacing a death flag with a romance one to keep Akane from dying after she falls through a second story floor in an old apartment complex he was using.
- Sakura Kokoro of No Matter What Happens, I Still Won't Become An Anime Character fame has to try her best to avoid these flags, lest she fall into a plot causing a gameover.