• 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.

Evo During Battle

Zeak6464

Zeak #3205 - Discord
1,101
Posts
11
Years
  • evobattlev4.gif

    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:

    sonicfan7895

    Just a dude, I guess
    122
    Posts
    13
    Years
  • It works for the most part, but then after the evolution sequence happens, I get an error, and the Pokemon that evolved gained even more experience. Here's how the code appears in my game:

    Click here to see.

    So, what should I do? I set it so it's after the second "end"...
     
    Last edited:
    1,682
    Posts
    8
    Years
    • Online now
    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.
     

    sonicfan7895

    Just a dude, I guess
    122
    Posts
    13
    Years
  • 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
     
    25
    Posts
    8
    Years
    • Seen May 30, 2018
    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!
     
    1,682
    Posts
    8
    Years
    • Online now
    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.
     

    etique

    etique
    268
    Posts
    6
    Years
    • Seen Oct 30, 2022
    "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 ??
     
    25
    Posts
    8
    Years
    • Seen May 30, 2018
    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?
     
    1,682
    Posts
    8
    Years
    • Online 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?

    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.
     
    25
    Posts
    8
    Years
    • Seen May 30, 2018
    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 ?
     

    Venomous_Zero86

    Pokemon Chosen Ones (Coming Soon)
    120
    Posts
    8
    Years
    • Seen Feb 11, 2022
    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