Hi there. I've been wracking my brain with this weird bug all day and I can't for the life of me figure out what could be causing it. I'm still fairly new to decomp hacking so maybe this is a common thing I just don't know how to solve yet, but this feels like a pretty obscure bug so I'm hoping to get some help with it.
Basically, I've discovered an issue where entering Mauville City seems to trigger something that breaks everything else in the game. Upon entering Mauville - either by flying there or walking to it normally - the game suddenly has a chance to blackscreen whenever you take a warp event from that point on, until you reset the emulator. For example, if you fly to Mauville and then try entering the Game Corner, there's a chance the game will just blackscreen. This happens with buildings in other maps as well; as long as the player has entered Mauville at least once during that play session, there's a chance any warp into a building anywhere in the world will result in a black screen. I've tested this pretty thoroughly and entering Mauville is the only way I can get the bug to happen consistently - for example, if I fly to Mauville, and then try to enter the Pokemon Center in Oldale Town, the game can just crash and I have to restart the emulator. Again, these crashes don't happen if I haven't been to Mauville during that play session (no other map seems to trigger these problems, either).
A bit about the project - I am using the battle engine, Pokemon expansion, and item expansion, and I have incorporated several modifications from the Simple Modifications forum, as well as making some of my own new scripts. I have made some small edits to the scripts in Mauville, but I tried building with the original scripts and that didn't solve the issue. Interestingly, it also only seems to happen when entering buildings and not exiting them - if I do manage to enter a building without crashing, I can leave just fine every time. It's only upon entering that I've experienced this problem.
Hope I explained that okay, I'm at my wits end trying to fix it, haha. I'm mostly wondering if anyone has experienced something like this before, and if so, how you've managed to overcome it.
Basically, I've discovered an issue where entering Mauville City seems to trigger something that breaks everything else in the game. Upon entering Mauville - either by flying there or walking to it normally - the game suddenly has a chance to blackscreen whenever you take a warp event from that point on, until you reset the emulator. For example, if you fly to Mauville and then try entering the Game Corner, there's a chance the game will just blackscreen. This happens with buildings in other maps as well; as long as the player has entered Mauville at least once during that play session, there's a chance any warp into a building anywhere in the world will result in a black screen. I've tested this pretty thoroughly and entering Mauville is the only way I can get the bug to happen consistently - for example, if I fly to Mauville, and then try to enter the Pokemon Center in Oldale Town, the game can just crash and I have to restart the emulator. Again, these crashes don't happen if I haven't been to Mauville during that play session (no other map seems to trigger these problems, either).
A bit about the project - I am using the battle engine, Pokemon expansion, and item expansion, and I have incorporated several modifications from the Simple Modifications forum, as well as making some of my own new scripts. I have made some small edits to the scripts in Mauville, but I tried building with the original scripts and that didn't solve the issue. Interestingly, it also only seems to happen when entering buildings and not exiting them - if I do manage to enter a building without crashing, I can leave just fine every time. It's only upon entering that I've experienced this problem.
Hope I explained that okay, I'm at my wits end trying to fix it, haha. I'm mostly wondering if anyone has experienced something like this before, and if so, how you've managed to overcome it.