• 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] 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