• 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.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Serena, Kris, Dawn, Red - which Pokémon protagonist is your favorite? Let us know by voting in our grand final favorite protagonist poll!
  • PokéCommunity supports the Stop Killing Games movement. If you're a resident of the UK or EU, consider signing one of the petitions to stop publishers from destroying games. Click here for more information!
  • 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] Now even the default unchanged scripts have crash-causing errors?!

  • 413
    Posts
    5
    Years
    I download Pokemon Essentials, start a battle, and... I get this error message the second I try fighting the version of Brock that came with the engine version by default. Or any other trainer. Ever.

    Code:
    [Pokémon Essentials version 20.1]
    
    Script error in event 5 (coords 27,4), map 3 (Aaa's house)
    Exception: NameError
    Message: wrong constant name Battle::Move::
    
    ***Full script:
    TrainerBattle.start(:LEADER_Brock, "Brock")
    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'

    Here's the code it points to and everything is unchanged from the default.

    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

    Code:
    [Pokémon Essentials version 20.1]
    
    Exception: NameError
    Message: wrong constant name Battle::Move::
    
    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'
    151:Battle_ActionSwitching:277:in `pbReplace'
    151:Battle_ActionSwitching:224:in `pbRecallAndReplace'

    Let me know when somebody figures out how to make the engine work.
     
    Last edited:
    I am stuck in 2020, I still use v18 lol, but when I read the error message, it looks like there's a move that doesn't have an associated class with it. Do you know what move causes this?
    In the PBS file for moves (probably still called moves.txt but I don't know) there is probably a move that misses a line in its definition. I see in the docs that it should have a "FunctionCode = Something" line, I assume that either this line is missing, or is left empty in one of the moves.
     
    They changed the pbs for moves quite a bit in v20, but it functions the same.

    That middle script says "Battle::Move::". Isn't that code from an older version? Shouldn't it be "Battle_Move" like in the bottom code? Did you update your scripts to v20? Or download an old plugin?

    Unfortunately I'll be away from my computer for a week, so I can't check my v20 scripts to confirm thats the problem, but its a start.
     
    Turns out this error was because I'd coded some Pokemon moves wrong. If they were on my party's Pokemon, the crash happened. I've fixed the two moves that were causing the errors.
     
    Back
    Top