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

undefined method `pbGetPokemon'

772
Posts
13
Years
    • UK
    • Seen Apr 19, 2024
    I'm getting the following error

    Message: Section157:115:in `pbGTS'undefined method `pbGetPokemon' for #<GTSScene:0xa515200>

    Within a custom script i'm trying to make

    This is the code i've got

    Code:
    pbChoosePokemon(1,3)
              if $game_variables[1] < 0
                break
              end
              if (pbGetPokemon(1).species == 25) && (pbGetPokemon(1).form == 1)
                Kernel.pbMessage("This Pokemon cannot currently be offered")
                break
              end
     
    12
    Posts
    13
    Years
    • Seen Feb 17, 2017
    I'm not sure, but I think the code should be:
    Spoiler:

    But again, I'm not sure
     

    Maruno

    Lead Dev of Pokémon Essentials
    5,286
    Posts
    16
    Years
    • Seen yesterday
    That method is only usable from within events.

    You could use this instead:

    Code:
    pbChoosePokemon(1,3,proc {|poke|
       !(isConst?(poke,PBSpecies,:PIKACHU) && poke.form==1)
    })
    break if pbGet(1)<0
    It won't let the player choose a form 1 Pikachu in the first place.
     

    Maruno

    Lead Dev of Pokémon Essentials
    5,286
    Posts
    16
    Years
    • Seen yesterday
    This, then.
    Code:
    pbChoosePokemon(1,3,proc {|poke|
       !(isConst?(poke.species,PBSpecies,:PIKACHU) && poke.form==1)
    })
    break if pbGet(1)<0
     
    Back
    Top