kwsch / PKHeX

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

[SV] [Batch Editor] $rand not working for TrainerSID7 and TrainerTID7 properties #4177

Closed yor-so closed 8 months ago

yor-so commented 8 months ago

Describe the bug Using a Scarlet save, I'm trying to randomize the PID and SID for all my mons in a box. I only have a box with gen 9 mons, all other boxes are empty. Batch editing TrainerSID7 and TrainerTID7 using $rand is not working. It displays the messages that files were modified, but when I check the PIDs and SIDs for each pokemon, they are the same. If I use specific numbers instead of $rand, it works.

To Reproduce -Open batch editor. -Add the following script batch:

.TrainerSID7=$rand
.TrainerTID7=$rand

-Click run. -The message "Modified n/n files." displays. -After checking each pokemon in the box, the PID and SID are unmodified.

Expected behavior PID and SID should be randomized.

Screenshots None.

Additional context Using latest version of PKHeX (2024.01.12).

kwsch commented 8 months ago

$rand is only relevant for things like PID and EC. Use the random range syntax for everything else.

yor-so commented 8 months ago

Then this should display a warning or a "0/n modified" message. Current implementation makes users to expected certain behavior to happen, or a bug is happening. This should be an enhancement.