• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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
    7
    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?
     
  • 1,805
    Posts
    7
    Years
    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?
     

    Soccersam

    Hilbert is Badass
  • 179
    Posts
    7
    Years
    • Seen Feb 26, 2024
    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.
     

    Soccersam

    Hilbert is Badass
  • 179
    Posts
    7
    Years
    • Seen Feb 26, 2024
    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?
     
  • 1,682
    Posts
    8
    Years
    • Seen yesterday
    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
     

    Soccersam

    Hilbert is Badass
  • 179
    Posts
    7
    Years
    • Seen Feb 26, 2024
    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