zedcoeur
Zed Coeur
- 29
- Posts
- 5
- Years
- Seen Apr 15, 2022
Hello, everyone. I'm currently dealing with a situation where my Fight menu for battles doesn't properly wrap back to the top-most when I input DOWN at the bottom-most move.
This is the code I'm currently using:
and this is the error I'm getting:
[Pokémon Essentials version 19.1]
[Generation 8 Project v1.0.1]
Exception: NoMethodError
Message: undefined method `total_pp' for nil:NilClass
Backtrace:
388:SU SceneMenus:368:in `refreshMoveData'
388:SU SceneMenus:351:in `refreshSelection'
388:SU SceneMenus:394:in `refresh'
388:SU SceneMenus:64:in `index='
390:SU SceneCommands:104:in `block in pbFightMenu'
390:SU SceneCommands:78:in `loop'
390:SU SceneCommands:78:in `pbFightMenu'
182:Battle_Phase_Command:67:in `pbFightMenu'
182:Battle_Phase_Command:215:in `block (2 levels) in pbCommandPhaseLoop'
182:Battle_Phase_Command:206:in `loop'
This is the code I'm currently using:
Code:
if Input.trigger?(Input::UP)
cw.index -= 1
if cw.index<Pokemon::MAX_MOVES && cw.index>=battler.pokemon.numMoves
cw.index = battler.pokemon.numMoves-1
end
cw.index = 0 if cw.index>=Pokemon::MAX_MOVES
cw.index = battler.pokemon.numMoves-1 if cw.index<0
elsif Input.trigger?(Input::DOWN)
cw.index += 1
cw.index = 0 if cw.index<Pokemon::MAX_MOVES && cw.index>=battler.pokemon.numMoves
cw.index = 0 if cw.index==Pokemon::MAX_MOVES
cw.index = Pokemon::MAX_MOVES if cw.index<0
end
and this is the error I'm getting:
[Pokémon Essentials version 19.1]
[Generation 8 Project v1.0.1]
Exception: NoMethodError
Message: undefined method `total_pp' for nil:NilClass
Backtrace:
388:SU SceneMenus:368:in `refreshMoveData'
388:SU SceneMenus:351:in `refreshSelection'
388:SU SceneMenus:394:in `refresh'
388:SU SceneMenus:64:in `index='
390:SU SceneCommands:104:in `block in pbFightMenu'
390:SU SceneCommands:78:in `loop'
390:SU SceneCommands:78:in `pbFightMenu'
182:Battle_Phase_Command:67:in `pbFightMenu'
182:Battle_Phase_Command:215:in `block (2 levels) in pbCommandPhaseLoop'
182:Battle_Phase_Command:206:in `loop'