• 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!
  • Dawn, Gloria, Juliana, or Summer - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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.

[PBS Question] registering pokemon as trainers?

  • 55
    Posts
    6
    Years
    • Seen Mar 22, 2025
    So I'm putting in the teams for the Leaders and Elite Four, but when the game starts up i get this message.

    [Pokémon Essentials version 17]

    Exception: RuntimeError

    Message: Undefined Trainer constant name: ELECTRODE,55,,EXPLOSION,THUNDER,SONICBOOM,ROLLOUT,0,M,,,,20

    Name must consist only of letters, numbers, and

    underscores and can't begin with a number.

    In addition, the name must be defined

    in trainertypes.txt.

    File PBS/trainers.txt, line 174

    ELECTRODE,55,,EXPLOSION,THUNDER,SONICBOOM,ROLLOUT,0,M,,,,20



    Compiler:668:in `pbGetConst'

    Compiler:732:in `parseTrainer'

    Compiler:2532:in `pbCompileTrainers'

    Compiler:2530:in `loop'

    Compiler:2667:in `pbCompileTrainers'

    Compiler:4401:in `pbCompileAllData'

    Compiler:4515

    It seems to be detecting the Pokemon's name as the trainers name? I dont understand. The error is occuring on the first elite four member, named Nikola. In trainers.txt and trainertypes.txt i have her put down over lorelei as
    #-------------------------------
    ELITEFOUR_Nikola
    Nikola
    2,FULLRESTORE,FULLRESTORE

    and

    67,ELITEFOUR_Nikola,Elite Four,100,Battle Elite,,,Female,,

    respectively. What's going on?
     
    It's possible that you messed up somewhere else in the file, causing it to think that Electrode is supposed to be a trainer.
    Double-check all the other lines to make sure they're okay. You should also try removing that trainer to see if the error persists.


    Do you have it set up exactly like this?
    ELITEFOUR_Nikola
    Nikola
    2,FULLRESTORE,FULLRESTORE
    ELECTRODE,55,,EXPLOSION,THUNDER,SONICBOOM,ROLLOUT,0,M,,,,20
    If so, you're missing 1 Pokemon in her entry. Please include all of the relevant lines.
     
    Last edited:
    I removed the trainer and it did the same thing to the next E4's (doug) Breloom. It's not the first Pokemon, Electrode is Nikola's third pokemon and breloom is doug's second, if that means anything.
     
    If she has 3 Pokemon, change it to:

    ELITEFOUR_Nikola
    Nikola
    3,FULLRESTORE,FULLRESTORE

    The number in red defines how many Pokemon that trainer has.
     
    Last edited:
    THAT was the problem! I thought that the 2 meant how many items they were meant to have! I fixed that, but now a new problem has come up and this is the crash report.

    [Pokémon Essentials version 17]

    Exception: RuntimeError

    Message: Expected a species name:

    File PBS/trainers.txt, line





    Compiler:2560:in `pbCompileTrainers'

    Compiler:2553:in `each'

    Compiler:2553:in `pbCompileTrainers'

    Compiler:2530:in `loop'

    Compiler:2667:in `pbCompileTrainers'

    Compiler:4401:in `pbCompileAllData'

    Compiler:4515

    I really cant tell what this one means, it almost looks bugged
     
    Last edited:
    Perhaps your other trainers also need to have their numbers updated.
    If you set it so a trainer has 3 Pokemon but only list 2, it'll crash; that number needs to be exact.
     
    Last edited:
    That was it. The champion was hiding out at the very bottom with an innacurate number. it's fixed, thank you :D
     
    Back
    Top