jojobear13 / shinpokered

Mostly-vanilla hack of Pokémon Red/Blue focused on bugfixes and trainer ai
209 stars 42 forks source link

Seafoam island trainer bugs out and is going nuts #253

Closed DiabloStorm closed 12 months ago

DiabloStorm commented 1 year ago

I have no idea how, but this trainer is bugged out, doesn't approach you to battle, but when you talk to them they are primed to fight as if you are encountering them for the first time.

I beat them as normal, then the game plays random sounds...i speed up to get through it...glitch text box, battle repeats...i win again and then this: image

It's this guy: image

I've encountered them before but I recall forfeiting because I wasn't intending to battle them, decided I didn't actually want the money loss and reloaded the save, but that's been it. Or...I possibly just undid the money loss through cheating because I forgot to save, I don't particularly remember. In which case forfeiting bugged him out somehow. When I encountered them previously, they did swim up to me, they don't anymore, however.

Here, have fun. I'm at the guy. Shin Pokemon Red.zip Looks like the game goes nuts when you try forfeiting the first battle, too.

Unrelated: I spent a lot of time rerolling for DVs because I think the M.Gene/Punnett Square made things too trivial so didn't use it much besides the 100 chansey and m.gene mewtwo # 2 (though, probably necessary given the AI's DVs and people not wanting to invest this sort of time) I'll probably roll through the gyms and E4 on NG+ but then i'm probably done.

Also: Mist stone turned me (surfing sprite) into a pokeball sprite for a second when I used it on the spot right after defeating missingno?

Some other weirdness I noticed earlier in my playthrough: at one point on rt 8 when I went to use cut with bulbasaur I noticed it also had fly as a temp field move as well. Maybe even prior to this, while in PkHex I saw strange pokemon with repeating moves (not gen 1 moves) occupying boxes I had deliberately left empty. I maybe legitimately had a couple dozen pokemon at the time, never saw this happen again even though I've been checking to make sure so I don't keep them on my save file. Maybe it was trash data that confused PkHex? I have no clue how either of these things happened, or if they're related. Though, I do wonder how the hack manages to have multiple bags and things like PkHex won't screw anything up with the save...since PkHex looks in bags but was never designed to anticipate more than one, so I'm not sure how that works. PkHex saving to the save file also doesn't disturb the extra bag items either, I woulda thought they'd be deleted or something but nope.

jojobear13 commented 1 year ago

Looks like a scripting error. The map is running the wrong script over and over instead of resetting to script pointer 0.

jojobear13 commented 1 year ago

Fixed in 777655b7561f82cf6a471ded8ba5efd38c74e8e2

DiabloStorm commented 1 year ago

So, what happened here? I've only seen this behavior from a trainer after something like an escape glitch, but this occurred due to forfeit?

Just making sure you're certain you fixed the underlying problem.

I encountered this guy previously, maybe hours and hours before the save I included, forfeited, and the save is at the 2nd encounter where he no longer approaches to battle and then the bugs ensue.

jojobear13 commented 1 year ago

It's the missingno encounters. I call them as scripted trainer battles (like gym leaders) instead of as wild encounters or eyes-meet-battle trainers. Doing this requires a special flag to be set so that the current map script pointer can update properly with each subsequent overworld refresh. I failed to take than into account, so the map was consistently stuck on script pointer 3 after beating missingno instead of updating back to script pointer 0 (which from there it updates again and starts checking if trainers can see you and loads them.)

DiabloStorm commented 1 year ago

Huh, good job. I probably was doing missingno just prior to finding this.