• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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] "stack level too deep" When Intimidate is activated

71
Posts
4
Years
  • I'm having this error every time I send a Pokémon that has the ability "Intimidate".

    Code:
    [Pokémon Essentials version 20.1]
    [v20.1 Hotfixes 1.0.7]
    
    Script error in Common Event, map 91 (Ruta 21)
    Exception: SystemStackError
    Message: stack level too deep
    
    ***Full script:
    $player.coins +=650
    pbToneChangeAll(
      Tone.new(0, 0, 0, 0),
      10)
    WildBattle.start(:MEW, 30)
    
    Backtrace:
    015:Validation:18:in `block (2 levels) in validate'
    015:Validation:18:in `any?'
    015:Validation:18:in `block in validate'
    015:Validation:16:in `each'
    015:Validation:16:in `map'
    015:Validation:16:in `validate'
    103:GameData:103:in `try_get'
    160:Battle_Battler:65:in `ability'
    160:Battle_Battler:349:in `hasActiveAbility?'
    147:Battle:490:in `block in pbCheckGlobalAbility'

    I honestly don't know why since I haven't coded anything around this ability, and similar abilities, like Download, work perfectly.

    Where should I start looking?
     

    Swdfm

    Game Developer
    245
    Posts
    5
    Years
    • he/him
    • UK
    • Seen Dec 8, 2023
    Hi @SuzuiXii

    It seems the issue is not with Intimidate alone, but with another ability that checks everyone on the field, like Damp or Cloud Nine. Maybe it is related to Intimidate. It is a pity that I cannot see the next line of the error message, because then I would be able to figure out what ability it is.
    A stack error means that the same code keeps running in an infinite loop, usually in a method that refers to itself over and over again.

    So, to diagnose the problem, in "Battle" page, after line:
    def pbCheckGlobalAbility(abil)

    put echoln abil.to_s

    And then run the game in debug mode, replicating the error as normal
    The last ability as listed on the debug engine thing provides the next step to the problem.

    Hope this helps,
    Swdfm
     
    Back
    Top