• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Trading Card Game 2 protagonist in the poll by clicking here.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Error] Game crashes when I battle a Rocket Grunt. How do I fix this?

  • 428
    Posts
    5
    Years
    Starting a battle with the NPC crashed the game with the error message pasted below, so I copied him and deleted everything except the "start battle" command. Talking to this NPC and starting a battle still crashes the game. He's just a rocket grunt and his only code is:

    Code:
    Conditional Branch: Script: TrainerBattle.start(:TEAMROCKET_M,"Grunt",1)
    Else
    Exit Event Processing
    Branch End

    This is the error message:

    Code:
    [Pokémon Essentials version 20.1]
    
    [v20.1 Hotfixes 1.0.7]
    
    Script error in event 11 (coords 6,6), map 22 (Pokémon League entrance)
    
    Exception: NameError
    
    Message: wrong constant name Battle::Move::
    
    ***Full script:
    
    TrainerBattle.start(:TEAMROCKET_M,"Grunt",1)
    
    Backtrace:
    
    172:Battle_Move:58:in `const_defined?'
    
    172:Battle_Move:58:in `from_pokemon_move'
    
    161:Battler_Initialize:89:in `block in pbInitPokemon'
    
    161:Battler_Initialize:88:in `each'
    
    161:Battler_Initialize:88:in `each_with_index'
    
    161:Battler_Initialize:88:in `pbInitPokemon'
    
    267:ShadowPokemon_Other:196:in `pbInitPokemon'
    
    161:Battler_Initialize:61:in `pbInitialize'
    
    148:Battle_StartAndEnd:117:in `pbCreateBattler'
    
    148:Battle_StartAndEnd:153:in `block (3 levels) in pbSetUpSides'

    If it helps, "if Object.const_defined?(class_name)" is at Battle_Move line 58 and it looks fine to me. I don't see what could be causing the crash.

    Code:
      # This is the code actually used to generate a Battle::Move object. The
      # object generated is a subclass of this one which depends on the move's
      # function code.
      def self.from_pokemon_move(battle, move)
        validate move => Pokemon::Move
        code = move.function_code || "None"
        if code[/^\d/]   # Begins with a digit
          class_name = sprintf("Battle::Move::Effect%s", code)
        else
          class_name = sprintf("Battle::Move::%s", code)
        end
        if Object.const_defined?(class_name)
          return Object.const_get(class_name).new(battle, move)
        end
        return Battle::Move::Unimplemented.new(battle, move)
      end
     
    Last edited:
    Back
    Top