- 428
- Posts
- 5
- Years
- Zekko
- Seen Nov 21, 2023
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:
This is the error message:
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:
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: