kwsch / PKHeX

Pokémon Save File Editor
https://projectpokemon.org/pkhex/
Other
3.71k stars 698 forks source link

template folder and pk#/pb# files not being properly used as template trainer data for blank savefile #3358

Closed Atrius97 closed 2 years ago

Atrius97 commented 2 years ago

Describe the bug "template" folder and setting default trainer data from pk#/pb# files is not functioning properly, either defaults back to PKHeX default blank save trainer data, or mutates hybrid trainer data from provided file + default blank save trainer data.

Screenshots Examples: PB8 file loaded from template folder via template.pb8 opened via pb8 in template folder

PB8 File opened with PKHeX manually pb8 opened with PKHeX manually

Additional context Was able to reproduce on latest and stable PKHeX, and without plugins.

kwsch commented 2 years ago
  1. Viewing a template does not source an originator-Trainer to convert the IEncounterTemplate=>PKM; it only uses the currently loaded save file's details (with sanity checked mutations for language/etc): https://github.com/kwsch/PKHeX/blob/0cf7b2236324ad3d74bb7f6d1316cb3f405f4da0/PKHeX.WinForms/Subforms/SAV_Encounters.cs#L133-L135

  2. Opening a file or drag/drop will adapt the PKM to the currently loaded save file, to be transparent on what is changed, only if ModifyPKM is true. This is the intended behavior -- gender being different is the reason it sets the HT in one and not the other.

Working as currently intended; there isn't any current feature to have a trainer database loaded whenever the Encounter Database is being viewed. ALM's functions are not the exact same as mainline PKHeX; ALM scrapes the template folder to load its own database for template regeneration.