PKSM icon indicating copy to clipboard operation
PKSM copied to clipboard

Edit Pal Park Pokémon

Open ccfman2004 opened this issue 4 years ago • 8 comments

It would be nice to be able to edit Pal Park Pokémon in Gen 4 saves

Describe the solution you'd like To be able to add/import Pokemon in the Pal Park area.

Describe alternatives you've considered There doesn't seem to be a way to edit Pal Park Pokémon in any save editor.

ccfman2004 avatar Aug 24 '20 18:08 ccfman2004

I personally do not have the equipment to perform the research necessary for this. If somebody else wishes to perform that research and tell me the results, I'd likely add that capability to at least the backend, though I'm not certain where in the UI it would fit for the frontend.

piepie62 avatar Aug 24 '20 19:08 piepie62

For anyone considering this, I'd need to know at least three things: the offset at which the transferred Pokémon are stored, whether they are in PK3 or PK4 format (and, as part of that, whether they have party data attached or not), and the location of possibly-present flags that indicate whether Pokémon have been transferred and/or whether they have been caught.

piepie62 avatar Aug 24 '20 19:08 piepie62

Here's conclusions from some research I just did (could only thoroughly research DP, as the tools I used [pokesav] only supported Catching Show editing in DP):

  1. The offset for the location of the six Catching Show pokemon for DP is 0xBA28, where they're all stored next to each other with no space between, and no metadata afaik. I suspect the Pt offset to be 0xC7F0 and the HGSS offset to be 0xB3C0, given the similar proximity to Wonder Card data as in DP and the presence of six blank (encrypted, so non-zero) pokemon data.
  2. They are EK4s and are each 236 bytes long, makes them party pokemon. Again, they are stored directly next to each other with no spacing.
  3. The slots for the six Catching Show pokemon are all blanked at the end and when the save is initialized (six blank EK4s), and besides the usual checksums there is otherwise no difference between a save that has six pokemon ready to go for the Catching Show and a save with no pokemon ready, so there is likely no such transfer/caught flag in at least DP.

SNBeast avatar Aug 25 '20 01:08 SNBeast

For some reason the separate tool for Platinum has the Pal Park Editor grayed out for some reason.

ccfman2004 avatar Aug 25 '20 01:08 ccfman2004

Anyone have idea how i can edit the pal park pls

Focas2003 avatar Oct 11 '20 22:10 Focas2003

@SNBeast thanks for those offsets, it pointed me in the right direction for finding and verifying them

Still wanna do more testing but got a basic script done for viewing: https://github.com/FlagBrew/PKSM-Scripts/commit/4d2222521653ee522153845f4f978c5b87464ddc

FM1337 avatar Apr 04 '24 23:04 FM1337

So injecting via a script may be possible, but as of right now due to either an incorrect approach I've been taking with the scripting or a bug in PKSM-Core ( or a bug with the scripting API), I cannot get injected Pokemon to be encountered.

Did a lot of research and testing, originally I thought that there might've been extra flags out side of Pokemon data needing to be set (despite what SNBeast had indicated), but creating an ek4 from PKHeX, injecting it in via HxD (hex editor) to the offset for PalPark mons and then using PKHeX to correct the save checksum allowed the Pokemon to be encountered.

FM1337 avatar Apr 06 '24 15:04 FM1337

~~Gamefreak stored them as decrypted~~ Nope they're encrypted which means the scripting apis for encryption and decryption are jank/borked

FM1337 avatar Apr 07 '24 19:04 FM1337