[DPPT] Fixing the double shiny encounter crash

Learn how to develop your game here
Post Reply
User avatar
Mikelan98
PokePoints: 62 670 
Posts: 5
Joined: Fri Jun 12, 2020 2:04 pm
Has thanked: 5 times
Been thanked: 5 times

[DPPT] Fixing the double shiny encounter crash

Post by Mikelan98 »

In Pokémon Diamond, Pearl and Platinum, if the player manages to encounter two shiny Pokémon at the same time in a double wild battle, the game will crash. This bug seems to be related with the script that handles the shiny effect particles and its timing with the encountered Pokémon animations. In Pokémon HeartGold and SoulSilver, the shiny effect script is slightly different, and it seems to fix the problem (although we cannot test this in a original HeartGold/SoulSilver ROM, since double wild encounters doesn't exist). However, copying the HGSS particle script into DPPT fixes the game crash. To do so, contents of file 11 in DPPT's NARC wazaeffect/we_sub have to be replaced with:

Code: Select all

33 00 00 00 00 00 00 00 1B 00 00 00 16 00 00 00 10 07 00 00 8B FF FF FF 2E 00 00 00 00 00 00 00 00 00 00 00 03 00 00 00 2E 00 00 00 00 00 00 00 01 00 00 00 03 00 00 00 32 00 00 00 35 00 00 00 00 00 00 00 04 00 00 00
These bytes match the contents of file 11 in HGSS' NARC a/0/6/1, excepting a value that serves as the particle file index (since contents in NARCs wazaeffect/effectdata/waza_particle in DPPT and a/0/2/9 in HGSS do not match).

Alternatively, for a quick check that this actually fixes the crash in DPPT, one can search the following byte sequence in the Pokémon Platinum ROM, which corresponds to its shiny effect particle script:

Code: Select all

38 00 00 00 39 00 00 00 00 00 00 00 39 00 00 00 01 00 00 00 39 00 00 00 02 00 00 00 39 00 00 00 03 00 00 00 3A 00 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3A 00 00 00 05 00 00 00 00 00 00 00 01 00 00 00 01 00 00 00 3A 00 00 00 06 00 00 00 00 00 00 00 02 00 00 00 02 00 00 00 3A 00 00 00 07 00 00 00 00 00 00 00 03 00 00 00 03 00 00 00 2D 00 00 00 4E 00 00 00 01 00 00 00 00 00 00 00 33 00 00 00 00 00 00 00 1B 00 00 00 01 00 00 00 3B 00 00 00 3C 00 00 00 00 00 00 00 3C 00 00 00 01 00 00 00 3C 00 00 00 02 00 00 00 3C 00 00 00 03 00 00 00 16 00 00 00 10 07 00 00 8B FF FF FF 2E 00 00 00 00 00 00 00 00 00 00 00 03 00 00 00 2E 00 00 00 00 00 00 00 01 00 00 00 03 00 00 00 32 00 00 00 35 00 00 00 00 00 00 00 04 00 00 00
and paste the byte sequence from above over this byte sequence.

Post Reply