Jump to content

Glitch Pokédex flag: Difference between revisions

Cleaned up the introduction, and added information about catching the Pokémon setting the "seen" flag again. The rest of this page needs a cleanup still.
>Torchickens
No edit summary
>Bbbbbbbbba
(Cleaned up the introduction, and added information about catching the Pokémon setting the "seen" flag again. The rest of this page needs a cleanup still.)
 
Line 1:
{{bulbapedia2|Pokédex flags}}
In {{RBY}}, '''Glitchglitch Pokédex flags''' refersare to"seen" theand mechanism"own" ofPokédex howflags for [[glitch Pokémon]] with Pokédex numbers 152-255 and 0. areWhile registeredevery valid Pokémon in the Pokédex,game has their "seen" and "own" flags in termstwo 19-byte flag arrays, glitch Pokémon with invalid Pokédex numbers (with the exception of whetherNo. 152) extrapolate from the Pokémon"own" isflags registeredinto the "seen" orflags, and from the "ownseen"ed flags into bag items. Therefore, setting or checking those flags may have unintuitive results.
 
The most well-known case of glitch Pokédex flags is the "seen" flag of Pokédex number 0 (e.g. [[MissingNo.]], [[GlitchDex/RB:000|'M (00)]]), which is treated as "No. 256" due to how this particular flag array operation is implemented. This flag corresponds to the most significant bit of the quantity of item 6 in the bag, so setting it (by encountering ''or catching'' those Pokémon) will increase the quantity of item 6 by 128 if it is not already greater or equal to 128. This effect is commonly known as '''item duplication'''. It is the most common reason that makes an encounter with MissingNo. or 'M (00) desirable, and it is also the usual way to set up [[item underflow]] for an [[expanded item pack]].
While every valid Pokémon in the game have their own Pokédex flags, glitch Pokémon extrapolate from the structure into inventory items, which is why MissingNo. (No. 000 or 'No. 256') can duplicate the sixth item by 128.
 
ThisNot includesall Pokédexglitch flagsPokémon forhave [[Glitchglitch PokémonPokédex family|families]] 153-255, 0.flags: Glitch Pokémon with Pokédex numbers 1-151, (hybridsi.e. by[[hybrid]]s definition)of dovalid notPokémon, useshare glitchthe Pokédex flags perof se;those valid Pokémon, so encountering andor catching them will just set thethose flagvalid ofPokédex the Pokémon the glitch Pokémon was a hybrid offlags.
 
Depending on the glitch Pokémon's Pokédex number, encountering it or catching it will set a bit which will affect the state of the player's inventory if the relevant flag was previously unset.
 
{{cleanup}}
== Why glitch flags? ==
In computer programming, and games are no exception to this, everything is numbers. Thus, each Pokémon is assigned a number, called its '''ID'''. The game identifies each Pokémon using its ID, and each ID corresponds to a specific Pokémon.
Line 27 ⟶ 26:
The more complicated case is Pokémon with ID 0 (like [[Missingno]] or [[GlitchDex/RB:000|'M (R/B)]]), because upon subtracting 1 (Pokédex ID - 1, remember?), the 0 underflows to 255.
 
== Uses/effectsEffects ==
Setting a flag (whether it be "seen" or "caught") modifies one bit in memory. The most famous example is when seeing Missingno, where it sets bit 7 of the quantity of the 6th item in the player's inventory (which is why it is known as "gives 128 if has less than 128").
 
The other way around is that if a Pokémon is marked as "already caught", its Pokédex entry won't show up. Since some glitch Pokémon's Pokédex entries crash the game, they are required to be "already caught" to be catchable without freezing.
 
===Via capture"seen" flags===
==Corruption effects==
 
===Via encounter flags===
*'''Item duplication''': Involves the game adding to a specific item quantity in the player's inventory. The most infamous example is the [[glitch Pokémon]] [[MissingNo.]] and [[GlitchDex/RB:000|'M (00)]] adding 127 to the sixth item quantity upon encountering it or catching it, if the value is less than 128.
*'''Item mutation''': Involves the game changing an item's ID in the player's inventory. One example is glitch Pokémon [[GlitchDex/RB:241|94 (0xF1)]].
Line 40 ⟶ 37:
*[[Pokémon No. 152]]: Only applies to [[GlitchDexJP/B:204|アノ゙ (CC)]]. Has its own viewable Pokédex entry, even from the Pokédex menu, and without any further glitches.
 
Note that the "seen" flags are set not only when the Pokémon is encountered in battle, but also when the Pokémon is obtained through a normal means, such as by catching, from evolution, or directly given by an NPC.<ref>When catching a Pokémon, [https://github.com/pret/pokered/blob/ab696295b3d029663062238e8033882bb8cd9cff/engine/items/items.asm#L498 LoadEnemyMonData is called again], which has the side effect of [https://github.com/pret/pokered/blob/ab696295b3d029663062238e8033882bb8cd9cff/engine/battle/core.asm#L6337-L6345 setting the "seen" flag again]. The same mechanism is used [https://github.com/pret/pokered/blob/ab696295b3d029663062238e8033882bb8cd9cff/engine/give_pokemon.asm#L18 when directly given a Pokémon by an NPC if it is sent to the box], while the case of adding to the party [https://github.com/pret/pokered/blob/ab696295b3d029663062238e8033882bb8cd9cff/engine/add_mon.asm#L103-L104 is handled by the AddPartyMon function]. </ref> A common trick is to put a single consumable item usable in battle (e.g. an X Special) in the sixth item slot, encounter MissingNo. or 'M (00) to set its quantity to 129, use that item twice so that there are 127 left, then capturing the Pokémon to duplicate the item again, setting the quantity to 255 with a single encounter. (This does not work if the player throws a Poké Ball from the sixth slot while there are 128, because the quantity of Poké Balls is decremented ''after'' the game deals with Pokédex flags.)
===Via capture flags===
 
===Via encounter"own" flags===
*'''Setting Pokémon as seen''': The flag for a glitch Pokémon with ID beyond 151 being 'own'ed will set an unrelated Pokémon as seen. Example: MissingNo. and Cubone.
*'''Pokémon No. 152''' (see above)
 
==References==
{{stub}}
<references />
 
[[Category:Terminology]]
[[Category:Reference documents]]
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.