• 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!
  • 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] My game crashes whenever I gain exp.

  • 35
    Posts
    4
    Years
    • Seen Jun 1, 2022
    Please help my game just crashes whenever I level up or gain exp but I didn't change those parts of the scripts.

    Here is the error message.

    [Pokémon Essentials version 18.1.dev]
    Exception: NoMethodError
    Message: undefined method `+' for nil:NilClass

    Backtrace:
    Move_Usage:341:in `pbRecordDamageLost'
    Battler_UseMove:697:in `pbProcessMoveHit'
    Battler_UseMove:692:in `each'
    Battler_UseMove:692:in `pbProcessMoveHit'
    Battler_UseMove:431:in `pbUseMove'
    Battler_UseMove:429:in `each'
    Battler_UseMove:429:in `pbUseMove'
    Battler_UseMove:60:in `pbProcessTurn'
    Battler_UseMove:59:in `logonerr'
    Battler_UseMove:59:in `pbProcessTurn'
     
    Code:
      def pbRecordDamageLost(user,target)
        damage = target.damageState.hpLost
        target.yamaskhp+= damage # Line 341

    So, I looked at the code, and the error says that either target.yamaskhp or damage is nil. target.yamaskhp should always be an integer (default value is 0).
    You say you didn't change those parts of the script; did you change anything that alters target.damageState or target.yamaskhp?
     
    I added the lavender town ghosts script which made it so I couldn't attack a non ghost so the game crashed. I removed the script and it works now.
     
    Back
    Top