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

Changing Meloetta's form with Relic Song

ShinxHero

Main Director of Pokémon VSLP
  • 59
    Posts
    9
    Years
    Before reading this, yes I have checked https://https://www.pokecommunity.com/showthread.php?t=321523. However it is not very though on where to put and where it is talking about, all I'm getting is errors.

    So here's my question:
    How in the world do you change Meloetta's Form when it uses Relic Song? Whenever it uses Relic Song, it only stays in its Aria form and it doesn't go to its Pirouette form at all.

    Thank you to any of those who answer.
     
    Assuming you have the Gen VI pack here. They didn't actually fix Meloetta.



    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
        [COLOR="Red"]elsif 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[/COLOR]
        end
    PokeBattle_Battler - in the "pbTryUseMove" function. Add the red code.



    Code:
        # Cherrim
        if isConst?(self.species,PBSpecies,:CHERRIM) && !self.isFainted?
          case @battle.pbWeather
          when PBWeather::SUNNYDAY,PBWeather::DESOLATELAND
            if self.form!=1
              self.form=1
              transformed=true
            end
          else
            if self.form!=0
              self.form=0
              transformed=true
            end
          end
        end
        # Zen Mode
        if isConst?(self.species,PBSpecies,:DARMANITAN) && !self.isFainted?
          if self.hasWorkingAbility(:ZENMODE)
            if @hp<=((@totalhp/2).floor)
              if self.form!=1
                @battle.pbDisplayEffect(self)
                self.form=1; transformed=true
              end
            else
              if self.form!=0
                @battle.pbDisplayEffect(self)
                self.form=0; transformed=true
              end
            end
          else
            if self.form!=0
              @battle.pbDisplayEffect(self)
              self.form=0; transformed=true
            end
          end
        end[COLOR="Red"]
        # Meloetta
        if isConst?(self.species,PBSpecies,:MELOETTA) && !self.isFainted?
          if [email protected]
            [email protected]
          end
        end[/COLOR]
    Still in PokeBattle_Battler. This time in the function "pbCheckForm"
     
    Assuming you have the Gen VI pack here. They didn't actually fix Meloetta.



    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
        [COLOR="Red"]elsif 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[/COLOR]
        end
    PokeBattle_Battler - in the "pbTryUseMove" function. Add the red code.



    Code:
        # Cherrim
        if isConst?(self.species,PBSpecies,:CHERRIM) && !self.isFainted?
          case @battle.pbWeather
          when PBWeather::SUNNYDAY,PBWeather::DESOLATELAND
            if self.form!=1
              self.form=1
              transformed=true
            end
          else
            if self.form!=0
              self.form=0
              transformed=true
            end
          end
        end
        # Zen Mode
        if isConst?(self.species,PBSpecies,:DARMANITAN) && !self.isFainted?
          if self.hasWorkingAbility(:ZENMODE)
            if @hp<=((@totalhp/2).floor)
              if self.form!=1
                @battle.pbDisplayEffect(self)
                self.form=1; transformed=true
              end
            else
              if self.form!=0
                @battle.pbDisplayEffect(self)
                self.form=0; transformed=true
              end
            end
          else
            if self.form!=0
              @battle.pbDisplayEffect(self)
              self.form=0; transformed=true
            end
          end
        end[COLOR="Red"]
        # Meloetta
        if isConst?(self.species,PBSpecies,:MELOETTA) && !self.isFainted?
          if [email protected]
            [email protected]
          end
        end[/COLOR]
    Still in PokeBattle_Battler. This time in the function "pbCheckForm"

    Okay, I did all that, but its telling me this when I entered it:
    "Script 'PokeBattle_Battler' line 2848: Syntax Error occured."
     
    Okay, I did all that, but its telling me this when I entered it:
    "Script 'PokeBattle_Battler' line 2848: Syntax Error occured."

    For me, at least, line 2848 has to do with Black Sludge. So I don't think Relic Song has anything to do with it.

    Edit: just checked, in the untouched Gen VI Pack, line 2848 has to do with an accuracy check for multi-target moves.
     
    For me, at least, line 2848 has to do with Black Sludge. So I don't think Relic Song has anything to do with it.

    Edit: just checked, in the untouched Gen VI Pack, line 2848 has to do with an accuracy check for multi-target moves.

    So what I do to fix that?
     
    My line 2848 is actually just the end of the script.

    If you're getting a syntax error, and it's pointing to the bottom of your script, 99% of the time that means you've got an "if" or "for" or "case" statement that's floating around missing its "end". And unfortunately, I cannot help you find that, because I'd have to nitpick your entire PokeBattle_Battler script section.

    I'd recommend copy-and-pasting the script section into something like Notepad++ (and then telling it that your code is in Ruby). It should allow you to more easily find the source of the problem - which likely ISN'T on line 2848.
     
    If you're getting a syntax error, and it's pointing to the bottom of your script, 99% of the time that means you've got an "if" or "for" or "case" statement that's floating around missing its "end". And unfortunately, I cannot help you find that, because I'd have to nitpick your entire PokeBattle_Battler script section.

    I'd recommend copy-and-pasting the script section into something like Notepad++ (and then telling it that your code is in Ruby). It should allow you to more easily find the source of the problem - which likely ISN'T on line 2848.
    Okay, but...... How can you tell which line has the error of Notepad++?
     
    Okay, but...... How can you tell which line has the error of Notepad++?

    Assuming your code is properly indented, there'll be a vertical line that we'll say starts at the bottom of your code, over on the left side. Follow that line all the way up, and you'll see the "if" or "for" or "while" statement that is missing the "end"
     
    Assuming your code is properly indented, there'll be a vertical line that we'll say starts at the bottom of your code, over on the left side. Follow that line all the way up, and you'll see the "if" or "for" or "while" statement that is missing the "end"

    I have checked every line on Notepad ++ and placed the "end" where I saw there was none, however, its still saying that there's a syntax error on the last line.
     
    Well, I found out the source of the problem and i can certainly help you with it
    first of all, the first line of it:

    elsif self.species==PBSpecies::MELOETTA && thismove.id==PBMoves::RELICSONG

    The only Syntax here is the first line, instead of elsif self
    you need to use "else if self.species"
    It would look like this:
    else if self.species==PBSpecies::MELOETTA && thismove.id==PBMoves::RELICSONG



    Spoiler:


    So pretty much all you need to do is change the first line and it would look like this:

    Spoiler:


    If not, try pasting the whole code right under the : def pbTryUseMove(choice,thismove,turneffects)
     
    Last edited by a moderator:
    Spoiler:


    So pretty much all you need to do is change the first line and it would look like this:

    Spoiler:


    If not, try pasting the whole code right under the : def pbTryUseMove(choice,thismove,turneffects)

    This is absolutely wrong. else if would cause a syntax error. If you want to use else and if as separate commands, stick a semicolon between them.

    However, elsif is a thing in Ruby. That, at least, is correct.
     
    This is absolutely wrong. else if would cause a syntax error. If you want to use else and if as separate commands, stick a semicolon between them.

    However, elsif is a thing in Ruby. That, at least, is correct.

    Well at least that worked for me, im not that good on scripting but at least i know the basic business
     
    Well at least that worked for me, im not that good on scripting but at least i know the basic business

    If you add extra "ends" you'll be able to avoid it being a syntax error, but it's unnecessary typing
    Code:
    a=6
    if a==4
      a=7
    else if a==5
          a=8
        else if a==6
            a=9
          end
        end
    end
    
    puts a

    using elsif
    Code:
    a=6
    if a==4
      a=7
    elsif a==5
      a=8
    elsif a==6
      a=9
    end
    puts a

    Shorter, and much easier to read this way.
     
    Back
    Top