• 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!
  • Dawn, Gloria, Juliana, or Summer - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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.

Meloetta Forme Changing

XmarkXalanX

Shadow Master
  • 92
    Posts
    16
    Years
    I've noticed that Meloetta does not change forme upon using Relic Song. I was going to use Meloetta as a base for Aegislash's forme change, but obviously I can't do that if Meloetta's forme change doesn't work. Anyone figure out how to implement Meloetta's forme change?
     
    Ought to be something like this:


    Code:
    ################################################################################
    # Relic Song
    ################################################################################
    class PokeBattle_Move_648 < PokeBattle_Move
      def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
        if isConst?(attacker.species,PBSpecies,:MELOETTA)
          if attacker.form==1
            attacker.form=0
          elsif attacker.form==0 
            attacker.form=1
          end
          transformed=true
        end  
        ret=super(attacker,opponent,hitnum,alltargets,showanimation)
        if opponent.damagestate.calcdamage>0
          showanim=true
        return ret
        end
      end
      
      def pbAdditionalEffect(attacker,opponent)
        if opponent.pbCanSleep?(false)
          opponent.pbSleep
          @battle.pbDisplay(_INTL("{1} went to sleep!",opponent.pbThis))
          return true
        end
        return false
      end  
    end
     
    Last edited:
    Thanks for this script, I'm having the same problem right now.

    But it seems that your script only partially works. When Meloetta uses relic song, technially it Form changes, it gets the new typ combination, stats and so on, and also apears in the summary as Pirouette Forme. But in the battle itself, the sprite of it still remains the
    Aria Forme...
    anyone have an Idea how to fix this?

     
    Idk how Meloetta's forme change works, but for Aegislash you prob want to use this instead. Though i'm not sure if it's still up to date.

    For the Meloetta's sprite not changing, you may need to have the game check it's form after changing it with pbCheckForm (not sure).
     
    Thanks for your reply :)

    Meloetta's Formechange works quite similar to Aegislash's one.
    If meloetta uses the move "Relic Song" in battle, its forme changes from Aria Forme (the standart forme) to Pirouette Forme.
    As mentiont before, technically Natias's script works, meloetta get's the stats and type-combination if its Pirouette Forme, but it isn't shown in battle. I've tried a
    pbCheckForm, but I'm not so much into scripts yet and I'm not sure where to playe ist. actualy my script looks like this:
    Spoiler:


    But now, if Meloretta uses Relic Song this Error appears:
    Spoiler:
    Spoiler:
    Spoiler:


    When I click "Ok", the game continues and the battlescreen still looks like this:
    Spoiler:
    Spoiler:
    Spoiler:

    the additional effect of making the opponent pokémon asleep seems no longer working now.
    Also when I look at the summary of Meloetta, everything seems to work quite well:
    Spoiler:


    I think I will look into that other thing you've postet, if I've time for it. Maybe someon has another Idea in the meantime^^
     
    Here's a working Meloetta and Aegislash, put it in PokeBattle_Battle:
    Code:
        if hasWorkingAbility(:STANCECHANGE) && self.species==PBSpecies::AEGISLASH
          if thismove.basedamage > 0 && @pokemon.form==0
            @pokemon.form=1
            @battle.pbDisplayEffect(self)
            @battle.scene.pbChangePokemon(self,@pokemon)
            pbUpdate(true)
            @battle.pbDisplay(_INTL("Changed to Blade Forme!")) 
            PBDebug.log("[#{pbThis} changed to Blade Forme]")
          elsif thismove.id==PBMoves::KINGSSHIELD && @pokemon.form==1
            @pokemon.form=0
            @battle.pbDisplayEffect(self)
            @battle.scene.pbChangePokemon(self,@pokemon)
            pbUpdate(true)
            @battle.pbDisplay(_INTL("Changed to Shield Forme!"))
            PBDebug.log("[#{pbThis} changed to Shield Forme]")
          end      
        end
        if self.species--PBSpecies::MELOETTA && thismove.id==PBMoves::RELICSONG
          if @pokemon.form==0
            @pokemon.form=1
            @battle.scene.pbChangePokemon(self,@pokemon)
            pbUpdate(true)
            @battle.pbDisplay(_INTL("Changed to Pirouette Forme!"))
            PBDebug.log("[#{pbThis} changed to Pirouette Forme]")
          elsif @pokemon.form==1
            @pokemon.form=0
            @battle.scene.pbChangePokemon(self,@pokemon)
            pbUpdate(true)
            @battle.pbDisplay(_INTL("Changed to Aria Forme!"))
            PBDebug.log("[#{pbThis} changed to Aria Forme]")
          end
        end
    This Aegislash code came from the Essentials Gen 6 project, and I've modified it to make Relic Song work properly.
     
    Last edited:
    Is there a specific place in in _Battle? I tried many positions, but Meloetta wont chsnge.
     
    In Pokebattle_Battler, (with an R), around line 1018 is a large list of form change checks. If Meloetta and Aegislash aren't in that list, add these lines of code:

    Code:
        # Meloetta
        if isConst?(self.species,PBSpecies,:MELOETTA) && !self.isFainted?
          if [email protected]
            [email protected]
            transformed=true
          end
        end
        # Aegislash
        if isConst?(self.species,PBSpecies,:AEGISLASH) && !self.isFainted?
          if [email protected]
            [email protected]
            transformed=true
          end
        end

    then ctrf+f for "def pbTryUseMove(", it should take you somewhere around line 3164. slightly below that, right above the code for Sky Drop, add this bit to make Meloetta's and Aegislash's transformations actually work.
    Code:
        if hasWorkingAbility(:STANCECHANGE) && self.species==PBSpecies::AEGISLASH
          if thismove.basedamage > 0 && @pokemon.form==0
            @pokemon.form=1
            @battle.pbDisplayEffect(self)
            @battle.scene.pbChangePokemon(self,@pokemon)
            pbUpdate(true)
            @battle.pbDisplay(_INTL("Changed to Blade Forme!")) 
            PBDebug.log("[#{pbThis} changed to Blade Forme]")
          elsif thismove.id==PBMoves::KINGSSHIELD && @pokemon.form==1
            @pokemon.form=0
            @battle.pbDisplayEffect(self)
            @battle.scene.pbChangePokemon(self,@pokemon)
            pbUpdate(true)
            @battle.pbDisplay(_INTL("Changed to Shield Forme!"))
            PBDebug.log("[#{pbThis} changed to Shield Forme]")
          end
        elsif self.species==PBSpecies::MELOETTA && thismove.id==PBMoves::RELICSONG
          if @pokemon.form==0
            @pokemon.form=1
            @battle.pbDisplayEffect(self)
            @battle.scene.pbChangePokemon(self,@pokemon)
            pbUpdate(true)
            @battle.pbDisplay(_INTL("Changed to Pirouette Forme!")) 
            PBDebug.log("[#{pbThis} changed to Pirouette Forme]")
          elsif @pokemon.form==1
            @pokemon.form=0
            @battle.pbDisplayEffect(self)
            @battle.scene.pbChangePokemon(self,@pokemon)
            pbUpdate(true)
            @battle.pbDisplay(_INTL("Changed to Aria Forme!"))
            PBDebug.log("[#{pbThis} changed to Aria Forme]")
          end
        end
     
    Last edited:
    Back
    Top