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

[Error] Help! I keep getting this error while I try to start a Pokemon Battle

13
Posts
11
Years
    • He/Him
    • Seen Apr 21, 2022
    ---------------------------
    Pokemon Guardians Rising
    ---------------------------
    [Pokémon Essentials version 17.2]

    Exception: NameError

    Message: uninitialized constant PBEffects::CraftyShield

    PokeBattle_ActiveSideField:8:in `initialize'

    PokeBattle_Battle:285:in `new'

    PokeBattle_Battle:285:in `initialize'

    PField_Battles:91:in `new'

    PField_Battles:91:in `pbWildBattle'

    Debug_Menu:301:in `pbDebugMenuActions'

    Debug_Menu:744:in `pbDebugMenu'

    Debug_Menu:710:in `loop'

    Debug_Menu:746:in `pbDebugMenu'

    PScreen_PauseMenu:251:in `pbStartPokemonMenu'


    I'm not sure what's wrong. I compared it to multiple other brand newly downloaded copies but they're identical.
     
    286
    Posts
    5
    Years
    • Seen May 15, 2024
    Did you put Crafty Shield's effect in the PBEffects and Pokebattle_ActiveSideField script sections?
     
    286
    Posts
    5
    Years
    • Seen May 15, 2024
    If you did that correctly, then I don't know why it wouldn't work. I'm pretty sure this error means that the problem is in PBEffects, so all you should have to do is assign the CraftyShield effect a number that no other effect has that applies to a side has.
     
    13
    Posts
    11
    Years
    • He/Him
    • Seen Apr 21, 2022
    If you did that correctly, then I don't know why it wouldn't work. I'm pretty sure this error means that the problem is in PBEffects, so all you should have to do is assign the CraftyShield effect a number that no other effect has that applies to a side has.

    I literally went to PBActiveSideField and took the

    def initialize

    and changed it to

    def initialized

    and it fixed the problem...how? I'm not sure.

    But thank you for giving me the idea. I have a new problem now which is

    ---------------------------
    [Pokémon Essentials version 17.2]

    Exception: NoMethodError

    Message: undefined method `each' for false:FalseClass

    PokeBattle_Battle:335:in `initialize'

    PField_Battles:91:in `new'

    PField_Battles:91:in `pbWildBattle'

    Debug_Menu:301:in `pbDebugMenuActions'

    Debug_Menu:744:in `pbDebugMenu'

    Debug_Menu:710:in `loop'

    Debug_Menu:746:in `pbDebugMenu'

    PScreen_PauseMenu:251:in `pbStartPokemonMenu'

    PScreen_PauseMenu:250:in `pbFadeOutIn'

    PScreen_PauseMenu:250:in `pbStartPokemonMenu'

    Any ideas?
     
    286
    Posts
    5
    Years
    • Seen May 15, 2024
    I literally went to PBActiveSideField and took the

    def initialize

    and changed it to

    def initialized

    and it fixed the problem...how? I'm not sure.

    But thank you for giving me the idea. I have a new problem now which is

    ---------------------------
    [Pokémon Essentials version 17.2]

    Exception: NoMethodError

    Message: undefined method `each' for false:FalseClass

    PokeBattle_Battle:335:in `initialize'

    PField_Battles:91:in `new'

    PField_Battles:91:in `pbWildBattle'

    Debug_Menu:301:in `pbDebugMenuActions'

    Debug_Menu:744:in `pbDebugMenu'

    Debug_Menu:710:in `loop'

    Debug_Menu:746:in `pbDebugMenu'

    PScreen_PauseMenu:251:in `pbStartPokemonMenu'

    PScreen_PauseMenu:250:in `pbFadeOutIn'

    PScreen_PauseMenu:250:in `pbStartPokemonMenu'

    Any ideas?

    I don't think it fixed the problem. I think you just took away a constructor for that class, and since the "initialized" method is not used, there will be no error from Crafty Shield from it. The new error you're getting is probably from removing the "def initialize" constructor.

    EDIT: Also, if you're using essentials v17, doesn't that already include Crafty Shield?
     
    Last edited:
    13
    Posts
    11
    Years
    • He/Him
    • Seen Apr 21, 2022
    I don't think it fixed the problem. I think you just took away a constructor for that class, and since the "initialized" method is not used, there will be no error from Crafty Shield from it. The new error you're getting is probably from removing the "def initialize" constructor.

    EDIT: Also, if you're using essentials v17, doesn't that already include Crafty Shield?

    That would explain the new issue then.

    I am using v17. I didn't touch Crafty Shield and when I remove it, it moves on to the next move. I'm not too sure what the issue is, I know it's in Pokebattle_ActiveSideField I'm just not sure how.
     
    Last edited:
    286
    Posts
    5
    Years
    • Seen May 15, 2024
    Can you send the part in your PBEffects script under "# These effects apply to a side" and the part in the Pokebattle_ActiveSideField script under the first "def initialize"?
     
    13
    Posts
    11
    Years
    • He/Him
    • Seen Apr 21, 2022
    Can you send the part in your PBEffects script under "# These effects apply to a side" and the part in the Pokebattle_ActiveSideField script under the first "def initialize"?

    ############################################################################
    # These effects apply to a side
    CraftyShield = 0
    EchoedVoiceCounter = 1
    EchoedVoiceUsed = 2
    LastRoundFainted = 3
    LightScreen = 4
    LuckyChant = 5
    MatBlock = 6
    Mist = 7
    QuickGuard = 8
    Rainbow = 9
    Reflect = 10
    Round = 11
    Safeguard = 12
    SeaOfFire = 13
    Spikes = 14
    StealthRock = 15
    StickyWeb = 16
    Swamp = 17
    Tailwind = 18
    ToxicSpikes = 19
    WideGuard = 20
    AuroraVeil = 21

    def initialize

    @effects = []
    @effects[PBEffects::CraftyShield] = false
    @effects[PBEffects::EchoedVoiceCounter] = 0
    @effects[PBEffects::EchoedVoiceUsed] = false
    @effects[PBEffects::LastRoundFainted] = -1
    @effects[PBEffects::LightScreen] = 0
    @effects[PBEffects::LuckyChant] = 0
    @effects[PBEffects::MatBlock] = false
    @effects[PBEffects::Mist] = 0
    @effects[PBEffects::QuickGuard] = false
    @effects[PBEffects::Rainbow] = 0
    @effects[PBEffects::Reflect] = 0
    @effects[PBEffects::AuroraVeil] = 0
    @effects[PBEffects::Round] = 0
    @effects[PBEffects::Safeguard] = 0
    @effects[PBEffects::SeaOfFire] = 0
    @effects[PBEffects::Spikes] = 0
    @effects[PBEffects::StealthRock] = false
    @effects[PBEffects::StickyWeb] = false
    @effects[PBEffects::Swamp] = 0
    @effects[PBEffects::Tailwind] = 0
    @effects[PBEffects::ToxicSpikes] = 0
    @effects[PBEffects::WideGuard] = false
    end
    end
     
    Last edited:
    286
    Posts
    5
    Years
    • Seen May 15, 2024
    ############################################################################
    # These effects apply to a side
    CraftyShield = 0
    EchoedVoiceCounter = 1
    EchoedVoiceUsed = 2
    LastRoundFainted = 3
    LightScreen = 4
    LuckyChant = 5
    MatBlock = 6
    Mist = 7
    QuickGuard = 8
    Rainbow = 9
    Reflect = 10
    Round = 11
    Safeguard = 12
    SeaOfFire = 13
    Spikes = 14
    StealthRock = 15
    StickyWeb = 16
    Swamp = 17
    Tailwind = 18
    ToxicSpikes = 19
    WideGuard = 20
    AuroraVeil = 21

    That looks good. Is this what the code looks like for you in Pokebattle_ActiveSideField for the ActiveSide part?
    Code:
    begin
      class PokeBattle_ActiveSide
        attr_accessor :effects
    
        def initialize
          @effects = []
          @effects[PBEffects::CraftyShield]       = false
          @effects[PBEffects::EchoedVoiceCounter] = 0
          @effects[PBEffects::EchoedVoiceUsed]    = false
          @effects[PBEffects::LastRoundFainted]   = -1
          @effects[PBEffects::LightScreen]        = 0
          @effects[PBEffects::AuroraVeil]         = 0
          @effects[PBEffects::LuckyChant]         = 0
          @effects[PBEffects::MatBlock]           = false
          @effects[PBEffects::Mist]               = 0
          @effects[PBEffects::QuickGuard]         = false
          @effects[PBEffects::Rainbow]            = 0
          @effects[PBEffects::Reflect]            = 0
          @effects[PBEffects::Round]              = 0
          @effects[PBEffects::Safeguard]          = 0
          @effects[PBEffects::SeaOfFire]          = 0
          @effects[PBEffects::Spikes]             = 0
          @effects[PBEffects::StealthRock]        = false
          @effects[PBEffects::StickyWeb]          = false
          @effects[PBEffects::Swamp]              = 0
          @effects[PBEffects::Tailwind]           = 0
          @effects[PBEffects::ToxicSpikes]        = 0
          @effects[PBEffects::WideGuard]          = false
        end
      end
     
    13
    Posts
    11
    Years
    • He/Him
    • Seen Apr 21, 2022
    That looks good. Is this what the code looks like for you in Pokebattle_ActiveSideField for the ActiveSide part?
    Code:
    begin
      class PokeBattle_ActiveSide
        attr_accessor :effects
    
        def initialize
          @effects = []
          @effects[PBEffects::CraftyShield]       = false
          @effects[PBEffects::EchoedVoiceCounter] = 0
          @effects[PBEffects::EchoedVoiceUsed]    = false
          @effects[PBEffects::LastRoundFainted]   = -1
          @effects[PBEffects::LightScreen]        = 0
          @effects[PBEffects::AuroraVeil]         = 0
          @effects[PBEffects::LuckyChant]         = 0
          @effects[PBEffects::MatBlock]           = false
          @effects[PBEffects::Mist]               = 0
          @effects[PBEffects::QuickGuard]         = false
          @effects[PBEffects::Rainbow]            = 0
          @effects[PBEffects::Reflect]            = 0
          @effects[PBEffects::Round]              = 0
          @effects[PBEffects::Safeguard]          = 0
          @effects[PBEffects::SeaOfFire]          = 0
          @effects[PBEffects::Spikes]             = 0
          @effects[PBEffects::StealthRock]        = false
          @effects[PBEffects::StickyWeb]          = false
          @effects[PBEffects::Swamp]              = 0
          @effects[PBEffects::Tailwind]           = 0
          @effects[PBEffects::ToxicSpikes]        = 0
          @effects[PBEffects::WideGuard]          = false
        end
      end

    Mine looks like

    def initialize

    @effects = []
    @effects[PBEffects::CraftyShield] = false
    @effects[PBEffects::EchoedVoiceCounter] = 0
    @effects[PBEffects::EchoedVoiceUsed] = false
    @effects[PBEffects::LastRoundFainted] = -1
    @effects[PBEffects::LightScreen] = 0
    @effects[PBEffects::LuckyChant] = 0
    @effects[PBEffects::MatBlock] = false
    @effects[PBEffects::Mist] = 0
    @effects[PBEffects::QuickGuard] = false
    @effects[PBEffects::Rainbow] = 0
    @effects[PBEffects::Reflect] = 0
    @effects[PBEffects::AuroraVeil] = 0
    @effects[PBEffects::Round] = 0
    @effects[PBEffects::Safeguard] = 0
    @effects[PBEffects::SeaOfFire] = 0
    @effects[PBEffects::Spikes] = 0
    @effects[PBEffects::StealthRock] = false
    @effects[PBEffects::StickyWeb] = false
    @effects[PBEffects::Swamp] = 0
    @effects[PBEffects::Tailwind] = 0
    @effects[PBEffects::ToxicSpikes] = 0
    @effects[PBEffects::WideGuard] = false
    end
    end


    Also, I tried copying your page but it still didn't work
     
    286
    Posts
    5
    Years
    • Seen May 15, 2024
    That's really strange. I'm not sure why you're getting this error then, especially if you're on essentials v17. Sorry I couldn't be of more help.
     
    Back
    Top