Hi all, I'm a little stuck trying to programmatically create a shiny egg in a Gen 4 save file. I have a PK4 object that I've initialized (called mew), and to my understanding, an egg will hatch shiny based on its personality value (the PID) lining up with the save file's secret id and trainer id. In doing that, I initialized the pokemon like this but don't know how to set the PID:
// Assume mew is a PK4() object that I've constructed and have set other attrivbutes (species, held item, etc.)
// Set the trainer ID according to the save file
mew.TrainerTID7 = this.currentSave.TrainerTID7;
mew.TrainerSID7 = this.currentSave.TrainerSID7;
uint trainer_id = pokemon.TrainerTID7;
uint secret_id = pokemon.TrainerSID7;
uint pid = ShinyUtil.GetShinyPID(trainer_id, secret_id, 0, 0);
mew.PID = pid;
I see that there is a ShinyUtil class that should help me generate a shiny PID for the egg, but I don't think I'm using the function right. My egg currently doesn't register as a shiny when I check the exported save file in Pkhex. I wonder if I'm maybe not running the right function? It seems strange that I'd have to feed getshinypid a pid when I'm actively trying to get a shiny pid? I also have no idea what the last arg is supposed to take. Some help would be appreciated!