LegoFigure11 / RaidCrawler

Raid Viewer for Pokémon Scarlet and Violet
GNU General Public License v3.0
166 stars 58 forks source link

Story Progress Level Inaccurate for Three Gym Clears #81

Closed PhoenixRising26 closed 1 year ago

PhoenixRising26 commented 1 year ago

When connecting RaidCrawler to my baby accounts with three gym clears, it sets the 'Story Progress Level' automatically to '1'.

Based on the raids shown in-game, the 'Story Progress Level' setting should be set to '2' to display the accurate Pokémon in the dens.

architdate commented 1 year ago

Did you save and reload after clearing the gyms? I suspect it's reading older ram data. It should not be detecting incorrectly otherwise

PhoenixRising26 commented 1 year ago

I did. It's actually been some time since I cleared the third gym. I even reset the entire switch and went back into the game, updated the news in the portal, etc. The Pokemon showing on the dens all matched the Pokemon in the Story Level 2 setting, not the Story Level 1 setting.

Other people in SHA have reported the same thing at 3 gym clears.

If screenshots are needed, I can probably gather them within the next day or two for proof.

architdate commented 1 year ago

The logic for detecting story progress is based on @Lincoln-LM 's logic. I wonder if they have run into a similar issue as well. I'll check it out myself too

PhoenixRising26 commented 1 year ago

Let me know if you need the screenshots or anything else!

Lincoln-LM commented 1 year ago

The logic for detecting story progress is based on @Lincoln-LM 's logic. I wonder if they have run into a similar issue as well. I'll check it out myself too

my logic checks the exact flags the game does, anyone encountering this error should dump the story progress flags via pkhex to compare.

PhoenixRising26 commented 1 year ago

There's a few of us having the issue. I would like to help, but I'm not sure how to do that.

Lincoln-LM commented 1 year ago

There's a few of us having the issue. I would like to help, but I'm not sure how to do that.

Dump your save via Checkpoint or JKSV, open it in PKHex on your PC, select the "Block Data" button in the "SAV" tab, in the "Block Key:" input, enter *Bool KUnlockedRaidDifficulty3 exactly and log whether or not it says Bool1 or Bool2. Repeat this last step replacing the 3 in *Bool KUnlockedRaidDifficulty3 with 4, 5, and 6.

Lincoln-LM commented 1 year ago

@architdate https://github.com/LegoFigure11/RaidCrawler/blob/985e76045707f4ff49e66d9037fac593d9970642/MainWindow.cs#L201 this loop will only check the flags for 6, then 5, then 4, returning the value 4 for 6 being unlocked, 3 for 5 being unlocked and 2 for 4 being unlocked, defaulting to 0 if none of them are valid (notably does not check flag 3)

KUnlockedRaidDifficulty6 == Bool2 -> 4 -> "Story Progress Level: 5" else KUnlockedRaidDifficulty5 == Bool2 -> 3 -> "Story Progress Level: 4" else KUnlockedRaidDifficulty4 == Bool2 -> 2 -> "Story Progress Level: 3" else -> 0 -> "Story Progress Level: 1"

Your loop is never checking the KUnlockedRaidDifficulty3 == Bool2 condition and therefore will never set "Story Progress Level: 2", defaulting to "Story Progress Level: 1".

tl;dr for (int i = DifficultyFlags.Length - 1; i > 0 && progress == 0; i--) -> for (int i = DifficultyFlags.Length - 1; i >= 0 && progress == 0; i--)

LegoFigure11 commented 1 year ago

Just tested on my 5 badge save that was read incorrectly before, thanks linc!

PhoenixRising26 commented 1 year ago

Thank you all for looking into this!