Flag

From Glitch City Wiki
Revision as of 04:49, 28 July 2010 by >Blahpy
Jump to navigation Jump to search
Wikipedia also has an article about Flag.

A flag, also referred to as a switch, is any value for an address or multiple addresses which has an associated meaning such that it will trigger one of a limited possibility of events depending on its identifier.

In the Pokémon games, flags often exist in addresses as simple one-bit (2^1) integers. For example, in Pokémon Diamond and Pearl, in the downstairs area of a Pokémon Center a value of 0 in a single byte denotes that the player has not received the Pal Pad yet, whilst a value of 1 denotes that the player has, so after the flag is checked to a value of 1 the associated event with a value of 0 (i.e. the assistant walking out and giving the player a Pal Pad) will not occur. Oversights by the game developers regarding an event which has not set a flag required to start another intended event are often one of the main causes of glitches, for example the Tower Tycoon event skip glitch in Pokémon Diamond and Pearl is caused by choosing the 21st Battle Tower match by choosing to rest and then selecting the option 'NO', which would start a battle without setting the flag making another trainer appear instead of the Tower Tycoon. Activating certain is also known to change the layout of the tweaking.

On rarer occasions, values for address may trigger more than two unique addresses, for example at least up to the second generation of main series hand-held Pokémon games, an address would manage any specific valid Pokémon's Pokédex entry in order to denote whether it was not seen, has been seen or whether it has been captured by the player. A value of 0-127 would denote that the Pokémon has not been seen yet, a value of 128-254 would denote that the Pokémon has been seen (adds name and page to the Pokédex) and a value of 255 would denote a Pokémon that was captured by the player (adds Pokéball icon and entry data). In Generation I, by encountering or capturing a glitch Pokémon this would add the relevant value (unless it resulted in a value which would for example, equal that of another flag) to an incorrect, or invalid address. Encountering any variation of MISSINGNO. for example would write the value to the address associated with the item quantity of the sixth item in the player's item pack.