Scripts, Tutorials & Tools This forum is for scripts and code, as well as all kinds of tutorials, software, tools and so forth. Remember to give credit!
The thread revival limit does not apply here.

Ad Content
Reply
 
Thread Tools
  #1   Link to this post, but load the entire thread.  
Old January 15th, 2019 (8:07 AM).
Poq's Avatar
Poq Poq is offline
     
    Join Date: Aug 2017
    Posts: 93
    With a bit of trial and error, I've managed to put together a working script for Mimikyu's Disguise ability.

    There have been a few threads about this topic, and I posted a partial solution to this question here. However, there were some shortcomings with that script, mainly that Disguise was reset every time the Mimikyu switched out of battle, unlike in SM where it only works once per battle. My new script fixes that so that Disguise works a bit more like Mega Evolution - as a form change that lasts for the duration of battle and resets on end of battle, fainting, or capture. If you previously applied the steps from that linked thread, you'll want to undo them before trying this one, as this new approach uses an entirely different mechanic that is not compatible with the previous fix.

    To pull off this ability, a number of crucial scripts have to be tweaked, so this is unfortunately not a plug & play script, but I will try to spell out the steps as clearly as possible:

    #1 Check and Change the Pokemon's Form
    Spoiler:
    When creating this script myself, I put this in the Pokemon_MegaEvolution script section around line 97 (right after the code for makeUnprimal) because it is modeled after the mega evo scripts. However, the key is that it is part of the PokeBattle_Pokemon class (which Pokemon_MegaEvolution extends), so it could go in the script section of that title as well.
    The scripts to include are:

    Code:
      def makeBusted
        f = self.getBustedForm
        self.form = f
      end
    
      def isBusted?
        bf = self.getBustedForm
        if bf==self.form
          return true
        else
          return false
        end
      end
    
      def makeDisguised
        df = self.getDisguiseForm
        self.form = df if df>=0
      end
    
      def getDisguiseForm
        return -1 if !isBusted?
          disguiseform = self.form-1	
        return disguiseform   # form number
      end
    
      def hasBustedForm?
        bf = self.getBustedForm
        return bf>0 && bf!=self.form
      end
    
      def getBustedForm
        if isConst?(self.species,PBSpecies,:MIMIKYU) && self.hasAbility?(:DISGUISE)
          return 1 
        else
          return-1
        end
      end

    #2 Check and Change the Pokemon in Battle
    Spoiler:
    These scripts will all affect the script section PokeBattle_Battler. First, around line 85, right after the methods hasMega? and isMega? Add the following:

    Code:
    #Mimikyu - Disguise
      def hasBusted?
        return false if @effects[PBEffects::Transform]
        if @pokemon
          return (@pokemon.hasBustedForm? rescue false)
        end
        return false
      end
    
      def isBusted?
        if @pokemon
          return (@pokemon.isBusted? rescue false)
        end
        return false
      end
    
      def pbBust
        @battle.pbDisplay(_INTL("{1}'s disguise was busted!",pbThis))
        @pokemon.makeBusted
        if self.form!=@pokemon.form
          self.form=@pokemon.form
        end
        self.pbUpdate(true) 
        @battle.scene.pbChangePokemon(self,@pokemon)
      end

    #3 Revert to Base Form
    Spoiler:
    These are the scripts that make sure Mimikyu's disguise resets after battle. For the first, stay in PokeBattle_Battler. Look for the script for pbFaint and around line 790, right after the line @pokimon.makeUnprimal, add

    Code:
         @pokemon.makeDisguised if self.isBusted?
    Next in the script section PokeBattle_Battle, you'll edit the script for pbThrowPokeBall. Around line 144, insert the line in red to revert a Mimikyu to its base form on capture:

    Code:
            BallHandlers.onCatch(ball,self,pokemon)
            pokemon.ballused=pbGetBallType(ball)
            ((pokemon.makeUnmega if pokemon.isMega?) rescue nil)
            ((pokemon.makeDisguised if pokemon.isBusted?) rescue nil)
    	pokemon.makeUnprimal rescue nil
            pokemon.pbRecordFirstMoves
    Then, in the script section Pfield_Battles, edit the script for pbAfterBattle. Around line 387, insert the code in red:

    Code:
    def pbAfterBattle(decision,canlose)
      for i in $Trainer.party
        (i.makeUnmega rescue nil); (i.makeUnprimal rescue nil); (i.makeDisguised rescue nil)
      end
      if $PokemonGlobal.partner
        pbHealAll
        for i in $PokemonGlobal.partner[3]
          i.heal
          (i.makeUnmega rescue nil); (i.makeUnprimal rescue nil); (i.makeDisguised rescue nil)

    #4 Break Disguise
    Spoiler:
    Last but not least, we need to add the script that prevents damage when Mimikyu is disguised and then breaks that disguise. In PokeBattle_Move, find the script for pbReduceHPDamage. Around line 1165, after the code for substitute, insert the lines in red.

    Code:
          opponent.damagestate.substitute=false
          if opponent.hasWorkingAbility(:DISGUISE) && isConst?(opponent.species,PBSpecies,:MIMIKYU) && !attacker.hasMoldBreaker
            if opponent.hasBusted? and !opponent.isBusted?
              @battle.pbDisplay(_INTL("Its disguise served it as a decoy!"))
              @battle.scene.pbDamageAnimation(opponent,0)
              opponent.pbBust
              damage=0
            end
          end
          if damage>=opponent.hp

    Conclusion
    With all that finished, you should now have functioning code for the Disguise ability. Enjoy and use responsibly!
    And of course, credit is appreciated if you use it.
    Reply With Quote
      #2   Link to this post, but load the entire thread.  
    Old January 15th, 2019 (7:31 PM).
    Team Embrace's Avatar
    Team Embrace Team Embrace is offline
    Team Embrace Boss
       
      Join Date: Jan 2019
      Gender: Male
      Nature: Jolly
      Posts: 15
      That's amazing thank you for posting it!
      Reply With Quote
        #3   Link to this post, but load the entire thread.  
      Old January 15th, 2019 (8:52 PM).
      juliorain's Avatar
      juliorain juliorain is online now
       
      Join Date: Aug 2016
      Gender: Male
      Nature: Quirky
      Posts: 213
      this is so wonderful!!!! Thank you!
      __________________
      Reply With Quote
        #4   Link to this post, but load the entire thread.  
      Old January 16th, 2019 (1:33 AM).
      mybusiness's Avatar
      mybusiness mybusiness is offline
      Discord: mybusiness#3879
         
        Join Date: Dec 2018
        Location: Spain
        Gender: Male
        Nature: Lonely
        Posts: 57
        Good job. Additionally, I have made a 'def revertOtherForms' in Pokemon_MegaEvolution that includes Mimikyu, Greninja and Zygarde (reverting to what specific form you had before battle). This way, you have to put just one code at pbThrowPokeBall and pbAfterBattle. Now I go to the threads concerning Greninja and Zygarde, since Mimikyu is busted, in this sense.
        Reply With Quote
          #5   Link to this post, but load the entire thread.  
        Old January 16th, 2019 (7:20 AM). Edited January 16th, 2019 by WolfPP.
        WolfPP's Avatar
        WolfPP WolfPP is online now
        Discord: Wolf#1235
           
          Join Date: Aug 2018
          Location: Brazil
          Gender: Male
          Nature: Jolly
          Posts: 251
          He applied what we had talked about in past threads! Great script Poq, as always helping all devs!
          I will test when I have time, and I think it will be able to add the other types of pokemons that can use this script, like Greninja (Battle Bonde) and Zygarde (Power Construct).
          If I do this successfully, I will gladly share it with all of you!

          I know than doenst exist a icon sprite to Burst Form, so i drew one. Credit is appreciated if you use it.

          Also, we need to create to Ultra Burst too :D

          Cya!

          EDIT:
          How to add Ash-Greninja:

          In Ability.txt, paste (193 will be changed for your last number):
          Code:
          193,BATTLEBOND,Battle Bond,"Defeating an opposing Pokémon strengthens the Pokémon's bond with its Trainer."
          In pokemon.txt, search to Greninja and add your hidden abilities:
          Spoiler:

          Code:
          #-------------------------------
          [658]
          Name=Greninja
          InternalName=GRENINJA
          Type1=WATER
          Type2=DARK
          BaseStats=72,95,67,122,103,71
          GenderRate=FemaleOneEighth
          GrowthRate=Parabolic
          BaseEXP=239
          EffortPoints=0,0,0,3,0,0
          Rareness=45
          Happiness=70
          Abilities=TORRENT,PROTEAN
          HiddenAbility=BATTLEBOND
          Moves=1,NIGHTSLASH,1,ROLEPLAY,1,MATBLOCK,1,POUND,1,GROWL,5,BUBBLE,8,QUICKATTACK,10,LICK,14,WATERPULSE,20,SMOKESCREEN,23,SHADOWSNEAK,28,SPIKES,33,FEINTATTACK,36,WATERSHURIKEN,43,SUBSTITUTE,49,EXTRASENSORY,52,DOUBLETEAM,56,HAZE,60,HYDROPUMP,70,NIGHTSLASH,75,WATERSHURIKEN
          Compatibility=Water1
          StepsToHatch=5120
          Height=1.5
          Weight=40.0
          Color=Blue
          Shape=12
          RegionalNumbers=0,0,0,0,0,9,0,0,658
          Kind=Ninja
          Pokedex=It appears and vanishes with a ninja's grace. It toys with its enemies using swift movements, while slicing them with throwing stars of sharpest water.
          BattlerPlayerY=16
          BattlerEnemyY=20
          BattlerAltitude=0
          Evolutions=
          #-------------------------------


          Now, in pokemonforms.txt add Ash-Greninja form:
          Spoiler:

          Code:
          #-------------------------------
          [GRENINJA-1]
          FormName=Battle Bond
          BaseStats=72,145,67,132,153,71
          Abilities=BATTLEBOND
          BattlerPlayerY=7
          BattlerEnemyY=16
          #-------------------------------


          After install Disguise script (made by Poq. Give credit to him), search to 'def getBustedForm' and add the red line:
          Spoiler:

          Code:
            
            def getBustedForm
              if isConst?(self.species,PBSpecies,:MIMIKYU) && self.hasAbility?(:DISGUISE) ||
               isConst?(self.species,PBSpecies,:GRENINJA) && self.hasAbility?(:BATTLEBOND)
                return 1
              else
                return-1
              end
            end


          Search 'def pbBust' and add the red line:
          Spoiler:

          Code:
            def pbBust
              @battle.pbDisplay(_INTL("{1}'s disguise was busted!",pbThis)) if isConst?(self.species,PBSpecies,:MIMIKYU)
              @battle.pbDisplay(_INTL("{1} became Ash-Greninja!",pbThis)) if isConst?(self.species,PBSpecies,:GRENINJA)
              @pokemon.makeBusted
              if self.form!=@pokemon.form
                self.form=@pokemon.form
              end
              self.pbUpdate(true) 
              @battle.scene.pbChangePokemon(self,@pokemon)
            end


          Finally, search to 'def pbEffectsAfterHit(user,target,thismove,turneffects)' and below Moxie ability script paste. Something like (red line):
          Spoiler:

          Code:
              # Moxie
              if user.hasWorkingAbility(:MOXIE) && target.fainted?
                if user.pbIncreaseStatWithCause(PBStats::ATTACK,1,user,PBAbilities.getName(user.ability))
                  PBDebug.log("[Ability triggered] #{user.pbThis}'s Moxie")
                end
              end
              # Battle Bond
              if isConst?(user.species,PBSpecies,:GRENINJA) && user.hasWorkingAbility(:BATTLEBOND)
                if target.isFainted? && !user.isFainted? && user.form==0
                  party=@battle.pbParty(target.index)
                  if party.length>1
                    if user.hasBusted? and !user.isBusted?
                      @battle.pbDisplay(_INTL("{1} became fully charged due to its bond with its Trainer!",pbThis))
                      user.pbBust
                    end
                  end
                end
              end


          To script, click here to give credits: https://www.pokecommunity.com/showthread.php?t=387706
          Credit to Poq to created the script
          Credit for me to adapted Battle Bondt ability script, usin Poq's script. :D

          Battle sprite in Attachments (credit to Smogon: https://www.smogon.com/forums/threads/xy-sprite-project-read-1st-post-release-v1-1-on-post-3240.3486712/)
          Ash Greninja Icon sprite in Attachments (check for the credits https://www.deviantart.com/meem123/art/POKEMON-GEN-6-7-MENU-SPRITES-ICONS-V10-435245381)
          Attached Images
          File Type: png 658_1.png‎ (2.2 KB, 3 views) (Save to Dropbox)
          File Type: png 658b_1.png‎ (2.0 KB, 2 views) (Save to Dropbox)
          File Type: png 658s_1.png‎ (2.2 KB, 3 views) (Save to Dropbox)
          File Type: png 658sb_1.png‎ (2.1 KB, 1 views) (Save to Dropbox)
          File Type: png icon658_1.png‎ (1.6 KB, 2 views) (Save to Dropbox)
          File Type: png icon778_1.png‎ (1.0 KB, 1 views) (Save to Dropbox)
          Reply With Quote
            #6   Link to this post, but load the entire thread.  
          Old January 16th, 2019 (3:47 PM). Edited 4 Weeks Ago by WolfPP.
          WolfPP's Avatar
          WolfPP WolfPP is online now
          Discord: Wolf#1235
             
            Join Date: Aug 2018
            Location: Brazil
            Gender: Male
            Nature: Jolly
            Posts: 251
            Sorry about the flood but it is other script, to Zygarde (we still need to finish):

            First, ability.txt add (212 will be changed for your last number):
            Code:
            212,POWERCONSTRUCT,Power Construct,"Other Cells gather to aid when its HP becomes half or less."
            Second, pokemonforms.txt add:
            Code:
            #-------------------------------
            [ZYGARDE-1]
            FormName=10% Forme
            BaseStats=54,100,71,115,61,85
            Height=1.2
            Weight=33.5
            Shape=8
            Pokedex=This is Zygarde when about 10% of its pieces have been assembled. It leaps at its opponent's chest and sinks its sharp fangs into them.
            BattlerPlayerY=13
            BattlerEnemyY=16
            #-------------------------------
            [ZYGARDE-2]
            FormName=Complete Forme
            BaseStats=216,100,121,85,91,95
            Abilities=POWERCONSTRUCT
            Height=4.5
            Weight=610.0
            Pokedex=Born when all of Zygarde's cells have been gathered together, it uses force to neutralize those who harm the ecosystem.
            BattlerPlayerY=7
            BattlerEnemyY=4
            #-------------------------------
            After install Disguise script (made by Poq. Give credit to him), search to 'def getBustedForm' and add the red line:
            Spoiler:

            Code:
              def getBustedForm
                if isConst?(self.species,PBSpecies,:MIMIKYU) && self.hasAbility?(:DISGUISE) ||
                 isConst?(self.species,PBSpecies,:GRENINJA) && self.hasAbility?(:BATTLEBOND)
                  return 1
                elsif isConst?(self.species,PBSpecies,:ZYGARDE) && self.hasAbility?(:POWERCONSTRUCT)
                  return 2
                else
                  return-1
                end
              end


            Then, search to 'def pbBust'. Add:
            Spoiler:

            Code:
              def pbBust
                @battle.pbDisplay(_INTL("{1}'s disguise was busted!",pbThis)) if isConst?(self.species,PBSpecies,:MIMIKYU)
                @battle.pbDisplay(_INTL("{1} became Ash-Greninja!",pbThis)) if isConst?(self.species,PBSpecies,:GRENINJA)
                @battle.pbDisplay(_INTL("{1} transformed into its Complete Forme!",pbThis)) if isConst?(self.species,PBSpecies,:ZYGARDE)
                @pokemon.makeBusted
                if self.form!=@pokemon.form
                  self.form=@pokemon.form
                end
                self.pbUpdate(true) 
                @battle.scene.pbChangePokemon(self,@pokemon)
              end


            Now, the last one: search to 'def pbReduceHPDamage(damage,attacker,opponent)' and add the red line:
            Spoiler:

            Code:
                  oldhp=opponent.hp
                  opponent.hp-=damage
                  effectiveness=0
                  if opponent.damagestate.typemod<8
                    effectiveness=1   # "Not very effective"
                  elsif opponent.damagestate.typemod>8
                    effectiveness=2   # "Super effective"
                  end
                  if opponent.damagestate.typemod!=0
                    @battle.scene.pbDamageAnimation(opponent,effectiveness)
                  end
                  @battle.scene.pbHPChanged(opponent,oldhp)
                  opponent.damagestate.hplost=damage
                  if opponent.hp<=(opponent.totalhp/2).floor
                    if opponent.hasWorkingAbility(:POWERCONSTRUCT) && isConst?(opponent.species,PBSpecies,:ZYGARDE) &&
                     !attacker.hasMoldBreaker
                      if opponent.hasBusted? and !opponent.isBusted?
                        @battle.pbDisplay(_INTL("You sense the presence of many!"))
                        opponent.pbBust
                      end
                    end
                  end
                end
                return damage
              end


            We need to find a way to how to script when we have zygarde forme 50% (form=0) and zygarde forme 10% (form=1) and after battle, back to normal (form 1 or 0).
            Always it will back to form 1, because this:
            Code:
              def getDisguiseForm
                return -1 if !isBusted?
                  disguiseform = self.form-1
                return disguiseform   # form number
              end
            or this:
            Code:
              def getBustedForm
                if isConst?(self.species,PBSpecies,:MIMIKYU) && self.hasAbility?(:DISGUISE) ||
                 isConst?(self.species,PBSpecies,:GRENINJA) && self.hasAbility?(:BATTLEBOND)
                  return 1
                elsif isConst?(self.species,PBSpecies,:ZYGARDE) && self.hasAbility?(:POWERCONSTRUCT)
                  return 2
                else
                  return-1
                end
              end
            idk how to script that part.

            Credit to Poq to created the script
            Credit for me to created a script to Power Construct ability, usin Poq's script. :D

            Battle sprite in Attachments (credit to Smogon: https://www.smogon.com/forums/threads/xy-sprite-project-read-1st-post-release-v1-1-on-post-3240.3486712/)
            Zygarde Icon sprite (check for the credits https://www.deviantart.com/meem123/art/POKEMON-GEN-6-7-MENU-SPRITES-ICONS-V10-435245381)

            BETTER SCRIPT TO ZYGARDE HERE
            https://www.pokecommunity.com/showpost.php?p=9968463&postcount=20
            Credis goes to mybusiness
            Attached Images
            File Type: png 718_1.png‎ (1.6 KB, 0 views) (Save to Dropbox)
            File Type: png 718b_1.png‎ (1.5 KB, 0 views) (Save to Dropbox)
            File Type: png 718_2.png‎ (3.5 KB, 0 views) (Save to Dropbox)
            File Type: png 718b_2.png‎ (2.8 KB, 0 views) (Save to Dropbox)
            File Type: png 718s_1.png‎ (1.6 KB, 1 views) (Save to Dropbox)
            File Type: png 718sb_1.png‎ (1.5 KB, 1 views) (Save to Dropbox)
            File Type: png 718s_2.png‎ (3.5 KB, 1 views) (Save to Dropbox)
            File Type: png 718sb_2.png‎ (2.8 KB, 0 views) (Save to Dropbox)
            Reply With Quote
              #7   Link to this post, but load the entire thread.  
            Old January 16th, 2019 (6:25 PM).
            Team Embrace's Avatar
            Team Embrace Team Embrace is offline
            Team Embrace Boss
               
              Join Date: Jan 2019
              Gender: Male
              Nature: Jolly
              Posts: 15
              I get a syntax error in pokebattle_battler line 3400? any ideas on how to fix this? Thanks!
              Reply With Quote
                #8   Link to this post, but load the entire thread.  
              Old January 16th, 2019 (6:48 PM).
              WolfPP's Avatar
              WolfPP WolfPP is online now
              Discord: Wolf#1235
                 
                Join Date: Aug 2018
                Location: Brazil
                Gender: Male
                Nature: Jolly
                Posts: 251
                Quote:
                Originally Posted by Team Embrace View Post
                I get a syntax error in pokebattle_battler line 3400? any ideas on how to fix this? Thanks!
                Give us your message error. We dont know about your script line 3400.

                Example:

                Spoiler:

                Code:
                Pokemon Essentials
                ---------------------------
                [Pokémon Essentials version 17.2]
                
                Exception: NoMethodError
                
                Message: undefined method `>' for 0..649:Range
                
                PokeBattle_Battle:86:in `pbThrowPokeBall_ebs'
                
                #0 EliteBattle_Script:367:in `pbThrowPokeBall'
                
                PItem_ItemEffects:1709
                
                PItem_ItemEffects:1708:in `call'
                
                EventHandlers:150:in `trigger'
                
                PItem_Items:246:in `triggerUseInBattle'
                
                PokeBattle_Battle:1457:in `pbRegisterItem'
                
                PokeBattle_Battle:2637:in `pbCommandPhase_ebs'
                
                PokeBattle_Battle:2592:in `loop'
                
                PokeBattle_Battle:2682:in `pbCommandPhase_ebs'
                Reply With Quote
                  #9   Link to this post, but load the entire thread.  
                Old January 17th, 2019 (9:40 AM).
                Team Embrace's Avatar
                Team Embrace Team Embrace is offline
                Team Embrace Boss
                   
                  Join Date: Jan 2019
                  Gender: Male
                  Nature: Jolly
                  Posts: 15
                  I don't that kind of error message it just says syntax error PBDebug.log("[Form changed] #{pbThis} changed to Blade Forme")
                  elsif isConst?(thismove.id,PBMoves,:KINGSSHIELD) && self.form!=0
                  self.form=0
                  pbUpdate(true)
                  @battle.scene.pbChangePokemon(self,@pokemon)
                  @battle.pbDisplay(_INTL("{1} changed to Shield Forme!",pbThis))
                  PBDebug.log("[Form changed] #{pbThis} changed to Shield Forme")
                  end
                  end
                  # Record that user has used a move this round (ot at least tried to)
                  self.lastRoundMoved=@battle.turncount
                  # Try to use the move
                  if !pbTryUseMove(choice,thismove,turneffects)
                  self.lastMoveUsed=-1
                  self.lastMoveUsedType=-1
                  if !turneffects[PBEffects::SpecialUsage]
                  self.lastMoveUsedSketch=-1 if self.effects[PBEffects::TwoTurnAttack]==0
                  self.lastRegularMoveUsed=-1
                  end
                  pbCancelMoves
                  @battle.pbGainEXP
                  pbEndTurn(choice)
                  @battle.pbJudge # @battle.pbSwitch
                  return
                  end
                  if !turneffects[PBEffects::SpecialUsage]
                  if !pbReducePP(thismove)
                  @battle.pbDisplay(_INTL("{1} used\r\n{2}!",pbThis,thismove.name))
                  @battle.pbDisplay(_INTL("But there was no PP left for the move!"))
                  self.lastMoveUsed=-1
                  self.lastMoveUsedType=-1
                  self.lastMoveUsedSketch=-1 if self.effects[PBEffects::TwoTurnAttack]==0
                  self.lastRegularMoveUsed=-1
                  pbEndTurn(choice)
                  @battle.pbJudge # @battle.pbSwitch
                  PBDebug.log("[Move failed] #{thismove.name} has no PP left")
                  return
                  end
                  end
                  # Remember that user chose a two-turn move
                  if thismove.pbTwoTurnAttack(self)
                  # Beginning use of two-turn attack
                  @effects[PBEffects::TwoTurnAttack]=thismove.id
                  @currentMove=thismove.id
                  else
                  @effects[PBEffects::TwoTurnAttack]=0 # Cancel use of two-turn attack
                  end
                  # Charge up Metronome item
                  if self.lastMoveUsed==thismove.id
                  self.effects[PBEffects::Metronome]+=1
                  else
                  self.effects[PBEffects::Metronome]=0
                  end
                  # "X used Y!" message
                  case thismove.pbDisplayUseMessage(self)
                  when 2 # Continuing Bide
                  return
                  when 1 # Starting Bide
                  self.lastMoveUsed=thismove.id
                  self.lastMoveUsedType=thismove.pbType(thismove.type,self,nil)
                  if !turneffects[PBEffects::SpecialUsage]
                  self.lastMoveUsedSketch=thismove.id if self.effects[PBEffects::TwoTurnAttack]==0
                  self.lastRegularMoveUsed=thismove.id
                  end
                  @battle.lastMoveUsed=thismove.id
                  @battle.lastMoveUser=self.index
                  @battle.successStates[self.index].useState=2
                  @battle.successStates[self.index].typemod=8
                  return
                  when -1 # Was hurt while readying Focus Punch, fails use
                  self.lastMoveUsed=thismove.id
                  self.lastMoveUsedType=thismove.pbType(thismove.type,self,nil)
                  if !turneffects[PBEffects::SpecialUsage]
                  self.lastMoveUsedSketch=thismove.id if self.effects[PBEffects::TwoTurnAttack]==0
                  self.lastRegularMoveUsed=thismove.id
                  end
                  @battle.lastMoveUsed=thismove.id
                  @battle.lastMoveUser=self.index
                  @battle.successStates[self.index].useState=2 # somehow treated as a success
                  @battle.successStates[self.index].typemod=8
                  PBDebug.log("[Move failed] #{pbThis} was hurt while readying Focus Punch")
                  return
                  end
                  # Find the user and target(s)
                  targets=[]
                  user=pbFindUser(choice,targets)
                  # Battle Arena only - assume failure
                  @battle.successStates[user.index].useState=1
                  @battle.successStates[user.index].typemod=8
                  # Check whether Selfdestruct works
                  if !thismove.pbOnStartUse(user) # Selfdestruct, Natural Gift, Beat Up can return false here
                  PBDebug.log(sprintf("[Move failed] Failed pbOnStartUse (function code %02X)",thismove.function))
                  user.lastMoveUsed=thismove.id
                  user.lastMoveUsedType=thismove.pbType(thismove.type,user,nil)
                  if !turneffects[PBEffects::SpecialUsage]
                  user.lastMoveUsedSketch=thismove.id if user.effects[PBEffects::TwoTurnAttack]==0
                  user.lastRegularMoveUsed=thismove.id
                  end
                  @battle.lastMoveUsed=thismove.id
                  @battle.lastMoveUser=user.index
                  return
                  end
                  # Primordial Sea, Desolate Land
                  if thismove.pbIsDamaging?
                  case @battle.pbWeather
                  when PBWeather::HEAVYRAIN
                  if isConst?(thismove.pbType(thismove.type,user,nil),PBTypes,:FIRE)
                  PBDebug.log("[Move failed] Primordial Sea's rain cancelled the Fire-type #{thismove.name}")
                  @battle.pbDisplay(_INTL("The Fire-type attack fizzled out in the heavy rain!"))
                  user.lastMoveUsed=thismove.id
                  user.lastMoveUsedType=thismove.pbType(thismove.type,user,nil)
                  if !turneffects[PBEffects::SpecialUsage]
                  user.lastMoveUsedSketch=thismove.id if user.effects[PBEffects::TwoTurnAttack]==0
                  user.lastRegularMoveUsed=thismove.id
                  end
                  @battle.lastMoveUsed=thismove.id
                  @battle.lastMoveUser=user.index
                  return
                  end
                  when PBWeather::HARSHSUN
                  if isConst?(thismove.pbType(thismove.type,user,nil),PBTypes,:WATER)
                  PBDebug.log("[Move failed] Desolate Land's sun cancelled the Water-type #{thismove.name}")
                  @battle.pbDisplay(_INTL("The Water-type attack evaporated in the harsh sunlight!"))
                  user.lastMoveUsed=thismove.id
                  user.lastMoveUsedType=thismove.pbType(thismove.type,user,nil)
                  if !turneffects[PBEffects::SpecialUsage]
                  user.lastMoveUsedSketch=thismove.id if user.effects[PBEffects::TwoTurnAttack]==0
                  user.lastRegularMoveUsed=thismove.id
                  end
                  @battle.lastMoveUsed=thismove.id
                  @battle.lastMoveUser=user.index
                  return
                  end
                  end
                  end
                  # Powder
                  if user.effects[PBEffects::Powder] && isConst?(thismove.pbType(thismove.type,user,nil),PBTypes,:FIRE)
                  PBDebug.log("[Lingering effect triggered] #{pbThis}'s Powder cancelled the Fire move")
                  @battle.pbCommonAnimation("Powder",user,nil)
                  @battle.pbDisplay(_INTL("When the flame touched the powder on the Pokémon, it exploded!"))
                  user.pbReduceHP(1+(user.totalhp/4).floor) if !user.hasWorkingAbility(:MAGICGUARD)
                  user.lastMoveUsed=thismove.id
                  user.lastMoveUsedType=thismove.pbType(thismove.type,user,nil)
                  if !turneffects[PBEffects::SpecialUsage]
                  user.lastMoveUsedSketch=thismove.id if user.effects[PBEffects::TwoTurnAttack]==0
                  user.lastRegularMoveUsed=thismove.id
                  end
                  @battle.lastMoveUsed=thismove.id
                  @battle.lastMoveUser=user.index
                  user.pbFaint if user.isFainted?
                  pbEndTurn(choice)
                  return
                  end
                  # Protean
                  if user.hasWorkingAbility(:PROTEAN) &&
                  thismove.function!=0xAE && # Mirror Move
                  thismove.function!=0xAF && # Copycat
                  thismove.function!=0xB0 && # Me First
                  thismove.function!=0xB3 && # Nature Power
                  thismove.function!=0xB4 && # Sleep Talk
                  thismove.function!=0xB5 && # Assist
                  thismove.function!=0xB6 # Metronome
                  movetype=thismove.pbType(thismove.type,user,nil)
                  if !user.pbHasType?(movetype)
                  typename=PBTypes.getName(movetype)
                  PBDebug.log("[Ability triggered] #{pbThis}'s Protean made it #{typename}-type")
                  user.type1=movetype
                  user.type2=movetype
                  user.effects[PBEffects::Type3]=-1
                  @battle.pbDisplay(_INTL("{1} transformed into the {2} type!",user.pbThis,typename))
                  end
                  end
                  # Try to use move against user if there aren't any targets
                  if targets.length==0
                  user=pbChangeUser(thismove,user)
                  if thismove.target==PBTargets::SingleNonUser ||
                  thismove.target==PBTargets::RandomOpposing ||
                  thismove.target==PBTargets::AllOpposing ||
                  thismove.target==PBTargets::AllNonUsers ||
                  thismove.target==PBTargets::Partner ||
                  thismove.target==PBTargets::UserOrPartner ||
                  thismove.target==PBTargets::SingleOpposing ||
                  thismove.target==PBTargets::OppositeOpposing
                  @battle.pbDisplay(_INTL("But there was no target..."))
                  else
                  PBDebug.logonerr{
                  thismove.pbEffect(user,nil)
                  }
                  end
                  else
                  # We have targets
                  showanimation=true
                  alltargets=[]
                  for i in 0...targets.length
                  alltargets.push(targets[i].index) if !targets.include?(targets[i].index)
                  end
                  # For each target in turn
                  i=0; loop do break if i>=targets.length
                  # Get next target
                  userandtarget=[user,targets[i]]
                  success=pbChangeTarget(thismove,userandtarget,targets)
                  user=userandtarget[0]
                  target=userandtarget[1]
                  if i==0 && thismove.target==PBTargets::AllOpposing
                  # Add target's partner to list of targets
                  pbAddTarget(targets,target.pbPartner)
                  end
                  # If couldn't get the next target
                  if !success
                  i+=1
                  next
                  end
                  # Get the number of hits
                  numhits=thismove.pbNumHits(user)
                  # Reset damage state, set Focus Band/Focus Sash to available
                  target.damagestate.reset
                  # Use move against the current target
                  pbProcessMoveAgainstTarget(thismove,user,target,numhits,turneffects,false,alltargets,showanimation)
                  showanimation=false
                  i+=1
                  end
                  end
                  # Pokémon switching caused by Roar, Whirlwind, Circle Throw, Dragon Tail, Red Card
                  if !user.isFainted?
                  switched=[]
                  for i in 0...4
                  if @battle.battlers[i].effects[PBEffects::Roar]
                  @battle.battlers[i].effects[PBEffects::Roar]=false
                  @battle.battlers[i].effects[PBEffects::Uturn]=false
                  next if @battle.battlers[i].isFainted?
                  next if !@battle.pbCanSwitch?(i,-1,false)
                  choices=[]
                  party=@battle.pbParty(i)
                  for j in 0...party.length
                  choices.push(j) if @battle.pbCanSwitchLax?(i,j,false)
                  end
                  if choices.length>0
                  newpoke=choices[@battle.pbRandom(choices.length)]
                  newpokename=newpoke
                  if isConst?(party[newpoke].ability,PBAbilities,:ILLUSION)
                  newpokename=pbGetLastPokeInTeam(i)
                  end
                  switched.push(i)
                  @battle.battlers[i].pbResetForm
                  @battle.pbRecallAndReplace(i,newpoke,newpokename,false,user.hasMoldBreaker)
                  @battle.pbDisplay(_INTL("{1} was dragged out!",@battle.battlers[i].pbThis))
                  @battle.choices[i]=[0,0,nil,-1] # Replacement Pokémon does nothing this round
                  end
                  end
                  end
                  for i in @battle.pbPriority
                  next if !switched.include?(i.index)
                  i.pbAbilitiesOnSwitchIn(true)
                  end
                  end
                  # Pokémon switching caused by U-Turn, Volt Switch, Eject Button
                  switched=[]
                  for i in 0...4
                  if @battle.battlers[i].effects[PBEffects::Uturn]
                  @battle.battlers[i].effects[PBEffects::Uturn]=false
                  @battle.battlers[i].effects[PBEffects::Roar]=false
                  if !@battle.battlers[i].isFainted? && @battle.pbCanChooseNonActive?(i) &&
                  !@battle.pbAllFainted?(@battle.pbOpposingParty(i))
                  # TODO: Pursuit should go here, and negate this effect if it KO's attacker
                  @battle.pbDisplay(_INTL("{1} went back to {2}!",@battle.battlers[i].pbThis,@battle.pbGetOwner(i).name))
                  newpoke=0
                  newpoke=@battle.pbSwitchInBetween(i,true,false)
                  newpokename=newpoke
                  if isConst?(@battle.pbParty(i)[newpoke].ability,PBAbilities,:ILLUSION)
                  newpokename=pbGetLastPokeInTeam(i)
                  end
                  switched.push(i)
                  @battle.battlers[i].pbResetForm
                  @battle.pbRecallAndReplace(i,newpoke,newpokename,@battle.battlers[i].effects[PBEffects::BatonPass])
                  @battle.choices[i]=[0,0,nil,-1] # Replacement Pokémon does nothing this round
                  end
                  end
                  end
                  for i in @battle.pbPriority
                  next if !switched.include?(i.index)
                  i.pbAbilitiesOnSwitchIn(true)
                  end
                  # Baton Pass
                  if user.effects[PBEffects::BatonPass]
                  user.effects[PBEffects::BatonPass]=false
                  if !user.isFainted? && @battle.pbCanChooseNonActive?(user.index) &&
                  !@battle.pbAllFainted?(@battle.pbParty(user.index))
                  newpoke=0
                  newpoke=@battle.pbSwitchInBetween(user.index,true,false)
                  newpokename=newpoke
                  if isConst?(@battle.pbParty(user.index)[newpoke].ability,PBAbilities,:ILLUSION)
                  newpokename=pbGetLastPokeInTeam(user.index)
                  end
                  user.pbResetForm
                  @battle.pbRecallAndReplace(user.index,newpoke,newpokename,true)
                  @battle.choices[user.index]=[0,0,nil,-1] # Replacement Pokémon does nothing this round
                  user.pbAbilitiesOnSwitchIn(true)
                  end
                  end
                  # Record move as having been used
                  user.lastMoveUsed=thismove.id
                  user.lastMoveUsedType=thismove.pbType(thismove.type,user,nil)
                  if !turneffects[PBEffects::SpecialUsage]
                  user.lastMoveUsedSketch=thismove.id if user.effects[PBEffects::TwoTurnAttack]==0
                  user.lastRegularMoveUsed=thismove.id
                  user.movesUsed.push(thismove.id) if !user.movesUsed.include?(thismove.id) # For Last Resort
                  end
                  @battle.lastMoveUsed=thismove.id
                  @battle.lastMoveUser=user.index
                  # Gain Exp
                  @battle.pbGainEXP
                  # Battle Arena only - update skills
                  for i in 0...4
                  @battle.successStates[i].updateSkill
                  end
                  # End of move usage
                  pbEndTurn(choice)
                  @battle.pbJudge # @battle.pbSwitch
                  return
                  end

                  def pbCancelMoves
                  # If failed pbTryUseMove or have already used Pursuit to chase a switching foe
                  # Cancel multi-turn attacks (note: Hyper Beam effect is not canceled here)
                  @effects[PBEffects::TwoTurnAttack]=0 if @effects[PBEffects::TwoTurnAttack]>0
                  @effects[PBEffects::Outrage]=0
                  @effects[PBEffects::Rollout]=0
                  @effects[PBEffects::Uproar]=0
                  @effects[PBEffects::Bide]=0
                  @currentMove=0
                  # Reset counters for moves which increase them when used in succession
                  @effects[PBEffects::FuryCutter]=0
                  PBDebug.log("Cancelled using the move")
                  end

                  ################################################################################
                  # Turn processing
                  ################################################################################
                  def pbBeginTurn(choice)
                  # Cancel some lingering effects which only apply until the user next moves
                  @effects[PBEffects::DestinyBond]=false
                  @effects[PBEffects::Grudge]=false
                  # Reset Parental Bond's count
                  @effects[PBEffects::ParentalBond]=0
                  # Encore's effect ends if the encored move is no longer available
                  if @effects[PBEffects::Encore]>0 &&
                  @moves[@effects[PBEffects::EncoreIndex]].id!=@effects[PBEffects::EncoreMove]
                  PBDebug.log("Resetting Encore effect")
                  @effects[PBEffects::Encore]=0
                  @effects[PBEffects::EncoreIndex]=0
                  @effects[PBEffects::EncoreMove]=0
                  end
                  # Wake up in an uproar
                  if self.status==PBStatuses::SLEEP && !self.hasWorkingAbility(:SOUNDPROOF)
                  for i in 0...4
                  if @battle.battlers[i].effects[PBEffects::Uproar]>0
                  pbCureStatus(false)
                  @battle.pbDisplay(_INTL("{1} woke up in the uproar!",pbThis))
                  end
                  end
                  end
                  end

                  def pbEndTurn(choice)
                  # True end(?)
                  if @effects[PBEffects::ChoiceBand]<0 && @lastMoveUsed>=0 && !self.isFainted? &&
                  (self.hasWorkingItem(:CHOICEBAND) ||
                  self.hasWorkingItem(:CHOICESPECS) ||
                  self.hasWorkingItem(:CHOICESCARF))
                  @effects[PBEffects::ChoiceBand]=@lastMoveUsed
                  end
                  @battle.pbPrimordialWeather
                  for i in 0...4
                  @battle.battlers[i].pbBerryCureCheck
                  end
                  for i in 0...4
                  @battle.battlers[i].pbAbilityCureCheck
                  end
                  for i in 0...4
                  @battle.battlers[i].pbAbilitiesOnSwitchIn(false)
                  end
                  for i in 0...4
                  @battle.battlers[i].pbCheckForm
                  end
                  end

                  def pbProcessTurn(choice)
                  # Can't use a move if fainted
                  return false if self.isFainted?
                  # Wild roaming Pokémon always flee if possible
                  if !@battle.opponent && @battle.pbIsOpposing?(self.index) &&
                  @battle.rules["alwaysflee"] && @battle.pbCanRun?(self.index)
                  pbBeginTurn(choice)
                  @battle.pbDisplay(_INTL("{1} fled!",self.pbThis))
                  @battle.decision=3
                  pbEndTurn(choice)
                  PBDebug.log("[Escape] #{pbThis} fled")
                  return true
                  end
                  # If this battler's action for this round wasn't "use a move"
                  if choice[0]!=1
                  # Clean up effects that end at battler's turn
                  pbBeginTurn(choice)
                  pbEndTurn(choice)
                  return false
                  end
                  # Turn is skipped if Pursuit was used during switch
                  if @effects[PBEffects::Pursuit]
                  @effects[PBEffects::Pursuit]=false
                  pbCancelMoves
                  pbEndTurn(choice)
                  @battle.pbJudge # @battle.pbSwitch
                  return false
                  end
                  # Use the move
                  # @battle.pbDisplayPaused("Before: [#{@lastMoveUsedSketch},#{@lastMoveUsed}]")
                  PBDebug.log("#{pbThis} used #{choice[2].name}")
                  PBDebug.logonerr{
                  pbUseMove(choice,choice[2]==@battle.struggle)
                  }
                  # @battle.pbDisplayPaused("After: [#{@lastMoveUsedSketch},#{@lastMoveUsed}]")
                  return true
                  end
                  line 3400 end
                  Reply With Quote
                    #10   Link to this post, but load the entire thread.  
                  Old 4 Weeks Ago (10:03 AM).
                  WolfPP's Avatar
                  WolfPP WolfPP is online now
                  Discord: Wolf#1235
                     
                    Join Date: Aug 2018
                    Location: Brazil
                    Gender: Male
                    Nature: Jolly
                    Posts: 251
                    Quote:
                    Originally Posted by Team Embrace View Post
                    I don't that kind of error message it just says syntax error

                    Spoiler:

                    Code:
                    PBDebug.log("[Form changed] #{pbThis} changed to Blade Forme")
                          elsif isConst?(thismove.id,PBMoves,:KINGSSHIELD) && self.form!=0
                            self.form=0
                            pbUpdate(true)
                            @battle.scene.pbChangePokemon(self,@pokemon)
                            @battle.pbDisplay(_INTL("{1} changed to Shield Forme!",pbThis))
                            PBDebug.log("[Form changed] #{pbThis} changed to Shield Forme")
                          end      
                        end
                        # Record that user has used a move this round (ot at least tried to)
                        self.lastRoundMoved=@battle.turncount
                        # Try to use the move
                        if !pbTryUseMove(choice,thismove,turneffects)
                          self.lastMoveUsed=-1
                          self.lastMoveUsedType=-1
                          if !turneffects[PBEffects::SpecialUsage]
                            self.lastMoveUsedSketch=-1 if self.effects[PBEffects::TwoTurnAttack]==0
                            self.lastRegularMoveUsed=-1
                          end
                          pbCancelMoves
                          @battle.pbGainEXP
                          pbEndTurn(choice)
                          @battle.pbJudge #      @battle.pbSwitch
                          return
                        end
                        if !turneffects[PBEffects::SpecialUsage]
                          if !pbReducePP(thismove)
                            @battle.pbDisplay(_INTL("{1} used\r\n{2}!",pbThis,thismove.name))
                            @battle.pbDisplay(_INTL("But there was no PP left for the move!"))
                            self.lastMoveUsed=-1
                            self.lastMoveUsedType=-1
                            self.lastMoveUsedSketch=-1 if self.effects[PBEffects::TwoTurnAttack]==0
                            self.lastRegularMoveUsed=-1
                            pbEndTurn(choice)
                            @battle.pbJudge #        @battle.pbSwitch
                            PBDebug.log("[Move failed] #{thismove.name} has no PP left")
                            return
                          end
                        end
                        # Remember that user chose a two-turn move
                        if thismove.pbTwoTurnAttack(self)
                          # Beginning use of two-turn attack
                          @effects[PBEffects::TwoTurnAttack]=thismove.id
                          @currentMove=thismove.id
                        else
                          @effects[PBEffects::TwoTurnAttack]=0 # Cancel use of two-turn attack
                        end
                        # Charge up Metronome item
                        if self.lastMoveUsed==thismove.id
                          self.effects[PBEffects::Metronome]+=1
                        else
                          self.effects[PBEffects::Metronome]=0
                        end
                        # "X used Y!" message
                        case thismove.pbDisplayUseMessage(self)
                        when 2   # Continuing Bide
                          return
                        when 1   # Starting Bide
                          self.lastMoveUsed=thismove.id
                          self.lastMoveUsedType=thismove.pbType(thismove.type,self,nil)
                          if !turneffects[PBEffects::SpecialUsage]
                            self.lastMoveUsedSketch=thismove.id if self.effects[PBEffects::TwoTurnAttack]==0
                            self.lastRegularMoveUsed=thismove.id
                          end
                          @battle.lastMoveUsed=thismove.id
                          @battle.lastMoveUser=self.index
                          @battle.successStates[self.index].useState=2
                          @battle.successStates[self.index].typemod=8
                          return
                        when -1   # Was hurt while readying Focus Punch, fails use
                          self.lastMoveUsed=thismove.id
                          self.lastMoveUsedType=thismove.pbType(thismove.type,self,nil)
                          if !turneffects[PBEffects::SpecialUsage]
                            self.lastMoveUsedSketch=thismove.id if self.effects[PBEffects::TwoTurnAttack]==0
                            self.lastRegularMoveUsed=thismove.id
                          end
                          @battle.lastMoveUsed=thismove.id
                          @battle.lastMoveUser=self.index
                          @battle.successStates[self.index].useState=2 # somehow treated as a success
                          @battle.successStates[self.index].typemod=8
                          PBDebug.log("[Move failed] #{pbThis} was hurt while readying Focus Punch")
                          return
                        end
                        # Find the user and target(s)
                        targets=[]
                        user=pbFindUser(choice,targets)
                        # Battle Arena only - assume failure 
                        @battle.successStates[user.index].useState=1
                        @battle.successStates[user.index].typemod=8
                        # Check whether Selfdestruct works
                        if !thismove.pbOnStartUse(user) # Selfdestruct, Natural Gift, Beat Up can return false here
                          PBDebug.log(sprintf("[Move failed] Failed pbOnStartUse (function code %02X)",thismove.function))
                          user.lastMoveUsed=thismove.id
                          user.lastMoveUsedType=thismove.pbType(thismove.type,user,nil)
                          if !turneffects[PBEffects::SpecialUsage]
                            user.lastMoveUsedSketch=thismove.id if user.effects[PBEffects::TwoTurnAttack]==0
                            user.lastRegularMoveUsed=thismove.id
                          end
                          @battle.lastMoveUsed=thismove.id
                          @battle.lastMoveUser=user.index
                          return
                        end
                        # Primordial Sea, Desolate Land
                        if thismove.pbIsDamaging?
                          case @battle.pbWeather
                          when PBWeather::HEAVYRAIN
                            if isConst?(thismove.pbType(thismove.type,user,nil),PBTypes,:FIRE)
                              PBDebug.log("[Move failed] Primordial Sea's rain cancelled the Fire-type #{thismove.name}")
                              @battle.pbDisplay(_INTL("The Fire-type attack fizzled out in the heavy rain!"))
                              user.lastMoveUsed=thismove.id
                              user.lastMoveUsedType=thismove.pbType(thismove.type,user,nil)
                              if !turneffects[PBEffects::SpecialUsage]
                                user.lastMoveUsedSketch=thismove.id if user.effects[PBEffects::TwoTurnAttack]==0
                                user.lastRegularMoveUsed=thismove.id
                              end
                              @battle.lastMoveUsed=thismove.id
                              @battle.lastMoveUser=user.index
                              return
                            end
                          when PBWeather::HARSHSUN
                            if isConst?(thismove.pbType(thismove.type,user,nil),PBTypes,:WATER)
                              PBDebug.log("[Move failed] Desolate Land's sun cancelled the Water-type #{thismove.name}")
                              @battle.pbDisplay(_INTL("The Water-type attack evaporated in the harsh sunlight!"))
                              user.lastMoveUsed=thismove.id
                              user.lastMoveUsedType=thismove.pbType(thismove.type,user,nil)
                              if !turneffects[PBEffects::SpecialUsage]
                                user.lastMoveUsedSketch=thismove.id if user.effects[PBEffects::TwoTurnAttack]==0
                                user.lastRegularMoveUsed=thismove.id
                              end
                              @battle.lastMoveUsed=thismove.id
                              @battle.lastMoveUser=user.index
                              return
                            end
                          end
                        end
                        # Powder
                        if user.effects[PBEffects::Powder] && isConst?(thismove.pbType(thismove.type,user,nil),PBTypes,:FIRE)
                          PBDebug.log("[Lingering effect triggered] #{pbThis}'s Powder cancelled the Fire move")
                          @battle.pbCommonAnimation("Powder",user,nil)
                          @battle.pbDisplay(_INTL("When the flame touched the powder on the Pokémon, it exploded!"))
                          user.pbReduceHP(1+(user.totalhp/4).floor) if !user.hasWorkingAbility(:MAGICGUARD)   
                          user.lastMoveUsed=thismove.id
                          user.lastMoveUsedType=thismove.pbType(thismove.type,user,nil)
                          if !turneffects[PBEffects::SpecialUsage]
                            user.lastMoveUsedSketch=thismove.id if user.effects[PBEffects::TwoTurnAttack]==0
                            user.lastRegularMoveUsed=thismove.id
                          end
                          @battle.lastMoveUsed=thismove.id
                          @battle.lastMoveUser=user.index
                          user.pbFaint if user.isFainted?
                          pbEndTurn(choice)
                          return
                        end
                        # Protean
                        if user.hasWorkingAbility(:PROTEAN) &&
                           thismove.function!=0xAE &&   # Mirror Move
                           thismove.function!=0xAF &&   # Copycat
                           thismove.function!=0xB0 &&   # Me First
                           thismove.function!=0xB3 &&   # Nature Power
                           thismove.function!=0xB4 &&   # Sleep Talk
                           thismove.function!=0xB5 &&   # Assist
                           thismove.function!=0xB6      # Metronome
                          movetype=thismove.pbType(thismove.type,user,nil)
                          if !user.pbHasType?(movetype)
                            typename=PBTypes.getName(movetype)
                            PBDebug.log("[Ability triggered] #{pbThis}'s Protean made it #{typename}-type")
                            user.type1=movetype
                            user.type2=movetype
                            user.effects[PBEffects::Type3]=-1
                            @battle.pbDisplay(_INTL("{1} transformed into the {2} type!",user.pbThis,typename))  
                          end
                        end
                        # Try to use move against user if there aren't any targets
                        if targets.length==0
                          user=pbChangeUser(thismove,user)
                          if thismove.target==PBTargets::SingleNonUser ||
                             thismove.target==PBTargets::RandomOpposing ||
                             thismove.target==PBTargets::AllOpposing ||
                             thismove.target==PBTargets::AllNonUsers ||
                             thismove.target==PBTargets::Partner ||
                             thismove.target==PBTargets::UserOrPartner ||
                             thismove.target==PBTargets::SingleOpposing ||
                             thismove.target==PBTargets::OppositeOpposing
                            @battle.pbDisplay(_INTL("But there was no target..."))
                          else
                            PBDebug.logonerr{
                               thismove.pbEffect(user,nil)
                            }
                          end
                        else
                          # We have targets
                          showanimation=true
                          alltargets=[]
                          for i in 0...targets.length
                            alltargets.push(targets[i].index) if !targets.include?(targets[i].index)
                          end
                          # For each target in turn
                          i=0; loop do break if i>=targets.length
                            # Get next target
                            userandtarget=[user,targets[i]]
                            success=pbChangeTarget(thismove,userandtarget,targets)
                            user=userandtarget[0]
                            target=userandtarget[1]
                            if i==0 && thismove.target==PBTargets::AllOpposing
                              # Add target's partner to list of targets
                              pbAddTarget(targets,target.pbPartner)
                            end
                            # If couldn't get the next target
                            if !success
                              i+=1
                              next
                            end
                            # Get the number of hits
                            numhits=thismove.pbNumHits(user)
                            # Reset damage state, set Focus Band/Focus Sash to available
                            target.damagestate.reset
                            # Use move against the current target
                            pbProcessMoveAgainstTarget(thismove,user,target,numhits,turneffects,false,alltargets,showanimation)
                            showanimation=false
                            i+=1
                          end
                        end
                        # Pokémon switching caused by Roar, Whirlwind, Circle Throw, Dragon Tail, Red Card
                        if !user.isFainted?
                          switched=[]
                          for i in 0...4
                            if @battle.battlers[i].effects[PBEffects::Roar]
                              @battle.battlers[i].effects[PBEffects::Roar]=false
                              @battle.battlers[i].effects[PBEffects::Uturn]=false
                              next if @battle.battlers[i].isFainted?
                              next if !@battle.pbCanSwitch?(i,-1,false)
                              choices=[]
                              party=@battle.pbParty(i)
                              for j in 0...party.length
                                choices.push(j) if @battle.pbCanSwitchLax?(i,j,false)
                              end
                              if choices.length>0
                                newpoke=choices[@battle.pbRandom(choices.length)]
                                newpokename=newpoke
                                if isConst?(party[newpoke].ability,PBAbilities,:ILLUSION)
                                  newpokename=pbGetLastPokeInTeam(i)
                                end
                                switched.push(i)
                                @battle.battlers[i].pbResetForm
                                @battle.pbRecallAndReplace(i,newpoke,newpokename,false,user.hasMoldBreaker)
                                @battle.pbDisplay(_INTL("{1} was dragged out!",@battle.battlers[i].pbThis))
                                @battle.choices[i]=[0,0,nil,-1]   # Replacement Pokémon does nothing this round
                              end
                            end
                          end
                          for i in @battle.pbPriority
                            next if !switched.include?(i.index)
                            i.pbAbilitiesOnSwitchIn(true)
                          end
                        end
                        # Pokémon switching caused by U-Turn, Volt Switch, Eject Button
                        switched=[]
                        for i in 0...4
                          if @battle.battlers[i].effects[PBEffects::Uturn]
                            @battle.battlers[i].effects[PBEffects::Uturn]=false
                            @battle.battlers[i].effects[PBEffects::Roar]=false
                            if !@battle.battlers[i].isFainted? && @battle.pbCanChooseNonActive?(i) &&
                               !@battle.pbAllFainted?(@battle.pbOpposingParty(i))
                              # TODO: Pursuit should go here, and negate this effect if it KO's attacker
                              @battle.pbDisplay(_INTL("{1} went back to {2}!",@battle.battlers[i].pbThis,@battle.pbGetOwner(i).name))
                              newpoke=0
                              newpoke=@battle.pbSwitchInBetween(i,true,false)
                              newpokename=newpoke
                              if isConst?(@battle.pbParty(i)[newpoke].ability,PBAbilities,:ILLUSION)
                                newpokename=pbGetLastPokeInTeam(i)
                              end
                              switched.push(i)
                              @battle.battlers[i].pbResetForm
                              @battle.pbRecallAndReplace(i,newpoke,newpokename,@battle.battlers[i].effects[PBEffects::BatonPass])
                              @battle.choices[i]=[0,0,nil,-1]   # Replacement Pokémon does nothing this round
                            end
                          end
                        end
                        for i in @battle.pbPriority
                          next if !switched.include?(i.index)
                          i.pbAbilitiesOnSwitchIn(true)
                        end
                        # Baton Pass
                        if user.effects[PBEffects::BatonPass]
                          user.effects[PBEffects::BatonPass]=false
                          if !user.isFainted? && @battle.pbCanChooseNonActive?(user.index) &&
                             !@battle.pbAllFainted?(@battle.pbParty(user.index))
                            newpoke=0
                            newpoke=@battle.pbSwitchInBetween(user.index,true,false)
                            newpokename=newpoke
                            if isConst?(@battle.pbParty(user.index)[newpoke].ability,PBAbilities,:ILLUSION)
                              newpokename=pbGetLastPokeInTeam(user.index)
                            end
                            user.pbResetForm
                            @battle.pbRecallAndReplace(user.index,newpoke,newpokename,true)
                            @battle.choices[user.index]=[0,0,nil,-1]   # Replacement Pokémon does nothing this round
                            user.pbAbilitiesOnSwitchIn(true)
                          end
                        end
                        # Record move as having been used
                        user.lastMoveUsed=thismove.id
                        user.lastMoveUsedType=thismove.pbType(thismove.type,user,nil)
                        if !turneffects[PBEffects::SpecialUsage]
                          user.lastMoveUsedSketch=thismove.id if user.effects[PBEffects::TwoTurnAttack]==0
                          user.lastRegularMoveUsed=thismove.id
                          user.movesUsed.push(thismove.id) if !user.movesUsed.include?(thismove.id) # For Last Resort
                        end
                        @battle.lastMoveUsed=thismove.id
                        @battle.lastMoveUser=user.index
                        # Gain Exp
                        @battle.pbGainEXP
                        # Battle Arena only - update skills
                        for i in 0...4
                          @battle.successStates[i].updateSkill
                        end
                        # End of move usage
                        pbEndTurn(choice)
                        @battle.pbJudge #    @battle.pbSwitch
                        return
                      end
                    
                      def pbCancelMoves
                        # If failed pbTryUseMove or have already used Pursuit to chase a switching foe
                        # Cancel multi-turn attacks (note: Hyper Beam effect is not canceled here)
                        @effects[PBEffects::TwoTurnAttack]=0 if @effects[PBEffects::TwoTurnAttack]>0
                        @effects[PBEffects::Outrage]=0
                        @effects[PBEffects::Rollout]=0
                        @effects[PBEffects::Uproar]=0
                        @effects[PBEffects::Bide]=0
                        @currentMove=0
                        # Reset counters for moves which increase them when used in succession
                        @effects[PBEffects::FuryCutter]=0
                        PBDebug.log("Cancelled using the move")
                      end
                    
                    ################################################################################
                    # Turn processing
                    ################################################################################
                      def pbBeginTurn(choice)
                        # Cancel some lingering effects which only apply until the user next moves
                        @effects[PBEffects::DestinyBond]=false
                        @effects[PBEffects::Grudge]=false
                        # Reset Parental Bond's count
                        @effects[PBEffects::ParentalBond]=0
                        # Encore's effect ends if the encored move is no longer available
                        if @effects[PBEffects::Encore]>0 &&
                           @moves[@effects[PBEffects::EncoreIndex]].id!=@effects[PBEffects::EncoreMove]
                          PBDebug.log("Resetting Encore effect")
                          @effects[PBEffects::Encore]=0
                          @effects[PBEffects::EncoreIndex]=0
                          @effects[PBEffects::EncoreMove]=0
                        end
                        # Wake up in an uproar
                        if self.status==PBStatuses::SLEEP && !self.hasWorkingAbility(:SOUNDPROOF)
                          for i in 0...4
                            if @battle.battlers[i].effects[PBEffects::Uproar]>0
                              pbCureStatus(false)
                              @battle.pbDisplay(_INTL("{1} woke up in the uproar!",pbThis))
                            end
                          end
                        end
                      end
                    
                      def pbEndTurn(choice)
                        # True end(?)
                        if @effects[PBEffects::ChoiceBand]<0 && @lastMoveUsed>=0 && !self.isFainted? && 
                           (self.hasWorkingItem(:CHOICEBAND) ||
                           self.hasWorkingItem(:CHOICESPECS) ||
                           self.hasWorkingItem(:CHOICESCARF))
                          @effects[PBEffects::ChoiceBand]=@lastMoveUsed
                        end
                        @battle.pbPrimordialWeather
                        for i in 0...4
                          @battle.battlers[i].pbBerryCureCheck
                        end
                        for i in 0...4
                          @battle.battlers[i].pbAbilityCureCheck
                        end
                        for i in 0...4
                          @battle.battlers[i].pbAbilitiesOnSwitchIn(false)
                        end
                        for i in 0...4
                          @battle.battlers[i].pbCheckForm
                        end
                      end
                    
                      def pbProcessTurn(choice)
                        # Can't use a move if fainted
                        return false if self.isFainted?
                        # Wild roaming Pokémon always flee if possible
                        if !@battle.opponent && @battle.pbIsOpposing?(self.index) &&
                           @battle.rules["alwaysflee"] && @battle.pbCanRun?(self.index)
                          pbBeginTurn(choice)
                          @battle.pbDisplay(_INTL("{1} fled!",self.pbThis))
                          @battle.decision=3
                          pbEndTurn(choice)
                          PBDebug.log("[Escape] #{pbThis} fled")
                          return true
                        end
                        # If this battler's action for this round wasn't "use a move"
                        if choice[0]!=1
                          # Clean up effects that end at battler's turn
                          pbBeginTurn(choice)
                          pbEndTurn(choice)
                          return false
                        end
                        # Turn is skipped if Pursuit was used during switch
                        if @effects[PBEffects::Pursuit]
                          @effects[PBEffects::Pursuit]=false
                          pbCancelMoves
                          pbEndTurn(choice)
                          @battle.pbJudge #      @battle.pbSwitch
                          return false
                        end
                        # Use the move
                    #   @battle.pbDisplayPaused("Before: [#{@lastMoveUsedSketch},#{@lastMoveUsed}]")
                        PBDebug.log("#{pbThis} used #{choice[2].name}")
                        PBDebug.logonerr{
                           pbUseMove(choice,choice[2]==@battle.struggle)
                        }
                    #   @battle.pbDisplayPaused("After: [#{@lastMoveUsedSketch},#{@lastMoveUsed}]")
                        return true
                      end

                    line 3400 end
                    Put your script between ['spoiler']['code']HERE, EXAMPLE['/code']['/spoiler'], without " ' "

                    So, Syntax error could be did you forgot to insert a 'end';'if'; 'elsif'; 'else' or something like that. Check your script again.
                    Reply With Quote
                      #11   Link to this post, but load the entire thread.  
                    Old 4 Weeks Ago (11:18 AM).
                    Diego Mertens's Avatar
                    Diego Mertens Diego Mertens is online now
                       
                      Join Date: Aug 2017
                      Posts: 54
                      the disguise script gives me this error:
                      ---------------------------
                      Error
                      ---------------------------
                      Script 'Interpreter' line 276: RuntimeError occurred.

                      Script error within event 9 (coords 31,17), map 103 (Ruta 2 Oeste):

                      Exception: NameError

                      Message: PokeBattle_Battler:1012:in `pbAbilitiesOnSwitchIn_ebs'undefined local variable or method `attacker' for #<PokeBattle_Battler:0xaf83d20>

                      ***Full script:

                      pbWildBattle(:MIMIKYU,4)


                      Interpreter:243:in `pbExecuteScript'

                      EliteBattle_0:541:in `pbAbilitiesOnSwitchIn'

                      PokeBattle_Battle:2082:in `pbOnActiveAll'

                      PokeBattle_Battle:2081:in `each'

                      PokeBattle_Battle:2081:in `pbOnActiveAll'

                      EliteBattle_0:256:in `pbStartBattleCore'

                      PokeBattle_Battle:2353:in `pbStartBattle'

                      PField_Battles:98:in `pbWildBattle_ebs'

                      PField_Battles:97:in `pbSceneStandby'

                      PField_Battles:99:in `pbWildBattle_ebs'


                      ---------------------------
                      Aceptar
                      ---------------------------
                      Reply With Quote
                        #12   Link to this post, but load the entire thread.  
                      Old 4 Weeks Ago (1:47 PM).
                      Poq's Avatar
                      Poq Poq is offline
                         
                        Join Date: Aug 2017
                        Posts: 93
                        Quote:
                        Originally Posted by Diego Mertens View Post
                        the disguise script gives me this error:
                        Spoiler:
                        ---------------------------
                        Error
                        ---------------------------
                        Script 'Interpreter' line 276: RuntimeError occurred.

                        Script error within event 9 (coords 31,17), map 103 (Ruta 2 Oeste):

                        Exception: NameError

                        Message: PokeBattle_Battler:1012:in `pbAbilitiesOnSwitchIn_ebs'undefined local variable or method `attacker' for #<PokeBattle_Battler:0xaf83d20>

                        ***Full script:

                        pbWildBattle(:MIMIKYU,4)


                        Interpreter:243:in `pbExecuteScript'

                        EliteBattle_0:541:in `pbAbilitiesOnSwitchIn'

                        PokeBattle_Battle:2082:in `pbOnActiveAll'

                        PokeBattle_Battle:2081:in `each'

                        PokeBattle_Battle:2081:in `pbOnActiveAll'

                        EliteBattle_0:256:in `pbStartBattleCore'

                        PokeBattle_Battle:2353:in `pbStartBattle'

                        PField_Battles:98:in `pbWildBattle_ebs'

                        PField_Battles:97:in `pbSceneStandby'

                        PField_Battles:99:in `pbWildBattle_ebs'


                        ---------------------------
                        Aceptar
                        ---------------------------
                        Spoiler:



                        So, I can't tell you exactly what's wrong with your script, but this error message references pbAbilitiesOnSwitchIn, which my script doesn't touch at all. So I would start there.
                        Reply With Quote
                          #13   Link to this post, but load the entire thread.  
                        Old 4 Weeks Ago (1:55 PM).
                        WolfPP's Avatar
                        WolfPP WolfPP is online now
                        Discord: Wolf#1235
                           
                          Join Date: Aug 2018
                          Location: Brazil
                          Gender: Male
                          Nature: Jolly
                          Posts: 251
                          Quote:
                          Originally Posted by Diego Mertens View Post
                          the disguise script gives me this error:
                          ---------------------------
                          Error
                          ---------------------------
                          Script 'Interpreter' line 276: RuntimeError occurred.

                          Script error within event 9 (coords 31,17), map 103 (Ruta 2 Oeste):

                          Exception: NameError

                          Message: PokeBattle_Battler:1012:in `pbAbilitiesOnSwitchIn_ebs'undefined local variable or method `attacker' for #<PokeBattle_Battler:0xaf83d20>

                          ***Full script:

                          pbWildBattle(:MIMIKYU,4)


                          Interpreter:243:in `pbExecuteScript'

                          EliteBattle_0:541:in `pbAbilitiesOnSwitchIn'

                          PokeBattle_Battle:2082:in `pbOnActiveAll'

                          PokeBattle_Battle:2081:in `each'

                          PokeBattle_Battle:2081:in `pbOnActiveAll'

                          EliteBattle_0:256:in `pbStartBattleCore'

                          PokeBattle_Battle:2353:in `pbStartBattle'

                          PField_Battles:98:in `pbWildBattle_ebs'

                          PField_Battles:97:in `pbSceneStandby'

                          PField_Battles:99:in `pbWildBattle_ebs'


                          ---------------------------
                          Aceptar
                          ---------------------------
                          Quote:
                          Originally Posted by Poq View Post
                          [/SPOILER]

                          So, I can't tell you exactly what's wrong with your script, but this error message references pbAbilitiesOnSwitchIn, which my script doesn't touch at all. So I would start there.
                          Its about EBS (Elite Battle System) script...
                          Reply With Quote
                            #14   Link to this post, but load the entire thread.  
                          Old 4 Weeks Ago (2:02 PM). Edited 4 Weeks Ago by Poq.
                          Poq's Avatar
                          Poq Poq is offline
                             
                            Join Date: Aug 2017
                            Posts: 93
                            Quote:
                            Originally Posted by WolfPP View Post
                            Its about EBS (Elite Battle System) script...
                            Ah, probably a good disclaimer then that I haven't tested this with EBS - only with base Essentials.

                            EDIT: but it still shouldn't interact with Abilities on Switch In
                            Reply With Quote
                              #15   Link to this post, but load the entire thread.  
                            Old 4 Weeks Ago (5:47 PM). Edited 4 Weeks Ago by WolfPP.
                            WolfPP's Avatar
                            WolfPP WolfPP is online now
                            Discord: Wolf#1235
                               
                              Join Date: Aug 2018
                              Location: Brazil
                              Gender: Male
                              Nature: Jolly
                              Posts: 251
                              Quote:
                              Originally Posted by Diego Mertens View Post
                              the disguise script gives me this error:
                              Spoiler:

                              ---------------------------
                              Error
                              ---------------------------
                              Script 'Interpreter' line 276: RuntimeError occurred.

                              Script error within event 9 (coords 31,17), map 103 (Ruta 2 Oeste):

                              Exception: NameError

                              Message: PokeBattle_Battler:1012:in `pbAbilitiesOnSwitchIn_ebs'undefined local variable or method `attacker' for #<PokeBattle_Battler:0xaf83d20>

                              ***Full script:

                              pbWildBattle(:MIMIKYU,4)


                              Interpreter:243:in `pbExecuteScript'

                              EliteBattle_0:541:in `pbAbilitiesOnSwitchIn'

                              PokeBattle_Battle:2082:in `pbOnActiveAll'

                              PokeBattle_Battle:2081:in `each'

                              PokeBattle_Battle:2081:in `pbOnActiveAll'

                              EliteBattle_0:256:in `pbStartBattleCore'

                              PokeBattle_Battle:2353:in `pbStartBattle'

                              PField_Battles:98:in `pbWildBattle_ebs'

                              PField_Battles:97:in `pbSceneStandby'

                              PField_Battles:99:in `pbWildBattle_ebs'


                              ---------------------------
                              Aceptar
                              ---------------------------
                              Done!

                              Just add ':DISGUISE' in 'if EFFECTMESSAGES' inside 'def pbAbilitiesOnSwitchIn(*args)':

                              Code:
                                def pbAbilitiesOnSwitchIn(*args)
                                  if self.checkForAbilities(:FRISK,:FOREWARN,:BADDREAMS,:MOODY,:HARVEST,:TRACE,:INTIMIDATE,
                                                            :GRASSYSURGE,:ELECTRICSURGE,:MISTYSURGE,:PSYCHICSURGE,:SOULHEART,
                                                            :BEASTBOOST,:DESOLATELAND,:PRIMORDIALSEA,:DISGUISE,:BATTLEBOND,
                                                            :POWERCONSTRUCT)
                                    @battle.abilityTrick = self
                                  else
                                    @battle.abilityMessage = self
                                  end
                                  ret = pbAbilitiesOnSwitchIn_ebs(*args)
                                  @battle.abilityTrick = nil
                                  @battle.abilityMessage = nil
                                  return ret    
                                end
                              Reply With Quote
                                #16   Link to this post, but load the entire thread.  
                              Old 4 Weeks Ago (2:43 PM).
                              Diego Mertens's Avatar
                              Diego Mertens Diego Mertens is online now
                                 
                                Join Date: Aug 2017
                                Posts: 54
                                Quote:
                                Originally Posted by WolfPP View Post
                                Done!

                                Just add ':DISGUISE' in 'if EFFECTMESSAGES' inside 'def pbAbilitiesOnSwitchIn(*args)':

                                Code:
                                  def pbAbilitiesOnSwitchIn(*args)
                                    if self.checkForAbilities(:FRISK,:FOREWARN,:BADDREAMS,:MOODY,:HARVEST,:TRACE,:INTIMIDATE,
                                                              :GRASSYSURGE,:ELECTRICSURGE,:MISTYSURGE,:PSYCHICSURGE,:SOULHEART,
                                                              :BEASTBOOST,:DESOLATELAND,:PRIMORDIALSEA,:DISGUISE,:BATTLEBOND,
                                                              :POWERCONSTRUCT)
                                      @battle.abilityTrick = self
                                    else
                                      @battle.abilityMessage = self
                                    end
                                    ret = pbAbilitiesOnSwitchIn_ebs(*args)
                                    @battle.abilityTrick = nil
                                    @battle.abilityMessage = nil
                                    return ret    
                                  end
                                it does not work... i got the same error
                                Reply With Quote
                                  #17   Link to this post, but load the entire thread.  
                                Old 4 Weeks Ago (4:10 PM). Edited 4 Weeks Ago by WolfPP.
                                WolfPP's Avatar
                                WolfPP WolfPP is online now
                                Discord: Wolf#1235
                                   
                                  Join Date: Aug 2018
                                  Location: Brazil
                                  Gender: Male
                                  Nature: Jolly
                                  Posts: 251
                                  Quote:
                                  Originally Posted by Diego Mertens View Post
                                  it does not work... i got the same error
                                  Maybe you have a custom wrong script or you didnt followed the steps correctly. Check again. Also, disguiste script dont have any 'attacker'.
                                  Reply With Quote
                                    #18   Link to this post, but load the entire thread.  
                                  Old 1 Week Ago (6:38 PM). Edited 1 Week Ago by Diego Mertens.
                                  Diego Mertens's Avatar
                                  Diego Mertens Diego Mertens is online now
                                     
                                    Join Date: Aug 2017
                                    Posts: 54
                                    I don´t know how but... It works now!
                                    but the animation and the message of "mimikyu transformed" shows before and after mimikyu do any move...
                                    Sometimes it shows twice
                                    Reply With Quote
                                      #19   Link to this post, but load the entire thread.  
                                    Old 1 Week Ago (7:39 PM).
                                    Poq's Avatar
                                    Poq Poq is offline
                                       
                                      Join Date: Aug 2017
                                      Posts: 93
                                      Quote:
                                      Originally Posted by Diego Mertens View Post
                                      I don´t know how but... It works now!
                                      but the animation and the message of "mimikyu transformed" shows before and after mimikyu do any move...
                                      Sometimes it shows twice
                                      Glad it's working!
                                      If you're getting the message twice, you can look in the scripts you edited and see if the message is in there more than once. If it is, just remove it from wherever it's firing inappropriately.
                                      A follow up question: is it possible that you had previously installed a Disguise script that uses a different method? That might lead to some of the issues you've encountered.
                                      Reply With Quote
                                        #20   Link to this post, but load the entire thread.  
                                      Old 1 Week Ago (5:58 PM).
                                      Diego Mertens's Avatar
                                      Diego Mertens Diego Mertens is online now
                                         
                                        Join Date: Aug 2017
                                        Posts: 54
                                        No, I didn't
                                        But i will check it :P
                                        Reply With Quote
                                          #21   Link to this post, but load the entire thread.  
                                        Old 1 Week Ago (6:05 PM).
                                        Diego Mertens's Avatar
                                        Diego Mertens Diego Mertens is online now
                                           
                                          Join Date: Aug 2017
                                          Posts: 54
                                          Mmmmh... I was looking for something like that but... What i have to search? I'm not sure. Did I have to search the "trasformed!" line, or the transform animation?
                                          Reply With Quote
                                            #22   Link to this post, but load the entire thread.  
                                          Old 1 Week Ago (1:05 AM).
                                          Juno and Ice's Avatar
                                          Juno and Ice Juno and Ice is offline
                                             
                                            Join Date: May 2018
                                            Gender: Male
                                            Posts: 51
                                            Mimikyu gets it's disguise back when it gets switched out. I don't think that's supposed to happen, unless I'm wrong.
                                            Reply With Quote
                                              #23   Link to this post, but load the entire thread.  
                                            Old 1 Week Ago (2:13 AM).
                                            WolfPP's Avatar
                                            WolfPP WolfPP is online now
                                            Discord: Wolf#1235
                                               
                                              Join Date: Aug 2018
                                              Location: Brazil
                                              Gender: Male
                                              Nature: Jolly
                                              Posts: 251
                                              https://m.bulbapedia.bulbagarden.net/wiki/Disguise_(Ability)
                                              Reply With Quote
                                                #24   Link to this post, but load the entire thread.  
                                              Old 1 Week Ago (4:24 AM). Edited 1 Week Ago by Poq.
                                              Poq's Avatar
                                              Poq Poq is offline
                                                 
                                                Join Date: Aug 2017
                                                Posts: 93
                                                Quote:
                                                Originally Posted by Diego Mertens View Post
                                                Mmmmh... I was looking for something like that but... What i have to search? I'm not sure. Did I have to search the "trasformed!" line, or the transform animation?
                                                I would just search for the message that is displaying twice. The one I coded has the line "disguise was busted" so you could search for that.
                                                Now, in my script there are two messages, but they are different:
                                                1. Mimikyu's disguise served as a decoy
                                                2. Mimikyu's disguise was busted.
                                                If you're getting the exact same message twice, something probably got added wrong.


                                                Quote:
                                                Originally Posted by Juno and Ice View Post
                                                Mimikyu gets it's disguise back when it gets switched out. I don't think that's supposed to happen, unless I'm wrong.
                                                No, you're right; it shouldn't get it's disguise back. That didn't happen when I tested it though. If you're running into that problem, then for some reason your script is not changing the actual Pokemon's form, just the Battler. (In Essentials, the in battle Pokemon is actually just a copy of the party Pokemon).
                                                Make sure that you have these scripts defined in class PokeBattle_Pokemon (mine were in the script section for Mega Evolution, but it should be the same class).
                                                Spoiler:
                                                Code:
                                                  def makeBusted
                                                    f = self.getBustedForm
                                                    self.form = f
                                                  end
                                                
                                                  def getBustedForm
                                                    if isConst?(self.species,PBSpecies,:MIMIKYU) && self.hasAbility?(:DISGUISE)
                                                      return 1 
                                                    else
                                                      return-1
                                                    end
                                                  end
                                                Reply With Quote
                                                  #25   Link to this post, but load the entire thread.  
                                                Old 1 Week Ago (11:14 AM). Edited 1 Week Ago by Juno and Ice.
                                                Juno and Ice's Avatar
                                                Juno and Ice Juno and Ice is offline
                                                   
                                                  Join Date: May 2018
                                                  Gender: Male
                                                  Posts: 51
                                                  Quote:
                                                  No, you're right; it shouldn't get it's disguise back. That didn't happen when I tested it though. If you're running into that problem, then for some reason your script is not changing the actual Pokemon's form, just the Battler. (In Essentials, the in battle Pokemon is actually just a copy of the party Pokemon).
                                                  Make sure that you have these scripts defined in class PokeBattle_Pokemon (mine were in the script section for Mega Evolution, but it should be the same class).
                                                  Spoiler:
                                                  Code:
                                                    def makeBusted
                                                      f = self.getBustedForm
                                                      self.form = f
                                                    end
                                                  
                                                    def getBustedForm
                                                      if isConst?(self.species,PBSpecies,:MIMIKYU) && self.hasAbility?(:DISGUISE)
                                                        return 1 
                                                      else
                                                        return-1
                                                      end
                                                    end
                                                  I deleted and re-inserted all the scripts and it's still reverting back to it's disguised form when switched out. Is there anything I'm still missing? Maybe something with the PBS files?
                                                  I don't know, I'm really confused here.
                                                  Reply With Quote
                                                  Reply

                                                  Quick Reply

                                                  Join the conversation!

                                                  Create an account to post a reply in this thread, participate in other discussions, and more!

                                                  Create a PokéCommunity Account
                                                  Ad Content
                                                  Thread Tools

                                                  Posting Rules
                                                  You may not post new threads
                                                  You may not post replies
                                                  You may not post attachments
                                                  You may not edit your posts

                                                  BB code is On
                                                  Smilies are On
                                                  [IMG] code is On
                                                  HTML code is Off

                                                  Forum Jump


                                                  All times are GMT -8. The time now is 9:56 AM.