• 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!
  • Which Pokémon Masters protagonist do you like most? Let us know by casting a vote in our Masters favorite protagonist poll here!
  • 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.

[Question] DAYCARE Error - Stack Level

Takako Rune

Hack Player
  • 51
    Posts
    8
    Years
    • Seen Sep 8, 2021
    Hi there.
    Whenever I receive an egg from the daycare I get the error below.
    The daycare script is untouched. Perhaps the problem is in the Pokemon PBS?
    I tried several Pokémon, with and without ditto. Always the same.
    Any ideas? Googling didn't turn up anything useful.

    I'm using Essentials 16.2


    The error log:
    -------------------------
    Code:
    Exception: RuntimeError
    Message: Script error within event 1, map 118 (ROUTE 510):
    Exception: SystemStackError
    Message: Section126:202:in `pbGetBabySpecies'stack level too deep
    ***Full script:
    pbDayCareGenerateEgg
    $PokemonGlobal.daycareEgg=0
    $PokemonGlobal.daycareEggSteps=0
     
    Interpreter:243:in `pbExecuteScript'
    Pokemon_Evolution:197:in `loop'
    Pokemon_Evolution:215:in `pbGetBabySpecies'
    Pokemon_Evolution:191:in `pbRgssOpen'
    SpriteWindow:1776:in `open'
    SpriteWindow:1776:in `pbRgssOpen'
    Pokemon_Evolution:191:in `pbGetBabySpecies'
    Pokemon_Evolution:219:in `pbGetBabySpecies'
    Pokemon_Evolution:219:in `pbGetBabySpecies'
    Pokemon_Evolution:219:in `pbGetBabySpecies'
     
    Interpreter:276:in `pbExecuteScript'
    Interpreter:1606:in `command_355'
    Interpreter:494:in `execute_command'
    Interpreter:193:in `update'
    Interpreter:106:in `loop'
    Interpreter:198:in `update'
    Scene_Map:103:in `update'
    Scene_Map:101:in `loop'
    Scene_Map:114:in `update'
    Scene_Map:68:in `main'
     
    I found the problem.

    How Essentials generates eggs is by checking what the earliest pre-evolution of the parent pokemon is.

    Well, in my game I gave them the ability to "de-evolve" by using an item, which is technically still an evolution.

    What this means is that the program will loop around the same evolution line eternally, never finding the earliest evolution.

    So either I'll have to find a different method of de-evolving or sacrifice either this function or the day-care altogether. :/
     
    I found the problem.

    How Essentials generates eggs is by checking what the earliest pre-evolution of the parent pokemon is.

    Well, in my game I gave them the ability to "de-evolve" by using an item, which is technically still an evolution.

    What this means is that the program will loop around the same evolution line eternally, never finding the earliest evolution.

    So either I'll have to find a different method of de-evolving or sacrifice either this function or the day-care altogether. :/

    How does your "de-evolve" work?

    I managed to get this working, and I had no issues breeding.
    paste in PItem_ItemEffects
    Code:
    ItemHandlers::UseOnPokemon.add(:DEVOLUTIONSTONE,proc{|item,pokemon,scene|
       if isConst?(pokemon.species,PBSpecies,:NINETALES)
         pokemon.species=PBSpecies::VULPIX
         pokemon.calcStats
         scene.pbDisplay(_INTL("NINETALES devolved into VULPIX."))
         scene.pbHardRefresh
       else
         scene.pbDisplay(_INTL("It won't have any effect."))
       end
     })

    Change a Ninetales back into a Vulpix.
     
    Last edited:
    How does your "de-evolve" work?

    I managed to get this working, and I had no issues breeding.
    paste in PItem_ItemEffects
    Code:
    ItemHandlers::UseOnPokemon.add(:DEVOLUTIONSTONE,proc{|item,pokemon,scene|
       if isConst?(pokemon.species,PBSpecies,:NINETALES)
         pokemon.species=PBSpecies::VULPIX
         pokemon.calcStats
         scene.pbDisplay(_INTL("NINETALES devolved into VULPIX."))
         scene.pbHardRefresh
       else
         scene.pbDisplay(_INTL("It won't have any effect."))
       end
     })

    Change a Ninetales back into a Vulpix.

    Thank you! This line of code works exactly how I wanted it to. I've been trying to figure this out for hours now. ^^ Now I just need to do this for every mon in the game. :p

    How my de-evolution worked is that in the pokemon.txt each evolved pokemon could evolve into the previous evolution via an item. It worked really nicely until I discovered the overflow bug with the breading.

    Thanks again. :) I should be able to get it to work now with a couple of hours work.

    ~TJ
     
    Back
    Top