Jump to content

Flag: Difference between revisions

1,375 bytes removed ,  10 years ago
no edit summary
>Torchickens
No edit summary
old->Torchickens
No edit summary
 
(5 intermediate revisions by 2 users not shown)
Line 1:
{{wikipedia2|Flag (computing)}}
 
A '''flag''' or '''switch''' is basically any value or set of values that activates an event. For example, a certain flag needs to be checked in Pokémon Emerald to be able to ride the ferry in Slateport City to Birth Island and simply having the AuroraTicket won't work.
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]].
 
Another example of flags in action is how the registered 'seen' and 'own' Pokémon in the Pokédex works. Here, [[binary]] switches are used for a total of 19 'seen' bytes [D30A-D31C] (the bytes are offset by -1 in Yellow) and a total of 19 'own' bytes [D2F7-D309]. Bulbasaur's seen flag is a value of bin:01 in D30A (2^0), while Ivysaur's own flag is bin:10 (2^1) in D2F7.
In the Pokémon games, flags often exist in addresses as simple one-bit (2^1) integers. For example, in [[bp:Pokémon Diamond and Pearl|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 [[bp:Tower Tycoon|Tower Tycoon]].
 
Let's say you have seen only Bulbasaur, Charmander and Squirtle. The hexadecimal value for this would be 2^0 + 2^3 + 2^6 in D30A (note that the powers indicate the bits), which equals 49 in hexadecimal (or 73 in decimal).
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 [[bp:Generation I|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. (name)|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.
 
==See also==
 
#[[Glitch Pokédex flags]]
 
 
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.