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

[Error] Undefined Trainer constant name

7
Posts
5
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?
     

    Ego13

    hollow_ego
    311
    Posts
    6
    Years
  • Make sure that your trainers.txt is in the right format and that you got all trainer types in your trainers.txt
     
    178
    Posts
    10
    Years
  • 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.
     
    7
    Posts
    5
    Years
    • Seen May 21, 2019
    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