• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Scripting Question] Darmanitan Changing Back

  • 68
    Posts
    4
    Years
    • Seen Nov 9, 2023
    Does anyone know how to make it so Unovian and Galarian Zen Mode will turn back into their respective Standard Modes? I've tried many times, but it always ends with both of them changing back to the same form every time.
     
  • 1,682
    Posts
    8
    Years
    • Seen today
    You probably need to edit def pbResetForm and def pbCheckForm in the PokeBattle_Battler script section, to check the current form and change it to the right one.
     
  • 68
    Posts
    4
    Years
    • Seen Nov 9, 2023
    I know, I've tried editing those sections multiple times, but nothing seems to work for me. I was wondering if anyone had a working script for this, because nothing I do seems to work.
     
  • 286
    Posts
    5
    Years
    • Seen May 15, 2024
    I have a script that seems to be working. Find '# Zen Mode', replace the code for it with this:
    Code:
        # Zen Mode
        if isConst?(self.species,PBSpecies,:DARMANITAN)
          if self.hasWorkingAbility(:ZENMODE) && @hp<=((@totalhp/2).floor)
            if self.form==0
              self.form=1; transformed=true
            elsif self.form==2
              self.form=3; transformed=true
            end
          else
            if self.form==1
              self.form=0; transformed=true
            elsif self.form==3
              self.form=2; transformed=true
            end
          end
        end
    This assumes that you have Galarian Darmanitan as form 2 and Zen Mode Galarian Darmanitan as form 3.
     

    WolfPP

    Spriter/ Pixel Artist
  • 1,309
    Posts
    5
    Years
    I made a better code for it. Zen Mode will only be activated when start the battle and into the end of round (instead turn). Check here.
     
  • 68
    Posts
    4
    Years
    • Seen Nov 9, 2023
    I still don't know how to make it so it resets to the right form after battle. Right now, it keeps resetting to the Unovian Standard Mode, even if it was a Galarian Form.
     
  • 286
    Posts
    5
    Years
    • Seen May 15, 2024
    I still don't know how to make it so it resets to the right form after battle. Right now, it keeps resetting to the Unovian Standard Mode, even if it was a Galarian Form.

    Ah yes, you're right. I forgot to include that. I think it will work if you find 'def pbResetForm' and replace it with this:
    Code:
      def pbResetForm
        if !@effects[PBEffects::Transform]
          if isConst?(self.species,PBSpecies,:CASTFORM) ||
             isConst?(self.species,PBSpecies,:CHERRIM) ||
             isConst?(self.species,PBSpecies,:MELOETTA) ||
             isConst?(self.species,PBSpecies,:AEGISLASH) ||
             isConst?(self.species,PBSpecies,:XERNEAS) ||
             isConst?(self.species,PBSpecies,:GRENINJA) ||
             isConst?(self.species,PBSpecies,:CRAMORANT) ||
             isConst?(self.species,PBSpecies,:MIMIKYU)
            self.form=0
          end
          if isConst?(self.species,PBSpecies,:DARMANITAN)
            if self.form==1 || self.form==3
              self.form-=1
            end
          end
        end
        pbUpdate(true)
      end
     

    WolfPP

    Spriter/ Pixel Artist
  • 1,309
    Posts
    5
    Years
    Your script seems to work, but one problem is that it keeps showing the transformed message every turn.

    Or you installed wrong:

    Darmanitan Changing Back
     
  • 68
    Posts
    4
    Years
    • Seen Nov 9, 2023
    Or you installed wrong:
    Darmanitan Changing Back

    The problem I'm having with your script is that whenever Zygarde becomes complete and I switch it out, it stays Complete once the battle ends. It only resets its form if I don't switch it out.
     
  • 658
    Posts
    7
    Years
    The problem I'm having with your script is that whenever Zygarde becomes complete and I switch it out, it stays Complete once the battle ends. It only resets its form if I don't switch it out.

    In the start of the script, he gave the link to multiple scripts he has used and edited. Wolf's script isn't a standalone script, its edits of the scripts he has linked above. You need to add those and then add Wolf's Edits.
     
    Back
    Top