• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Dawn, Gloria, Juliana, or Summer - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Scripting Question] [16.2] Mega Evolution Bug

Soccersam

Hilbert is Badass
  • 179
    Posts
    8
    Years
    • Seen Feb 26, 2024
    So I had made some custom mega evolution sprites for in-game use, and had implemented everything accordingly in the scripts, just like I was supposed to. It works fine for the most part too- the sprite shows up correctly, the pokemon mega-evolves successfully. The problem comes afterwards.

    After beating the mega evolved pokemon, it faints, but then, instead of the trainer being defeated, it sends out the same pokemon once more (with its HP in the red zone), this time however, it does not mega evolve and stays in its normal form.
    I tried doing this with the default Leader_Brock event in Cedolan City. I replaced his first pokemon Geodude with Meganium (the pokemon who is supposed to mega-evolve), and kept his second pokemon, shiny Onix, intact. When I battle, he sends out Meganium. It mega-evolves successfully, I defeat it. Next, it sends out Onix. I defeat that too.
    But then, it sends out Meganium once more, this time with very low HP, in the red zone. Even though I very clearly defeated it before.

    What could be the possible causes for this? Has anyone here run into any problems while implementing custom mega evolutions?
     
    So I had made some custom mega evolution sprites for in-game use, and had implemented everything accordingly in the scripts, just like I was supposed to. It works fine for the most part too- the sprite shows up correctly, the pokemon mega-evolves successfully. The problem comes afterwards.

    After beating the mega evolved pokemon, it faints, but then, instead of the trainer being defeated, it sends out the same pokemon once more (with its HP in the red zone), this time however, it does not mega evolve and stays in its normal form.
    I tried doing this with the default Leader_Brock event in Cedolan City. I replaced his first pokemon Geodude with Meganium (the pokemon who is supposed to mega-evolve), and kept his second pokemon, shiny Onix, intact. When I battle, he sends out Meganium. It mega-evolves successfully, I defeat it. Next, it sends out Onix. I defeat that too.
    But then, it sends out Meganium once more, this time with very low HP, in the red zone. Even though I very clearly defeated it before.

    What could be the possible causes for this? Has anyone here run into any problems while implementing custom mega evolutions?

    Does it happen with other megas? Like give brock mega sharpedo and see if that happens?
     
    Does it happen with other megas? Like give brock mega sharpedo and see if that happens?

    No, it works perfectly with other megas. I tried using mega charizard and mega sharpedo. Both of them work perfectly.
     
    ok cool! so it isn't an essentials error!

    care to share your code for mega meganium?

    Thanks for taking the time!

    First, I implemented the mega stone and the pokemon in PokeBattle_Battle, like this-
    [:MEGANIUM,:MEGANIUMITE],

    Then, in PItem_Items, I included the Meganiumite in the pbIsMegaStone? string like this-
    Spoiler:



    And finally, in Pokemon_MegaEvolution, I implemented this code-
    Spoiler:


    Where do you feel the code went wrong?
     
    my guess is the change to the hp base stat.
    the un mega on faint revives it because of the higher base hp.
    would probably need a change to calc stats to keep hp 0 if it was before the base stat change

    Changing the base stats actually worked. Thanks, Vendily! You're as wise as they come ^ ^
     
    Back
    Top