You are not logged in.
Update: I got everything to work! See my comment for details.
I edited the battle engine core so that when a pokemon faints early, the turn continues, like in newer generations. For example, if the pokemon who went first faints from recoil, the opposing pokemon still gets to use a move. I also edited the game so that residual damage ocurrs at the end of the turn.
I was able to get both of these working but there was a bug where the residual damage occurs after the next pokemon has switched in. This is incorrect. Residual damage is supposed to happen before the switch.
I attempted to fix this by putting all of the switching code after the residual damage code. It mostly works fine. The enemy switches in and they do their animation but then the enemy just disappears. Their HUD is there, but there is no sprite.
When they attack next turn or when I attack them, their sprite appears and everything is normal. It is only when they switch in after fainting that you cannot see their sprite.
I know this is not an easy thing to address since I've changed so much code but can anyone at least tell me how the sprites appear? What memory and calls are involved? Could it be an issue with coordinates since the faint animation drops the pokemon below before the opponent switches in?
Any feedback would be appreciated. I think this is the feature I've spent the most time on and I can't continue until it works.
Last edited by binomnpx (2020-05-27 02:22:36)
I reverted back to where I had that first bug but this time instead of moving the switching code after the between turn effects code, I moved the between turn effects code before the switching code. It is a little awkward but it works. I also discovered that the routine LoadTileMapToTempTileMap needs to be called almost right before the DoTurn loop goes back to the beginning. This had something to do with why the sprite was disappearing. I still don't fully understand why the sprite was disappearing but either way, I am just glad that everything works and I can move on.
If anyone wants tips for updating the battle engine to handle between turn effects and fainting early like the newer generations, comment here or message me. I would be more than happy to help.