• Hi, Guest!
    Some images might be missing as we move away from using embedded images, sorry for the mess!
    From now on, you'll be required to use a third party to host images. You can learn how to add images here, and if your thread is missing images you can request them here.
    Do not use Discord to host any images you post, these links expire quickly!
Vendily's Evolve During Battle

v20.1 Vendily's Evolve During Battle N/A

This resource pertains to version 20.1 of Pokémon Essentials.
Pokémon Essentials Version
v20.1 ➖
This is just an update of Vendily's script for current Essentials! (with permission!) If a Pokémon meets the conditions for evolution during battle, they'll evolve right after levelling up instead of after the battle!

In Battle_ExpAndMoveLearning, find this line:

Ruby:
      moveList.each { |m| pbLearnMove(idxParty,m[1]) if m[0]==curLevel }

Right after that (NOT after the ends!), paste this:

Ruby:
          newspecies=pkmn.check_evolution_on_level_up
          old_item=pkmn.item
          if newspecies
            pbFadeOutInWithMusic(99999){
            evo=PokemonEvolutionScene.new
            evo.pbStartScreen(pkmn,newspecies)
            evo.pbEvolution
            evo.pbEndScreen
            if battler
              @scene.pbChangePokemon(@battlers[battler.index],@battlers[battler.index].pokemon)
              battler.name=pkmn.name
            end
          }
          if battler
            pkmn.moves.each_with_index do |m,i|
              battler.moves[i] = Battle::Move.from_pokemon_move(self,m)
            end
            battler.pbCheckFormOnMovesetChange
            if pkmn.item!=old_item
              battler.item=pkmn.item
              battler.setInitialItem(pkmn.item)
              battler.setRecycleItem(pkmn.item)
            end
          end
        end

For versions prior to v20, change this line -
Ruby:
              battler.moves[i] = Battle::Move.from_pokemon_move(self,m)
to
Ruby:
              battler.moves[i] = PokeBattle_Move.from_pokemon_move(self,m)

If you're using v19, remember that v19 had a bug during evolution- make sure you've either downloaded the hotfixes or are working with a newer version.

If you're on v18/v18.1, then you'll need to change the first two lines from:

Ruby:
      newspecies=pkmn.check_evolution_on_level_up
          if newspecies

to:

Ruby:
      newspecies=pbCheckEvolution(pkmn)#edit
          if newspecies>0

Finally, to fix a map's BGM not resuming after battle, go to PokeBattle_Scene and find this section:

Ruby:
  def pbEndBattle(_result)
    @abortable = false
    pbShowWindow(BLANK)
    # Fade out all sprites
    pbBGMFade(1.0)
    pbFadeOutAndHide(@sprites)
    pbDisposeSprites
  end

Add $game_map.autoplay in, like so-
Ruby:
  def pbEndBattle(_result)
    @abortable = false
    pbShowWindow(BLANK)
    # Fade out all sprites
    pbBGMFade(1.0)
    pbFadeOutAndHide(@sprites)
    pbDisposeSprites
    $game_map.autoplay
  end
Credits
Credit goes to Vendily! You can credit me if you want, but I literally just updated the method so it was not a lot of work lol
Author
TechSkylander1518
Views
6,643
First release
Last update
Rating
5.00 star(s) 3 ratings

More resources from TechSkylander1518

Latest updates

  1. v20 Update

    Quick v20 update! Literally just changing one line lol, this is mostly just to let people know...
  2. Item Bug Fix

    Bug fix courtesy of Vendily! Recycles the held item if it's used in evolution!
  3. Quick bug fix

    Moves learned after evolving should now be updated in battle!

Latest reviews

Really neat script, gives a whole new level of immersion and strategies to battles. Very easy to implement as well.
Very nice, really gives a different feel to Pokemon games
Back
Top