• 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] Changing moveset mid battle

  • 38
    Posts
    10
    Years
    • Seen Oct 25, 2024
    Hi, I made a Pokemon that changes forms depending on a certain weather like Castform. I want to make it change its moveset when the form is changed mid battle and then revert back to the moveset it had previously when it's back to the original form.
    So far here's what I have done:
    Changes the form when the weather is changed in PokeBatlle_Battler
    Spoiler:
    Revert back to the original form
    Spoiler:
    Changing forms works perfectly so far. My issue is with the moveset, I need the Pokemon to reset its moveset when it changes forms like it was caught in the wild. The only thing I was able to do is this.
    In Pokemon_Forms
    Code:
    MultipleForms.register(:FAKEMON,{
    "onSetForm"=>proc{|pokemon,form|
      if form>0
       pokemon.resetMoves
      end
    }
    })
    This made the moveset reset but only in the summary screen, the battle menu is still showing the old moves. So I'm missing a line that updates the moves menu in real time this is my first problem.
    My second problem is I don't know how to make a temporary array that stores the old moves before the form changes and then give it back to the Pokemon when it returns to its original form.
    I hope someone can help me.
     
    I don't know any precise answers, but I guess the thing to look into is how learning a level-up move mid-battle works.
     
    Here's what I tried, I put this in PokeBattle_Battler:
    Spoiler:
    and this when the Pokemon revert back to it's original form in pbResetForm:
    Spoiler:
    Still nothing changed I have the exact same problems unfortunately, I also tried putting the script in Pokemon_Form but it didn't work.
    I tried many things for the red line in the second script but nothing changed, here's what I tried:
    Code:
    self.moves[i]=PokeBattle_Move.pbFromPBMove(self,moves[i]) # From pbLearnMove, No error but nothing changed
    self.moves[i]=PBMove.new(moves[i])                                              # Also from pbLearnMove, it gave me an error
    self.moves[i]=PBMove.new(getID(PBMoves,newmove))               # From the thread mentioned by WolfPP, this gave an error aswell
    Something to note when I added another print for self.moves names to see if it changed it showed the same results as the other print command whether I placed it before or after the red line.
    I'm sorry if this script is a mess, my Ruby knowledge is very limited and I feel like it should be something easy I just can't seem to find how to accomplish it 😭
     
    I managed to make it work, here's how I did it:
    Spoiler:

    Storing and resetting the moves worked fine however the only issue is that it won't update at the fight menu when choosing the command, it'll still show the old moves before changing the form, but when I check the summary menu it shows the correct moves.
    I think I'm missing a line in the first block that updates/refresh the moveset mid battle. I tried adding these lines both in the first and last block but none of them worked
    Code:
    @buttons.refresh(self.index,moves,@megaButton)
    @buttons.update(self.index,moves,@megaButton)
    @scene.pbRefresh
    From what I saw, the refresh/update methods are used in either PokeBattle_Battle or PokeBattle_Scene so I should probably use it there but I couldn't find any mentions of specific Pokemon forms.
    If I didn't explain it very well let me know and I'll post screenshots or a video to explain better, any help is appreciated!

    Edit: nvm the problem was something else completely, it have nothing to do with refreshing.
     
    Last edited:
    Back
    Top