• 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.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Trading Card Game 2 protagonist in the poll by clicking here.
  • 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.

Evo During Battle

Zeak6464

Zeak #3205 - Discord
  • 1,101
    Posts
    12
    Years
    [PokeCommunity.com] Evo During Battle

    Place on Line 2050, PokeBattle_Battle, end of def pbGainExpOne or find "# Finding all moves learned at this level" after the 2nd end

    Make sure to put this code outside of a method.
    Code:
    def name=(value)
        @name=value
      end
    Code:
             [B]# Finding all moves learned at this level[/B]
              movelist=thispoke.getMoveList
              for k in movelist
                if k[0]==thispoke.level   # Learned a new move
                  pbLearnMove(index,k[1])
                end
              end
    [B]#Evo During Battle[/B]
    newspecies=pbCheckEvolution(thispoke)#edit
              if newspecies>0
                pbFadeOutInWithMusic(99999){
                evo=PokemonEvolutionScene.new
                evo.pbStartScreen(thispoke,newspecies)
                evo.pbEvolution
                evo.pbEndScreen
                if battler
                  @scene.pbChangePokemon(@battlers[battler.index],@battlers[battler.index].pokemon)
                  battler.name=thispoke.name
                end
              }
              end

    Credit:
    Vendily
     
    Last edited:
    Did you also add the bit for the def name=?
    Code:
    class PokeBattle_Battler
      def name=(value)
        @name=value
      end
    end
    put this outside of any class or method. OR put just this:
    Code:
      def name=(value)
        @name=value
      end
    in script section PokeBattle_Battler inside the class (preferably underneath def name, but that's just for organization)

    I would have liked to see the error though, as that's the only error I got while making it.
     
    Well I'll be... It worked! Sorry about that.

    The OP should be edited so other people can know that the code that can be put in PokeBattle_Battler works too. If you would still like to see the error anyway, I can edit this post so you can get a better idea of what people should be doing
     
    WOOOOOOW very nice, I'will install NOW!!
     
    I am getting this error for this script:
    Exception: NoMethodError
    Message: undefined method `addUserAnimation' for nil:NilClass
    Follower:304:in `refresh_sprite'
    Follower:303:in `each'
    Follower:303:in `refresh_sprite'
    Pokemon_Evolution:782:in `follow_pbEndScreen'
    Follower:1517:in `pbEndScreen'
    PokeBattle_Battle:2133:in `pbGainExpOne'
    PokeBattle_Battle:2129:in `pbFadeOutInWithMusic'
    PSystem_Utilities:884:in `pbFadeOutIn'
    PSystem_Utilities:884:in `pbFadeOutInWithMusic'
    PokeBattle_Battle:2129:in `pbGainExpOne'
    How can I solve this? Thanks!
     
    I am getting this error for this script:

    How can I solve this? Thanks!

    Are you sure that this script is the cause of the error?
    Your error refers to a nil value, specifically of the $scene.spritesheet variable.
    What version of essentials are you on? I created and tested this on v16.2, but never checked v17+, so it is possible that broke it.
    I also did not test this modification with any other scripts, so it still may be my fault.
    Granted, I'm not on a device that has RMXP so I can't test anything right now.
     
    "Place on Line 2050, PokeBattle_Battle, end of def pbGainExpOne or find "# Finding all moves learned at this level" after the 2nd end"
    I can not understand, could I have the PokeBattle_Battler already with this script ??
     
    Are you sure that this script is the cause of the error?
    Your error refers to a nil value, specifically of the $scene.spritesheet variable.
    What version of essentials are you on? I created and tested this on v16.2, but never checked v17+, so it is possible that broke it.
    I also did not test this modification with any other scripts, so it still may be my fault.
    Granted, I'm not on a device that has RMXP so I can't test anything right now.

    Hi, thank you for your response!

    I'm not sure if this script is the "cause" of the error, but seeing how every evolution that happens in battle leads to it, there must be something conflicting with this script (I have a good amount of other custom scripts).

    What happens after the error message appears is that the battle music goes MUTE. The error does NOT crash the game, but there's no more music until the battle ends.

    I'm using 16.2 btw.

    For possible conflicting scripts, would it just be the ones the error message has listed?
    Like . . . . Follower, Pokemon_Evolution, PokeBattle_Battle, PSystem_Utilities and no other possible scripts?
     
    Hi, thank you for your response!

    I'm not sure if this script is the "cause" of the error, but seeing how every evolution that happens in battle leads to it, there must be something conflicting with this script (I have a good amount of other custom scripts).

    What happens after the error message appears is that the battle music goes MUTE. The error does NOT crash the game, but there's no more music until the battle ends.

    I'm using 16.2 btw.

    For possible conflicting scripts, would it just be the ones the error message has listed?
    Like . . . . Follower, Pokemon_Evolution, PokeBattle_Battle, PSystem_Utilities and no other possible scripts?

    It's not necessarily all of the scripts in the stacktrace are conflicting, though following the stack down through the code manually helps to figure out the problem.
    Like before, I just checked to see the final result of the error, the nil spritesets, but looking back further, the conflict is with the aliased pbEndScreen in the follower script. What it does, is after evolution, it tries to refresh the sprites the following pokemon if the pokemon that evolved is the first in the party. This normally works just fine and dandy since pokemon only evolve if they are on the overworld. But since this script allows evolution in battle, if your first party member evolves, this error occurs, because starting a battle destroys all spritesets. Adding a nil check should fix it.
    Code:
      def pbEndScreen
        follow_pbEndScreen
        if $scene.spriteset && @pokemon==$Trainer.party[0]
          $PokemonTemp.dependentEvents.refresh_sprite(false)
        end
      end
    Mind you that I haven't gotten the chance to test this (I'm stealing time from irl stuff), but in theory it would work.
     
    Code:
      def pbEndScreen
        follow_pbEndScreen
        if $scene.spriteset && @pokemon==$Trainer.party[0]
          $PokemonTemp.dependentEvents.refresh_sprite(false)
        end
      end

    Sorry, but where exactly do I add that code? I tried adding it to various scripts being Battler, PokeBattle, Follower, and Evolution scripts. However, it still gives the same error for any of those scripts I try.

    I'd also like to note that the error occurs for any Pokemon in the party. For example, I just tested it with a Lycanroc first in the party with a Caterpie and Weedle as other members. The 2 Bug Pokemon evolved without ever being sent out to battle, but the errors still pop up every time.

    Another question is, is it possible for another script to conflict with this process that is NOT mentioned in the error message ?
     
    is there a way to make it if the pokemon is holding it evolutionary item it will evole with it using the item
     
    Back
    Top