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

Status Inducing Weather not working

220
Posts
13
Years
    • Seen Nov 29, 2021
    When I try this, I get a NoMethodError. I'm guessing this is because i.pbParalysis isn't a thing, but I don't know what to replace it with.
    Code:
       when PBWeather::TESLASTORM
          @weatherduration=@weatherduration-1 if @weatherduration>0
          if @weatherduration==0
            pbDisplay(_INTL("The air returned to normal."))
            @weather=0
            PBDebug.log("[End of effect] Ionized weather ended")
          else
            if pbWeather==PBWeather::TESLASTORM
              PBDebug.log("[Lingering effect triggered] Ionized weather damage")
              for i in priority
                next if i.isFainted?
                if !i.pbHasType?(:ELECTRIC) &&
                   !i.pbHasType?(:GROUND) &&
                   !i.hasWorkingAbility(:LIGHTNINGROD) &&
                   !i.hasWorkingAbility(:STATIC) &&
                   !i.hasWorkingAbility(:MAGICGUARD) &&
                   !i.hasWorkingAbility(:OVERCOAT) &&
                   !i.hasWorkingAbility(:VOLTABSORB) &&
                   !i.hasWorkingAbility(:MOTORDRIVE) &&
                   !i.hasWorkingItem(:SAFETYGOGGLES) &&
                   ![0xCA,0xCB].include?(PBMoveData.new(i.effects[PBEffects::TwoTurnAttack]).function) # Dig, Dive
                  @scene.pbDamageAnimation(i,0)
                  if i.status==0
                    PBDebug.log("[Lingering effect triggered] #{i.pbThis}'s Ionize")
                    i.pbParalysis
                  end
                  pbDisplay(_INTL("{1} is shocked by the air!",i.pbThis))
                  if i.isFainted?
                    return if !i.pbFaint
                  end
                end
              end
            end
          end
     
    129
    Posts
    8
    Years
    • Seen Mar 23, 2023
    PokeBattle_BattlerEffects: Line 323

    Code:
    def pbCanParalyze?(attacker,showMessages,move=nil)
    #[...]
    def pbParalyze(attacker,msg=nil)
    You should check if it can be paralyzed first with the first method, then call i.pbParalyze(nil, _INTL("{1} is shocked by the air!",i.pbThis) or just i.pbParalyze(nil) for the normal text.

    Having the scripts all copied to disk for easy searching is amazing. :P

    EDIT: Also, if your storm isn't reducing HP, the call for a faint check isn't needed.
     
    Last edited:
    220
    Posts
    13
    Years
    • Seen Nov 29, 2021
    i.pbParalyze works fine, thanks, but I'm having trouble figuring out pbCanParalyze.
    pbCanParalyze?(attacker,showMessages,move=nil) throws up an error that, I think, translates to "What is attacker?"
    pbCanParalyze?(nil) simply fails to compile.
     
    129
    Posts
    8
    Years
    • Seen Mar 23, 2023
    What I pasted are the definitions of the methods. You're supposed to fill in your own values...

    In your case, you probably want

    Code:
    pbCanParalyze?(nil,false)

    The false tells the method that you don't want things like "But it failed!" printed if it can't paralyze the pokemon.
     
    220
    Posts
    13
    Years
    • Seen Nov 29, 2021
    I figured as much, I just couldn't work out what to put. My knowledge of ruby is entirely deductive at this point.
    Thanks.

    EDIT: that's still producing:
    Exception: NoMethodError
    Message: undefined method `pbCanParalyze?' for #<PokeBattle_Battle:0xd968898>

    EDIT 2: Went out on a whim and stuck i. in front of it. Works now.
     
    Last edited:
    129
    Posts
    8
    Years
    • Seen Mar 23, 2023
    Glad you worked it out. I keep going into these questions about coding various things with the assumption that if people are messing around with the code, they generally know or can figure their way around the language. I realize that's probably not always a safe assumption to make, so sorry about that. :/
     
    129
    Posts
    8
    Years
    • Seen Mar 23, 2023
    You can search all script sections with Ctrl+Shift+F, if you weren't aware.

    I wasn't aware of that back when I took an hour to copy all the scripts off to disk. I found out accidentally later. Even still, using Sublime Text to search and have open a dozen files to cross reference is still far superior to what RMXP's script editor gives us. Now if only I could edit in Sublime and have it affect my project...
     
    Back
    Top