• 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!
  • Our weekly protagonist poll is now up! Vote for your favorite Trading Card Game 2 protagonist in the poll by clicking 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.

[Error] Undefined Trainer constant name

  • 7
    Posts
    6
    Years
    • Seen May 21, 2019
    Hi there, I'm trying to add Gen 6 Pokemon into my game using the resources I found on this site:
    https://board.romhackersworld.eu/th...ns-rufe-normal-and-animated-sprites-mega-evo/

    However when I try to load the game I get the following error:
    Exception: RuntimeError
    Message: Undefined Trainer constant name: 
    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 1
    

    Compiler:932:in `pbGetConst'
    Compiler:974:in `parseTrainer'
    Compiler:1387:in `pbCompileTrainers'
    Compiler:1385:in `loop'
    Compiler:1487:in `pbCompileTrainers'
    Compiler:3977:in `pbCompileAllData'
    Compiler:4095

    When I go back to the version I had without Gen 6 pokemon, it works perfectly fine and I can load the game up just as normal and I also get the exact same error if the trainers.txt file is completely empty.

    Does anyone have any idea what could be causing this error?
     
    Make sure that your trainers.txt is in the right format and that you got all trainer types in your trainers.txt
     
    Does anyone have any idea what could be causing this error?

    Code:
    Message: Undefined Trainer constant name: 
    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 1

    If it is a simple fix, the "Message" part in the error code always says how to fix it.

    In addition to what Ego said, the PBS file that you used could probably be for a different version of Essentials than the one you used. Example: It could be for v15 and you are using 17.2
    You can use https://text-compare.com/ to check the differences.
     
    I ended up figuring out what was wrong, the script file on that site is completely different from the normal one so that it messed up all the formatting for the PBS files. I ended up starting trying to get Gen 6 working from scratch again and managed to get it working.
     
    Back
    Top