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

[Scripting Question] Cant use abilities to get forms in Pokemon_Forms (17.2)

  • 465
    Posts
    7
    Years
    • Seen Jun 1, 2024
    So for some reason i get stack layer too deep due to one of my forms "get form" 's.

    Code:
    [Pokémon Essentials version 17.2]
    Exception: SystemStackError
    Message: stack level too deep
    PokeBattle_Pokemon:239:in `ability'
    Pokemon_Forms:799
    Pokemon_Forms:798:in `call'
    Pokemon_Forms:116:in `call'
    Pokemon_Forms:7:in `form'
    Pokemon_Forms:28:in `fSpecies'
    PokeBattle_Pokemon:280:in `getAbilityList'
    PokeBattle_Pokemon:240:in `ability'
    Pokemon_Forms:799
    Pokemon_Forms:798:in `call'

    NO idea why but this is the code;
    Code:
    MultipleForms.register(:OMEGAPURRLOIN,{
    "getForm"=>proc{|pokemon|
      next 1  if [B][I]isConst?(pokemon.ability,PBAbilities,:THIEF) [/I][/B]&& 
        (isConst?(pokemon.item,PBItems,:FIGHTINGGEM) || isConst?(pokemon.item,PBItems,:FIGHTINGCRYSTAL) || 
        isConst?(pokemon.item,PBItems,:FISTPLATE) || isConst?(pokemon.item,PBItems,:BLACKBELT) ||
        isConst?(pokemon.item,PBItems,:ASSAULTVEST)  || isConst?(pokemon.item,PBItems,:MUSCLEBAND))
    Is specifically the bold italiced line, getting the ability in this reference breaks it.
    (basically an ability like multi-type but its not the only ability the line has)
    i also use this alot for other abilities for like aegislash or wishiwashi so their not useless/broken, so their probably broken too.
    this worked in v16.2 but the Def Ability in PokeBattle_Pokemon is the same across both.
     
  • 143
    Posts
    4
    Years
    • Seen Mar 26, 2024
    Maybe try adding a default form to the list to eliminate any errors regarding the function not returning any form.
    Simply add the following as the last line of the function:
    Code:
    next 0
    Hope the error gets resolved. :)
     
  • 465
    Posts
    7
    Years
    • Seen Jun 1, 2024
    Maybe try adding a default form to the list to eliminate any errors regarding the function not returning any form.
    Simply add the following as the last line of the function:
    Code:
    next 0
    Hope the error gets resolved. :)

    Definetly would be an error, but i only put a fragment of the code, as it gets stuck at specifically that spot, and its a large bit of repetative code.
    it has next 0 already at the end.
     
  • 465
    Posts
    7
    Years
    • Seen Jun 1, 2024
    Definetly would be an error, but i only put a fragment of the code, as it gets stuck at specifically that spot, and its a large bit of repetative code.
    it has next 0 already at the end.

    Okay so in testing; this seems localised. i tested with my aegislash code that gives it a different from if not having stance change.

    Code:
    MultipleForms.register(:AEGISLASH,{
    "getFormOnCreation"=>proc{|pokemon|
       form = 0
       if isConst?(pokemon.ability,PBAbilities,:WIELDER) || isConst?(pokemon.ability,PBAbilities,:NOGUARD)
         next 2
       else
         next 0
       end
    }
    })

    And i can enter battle. I'll just change the ability and see if it works.

    Okay so its specifically ''getForm"
    As if it has Thief (Ability) it repeatably checks (while it shouldnt)
    so the fixes are 'change the ability and have the form change be across all abilities, or make it only change on entering battle.
     
    Back
    Top