• 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] Mid Battle Animation for pokemon that change forms

5
Posts
74
Days
    • Seen Mar 2, 2024
    So I´ve installed the Gen 9 repack for essentials from relic castle, its excellent, but I realised Pokemon such as Morpeko, Wishiwashi, Terapagos among others change form in an awkard way and I would like to add some animations to those form changes while in battle.

    The question I guess is: How do I script for when those pokemons change form (via item such as Zazian or via ability such as Morpeko) an animation is displayed (sort of like a mega) so that it doesn´t abruptly change from one sprite to the other.

    I´m kinda new to this. Thanks.
     
    1,682
    Posts
    8
    Years
    • Seen today
    In def pbMegaEvolve the command pbCommonAnimation("MegaEvolution", battler) is used to play the Common:MegaEvolution Battle Animation before it changes the form.
    You would want to do something similar.
     
    5
    Posts
    74
    Days
    • Seen Mar 2, 2024
    In def pbMegaEvolve the command pbCommonAnimation("MegaEvolution", battler) is used to play the Common:MegaEvolution Battle Animation before it changes the form.
    You would want to do something similar.
    So I dont think I understand, I´m new to this sorry.

    The line of code for the morpeko form change is this I think:

    # Morpeko - Hunger Switch
    if isSpecies?(:MORPEKO) && hasActiveAbility?(:HUNGERSWITCH) && endOfRound
    # Intentionally doesn't show the ability splash or a message
    newForm = (@form + 1) % 2
    pbChangeForm(newForm, nil)
    end
    end

    So how do I add the animation display here? or how do I add a custom animation?

    I mean maybe its not even here where i have to introduce the animation, maybe its some other script folder within rpg maker. As I said im new to this
     
    Last edited:
    1,682
    Posts
    8
    Years
    • Seen today
    So I dont think I understand, I´m new to this sorry.

    The line of code for the morpeko form change is this I think:

    # Morpeko - Hunger Switch
    if isSpecies?(:MORPEKO) && hasActiveAbility?(:HUNGERSWITCH) && endOfRound
    # Intentionally doesn't show the ability splash or a message
    newForm = (@form + 1) % 2
    pbChangeForm(newForm, nil)
    end
    end

    So how do I add the animation display here? or how do I add a custom animation?

    I mean maybe its not even here where i have to introduce the animation, maybe its some other script folder within rpg maker. As I said im new to this
    The edit belongs in pbChangeForm, just above the line that sets the form variable, self.form = newForm. However I don't believe mega evolution has an animation defined by default, so I'm not sure you can use that one to test. You can add new animations in the Battle Animation Editor in the Debug menu.
     
    5
    Posts
    74
    Days
    • Seen Mar 2, 2024
    The edit belongs in pbChangeForm, just above the line that sets the form variable, self.form = newForm. However I don't believe mega evolution has an animation defined by default, so I'm not sure you can use that one to test. You can add new animations in the Battle Animation Editor in the Debug menu.
    So basically what I wanna do is, with my very limited knowledge of ruby, be able to display an animation every time morpeko changes form (which he does at the end of every turn), as well as terapagos (which he does when his hability tera shift activate at the beggening of the battle). Okey so let´s say I have the animation created with the editor, what do I do now?. Sorry for the trouble I just dont know how to do it
     
    Last edited:
    1,682
    Posts
    8
    Years
    • Seen today
    So basically what I wanna do is, with my very limited knowledge of ruby, be able to display an animation every time morpeko changes form (which he does at the end of every turn), as well as terapagos (which he does when his hability tera shift activate at the beggening of the battle). Okey so let´s say I have the animation created with the editor, what do I do now?. Sorry for the trouble I just dont know how to do it
    So, to make this easy, let's pretend the animation you made is called Common:FormChange in the animation editor.
    Now we find def pbChangeForm (you can use CTRL+SHIFT+F to search all script sections at once).
    Find this bit
    Ruby:
        oldDmg = @totalhp - @hp
        self.form = newForm
    and make it this
    Ruby:
        oldDmg = @totalhp - @hp
        @battle.pbCommonAnimation("FormChange", self)
        self.form = newForm
     
    5
    Posts
    74
    Days
    • Seen Mar 2, 2024
    So, to make this easy, let's pretend the animation you made is called Common:FormChange in the animation editor.
    Now we find def pbChangeForm (you can use CTRL+SHIFT+F to search all script sections at once).
    Find this bit
    Ruby:
        oldDmg = @totalhp - @hp
        self.form = newForm
    and make it this
    Ruby:
        oldDmg = @totalhp - @hp
        @battle.pbCommonAnimation("FormChange", self)
        self.form = newForm
    I did as follows
    def pbChangeForm(newForm, msg)
    return if fainted? || @effects[PBEffects::Transform] || @form == newForm
    oldForm = @form
    oldDmg = @totalhp - @HP
    @battle.pbCommonAnimation("FormChange", self)
    self.form = newForm
    pbUpdate(true)
    @HP = @totalhp - oldDmg
    @effects[PBEffects::WeightChange] = 0 if Settings::MECHANICS_GENERATION >= 6
    @battle.scene.pbChangePokemon(self, @Pokemon)
    @battle.scene.pbRefreshOne(@IndeX)
    @battle.pbDisplay(msg) if msg && msg != ""
    PBDebug.log("[Form changed] #{pbThis} changed from form #{oldForm} to form #{newForm}")
    @battle.pbSetSeen(self)
    end

    And it doesnt work. Idk why
     
    1,682
    Posts
    8
    Years
    • Seen today
    I did as follows
    def pbChangeForm(newForm, msg)
    return if fainted? || @effects[PBEffects::Transform] || @form == newForm
    oldForm = @form
    oldDmg = @totalhp - @HP
    @battle.pbCommonAnimation("FormChange", self)
    self.form = newForm
    pbUpdate(true)
    @HP = @totalhp - oldDmg
    @effects[PBEffects::WeightChange] = 0 if Settings::MECHANICS_GENERATION >= 6
    @battle.scene.pbChangePokemon(self, @Pokemon)
    @battle.scene.pbRefreshOne(@IndeX)
    @battle.pbDisplay(msg) if msg && msg != ""
    PBDebug.log("[Form changed] #{pbThis} changed from form #{oldForm} to form #{newForm}")
    @battle.pbSetSeen(self)
    end

    And it doesnt work. Idk why
    Next time, surround code in code blocks. Not sure who you pinged with that.

    Do you actually have a battle animation called FormChange? See the wiki link for instructions on how to make an animation (I dontdon't really know how to do that part)
     
    5
    Posts
    74
    Days
    • Seen Mar 2, 2024
    Next time, surround code in code blocks. Not sure who you pinged with that.

    Do you actually have a battle animation called FormChange? See the wiki link for instructions on how to make an animation (I dontdon't really know how to do that part)
    Yes yes I have the .anm file in the root directory
     
    Back
    Top