• 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!
  • 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] Error with "pbHasPokemonType"

  • 41
    Posts
    4
    Years
    • Seen Sep 19, 2023
    I wanted to have a character say different dialogue option based on whether or not you have a fire type in your party (since fire type will make the first gym much easier) However when I have multiple fire types in my party I'm getting an error that crashes the game.

    Exception: RuntimeError
    Message: Script error within event 16 (coords 32,30), map 101 (Kapnos University):
    Exception: NoMethodError
    Message: (eval):1:in 'pbExecuteScript'undefined method 'pbHasPokemonType?' for #<Interpreter:0xbd221b0>

    Script in question
    Conditional Branch: Script: pbHasPokemonType?(:FIRE)


    Any idea how to fix this or do I need to not have this check at all?
     
    The function you want is:
    Code:
    def pbHasType?(type)
    The function pbHasPokemonType does not exist ^^"
     
    Hmm ok i changed that but it's still giving me an error.

    Conditional Branch: Script: def pbHasType?(FIRE)
    (I also tried :FIRE) both error out.

    The error is
    SyntaxError
    Message; (Eval):1:in 'pbExecuteScript'compile error
    (eval):1:formal argument cannot be a constant
    def pbHasType?(FIRE)
    ^
    def pbHasType?(FIRE)
    ^
     
    "def" is for defining a function. If you want to call the function, remove the "def" (and use :FIRE) :)
     
    Back
    Top