• 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.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Serena, Kris, Dawn, Red - which Pokémon protagonist is your favorite? Let us know by voting in our grand final favorite protagonist 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.

Battle missing trainer when in files

Wannabe God

Witty title
  • 7
    Posts
    14
    Years
    Okay, I've tried many, many times to put a trainer battle in the game I'm working on by putting the trainer in both the trainertypes and trainers file, but whenever I run the script, it always acts like I hadn't put the trainer in the trainers file at all. I've tried multiple solutions, but when I run it in debug mode it acts like the trainer isn't there at all, and when I run it out of debug mode, I get a similar error, which I guess I'll have to type out because the site won't let me post an external image:

    Script 'interpreter' line 276: RuntimeError occured

    Script error within event 16, map 8, (Team Galacitc HQ F3):
    Exception: RuntimeError
    Message: Section09:194:in'pbMissingTrainer'Can't find trainer
    (RivalMGalacticGrunt;5,ID 1)
    ***full script
    pbtrainerBattle(PBTrainers::RIVALM,"Galactic Grunt;5._I("You actually beat me?"),false,1,true)
    Interpreter:243:in'pbExecuteScript"
    PokemonTrainers:318:in 'pbTrainerBattle'
    (eval):1:in 'pbExecuteScript'
    Interpreter:788:in 'eval'
    Interpreter:243:in'pbexecutesScript'
    Interpreter:788:in'command_111'
    Interpreter:320:in:'execute_command'
    Interpreter:193:in'update'
    Interpreter:106:in 'loop'
    Interpreter:198:in'update'

    This is really annoying me since I know that there must be a simple explanation, but I've spend hours trying to work it out without seeing it.

    P.S. Here's the trainer in the trainers file (I tried the script as 5,5 instead of 5, but no luck):
    RIVALM
    Galactic Grunt;5,5
    1,POTION
    GLAMEOW,10,,FAKEOUT,SCRATCH,GROWL,,,,0,false,,10,70,,false

    P.S.S
    If the answer is super obvious and I'm an idiot for not figuring it out, please don't be mean about it, I've spent around an hour searching for the answer in posts already, and I'm really, really new to coding.

    EDIT: I changed the rival's name to something less complicated, but it still acts like the rival isn't scripted in. Curses.
     
    Last edited:
    pbTrainerBattle(PBTrainers::AROMALADY,"Jasmine",_I("J'étais préoccupée avec les fleurs."),false,0)

    You're missing a " after:

    Galactic Grunt

    It should be "Galactic Grunt"

    Rebattles just require Galactic Grunt,# in trainers.txt (from my experience). There's no semi-colon or two separate numbers i.e. ;5,5 is actually ,5

    Also, there's no periods either. Look at this one:

    pbTrainerBattle(PBTrainers::AROMALADY,"Jasmine",_I("J'étais préoccupée avec les fleurs."),false,0)

    Maybe yours should be:

    pbTrainerBattle(PBTrainers::RIVALM,"Galactic Grunt",_I("You actually beat me?"),false,5,true)

    5 is your rebattle number.

    Try that, I guess.
     
    Thanks for the help! I don't think that's what's glitching up now, though, since I changed it all around with the battle now reading:

    pbTrainerBattle(PBTrainers::RIVALM,"MBattle1Stunky",_I("You actually beat me?"),false,1,true)

    And the trainers.txt file reading

    RIVALM
    MBattle1Stunky
    1,POTION
    GLAMEOW,10,,FAKEOUT,SCRATCH,GROWL,,,,0,false,,10,70,,false

    Same error as usual.

    Oh, and one more thing that may or may not be related: I tried the fix for the trainers not working in editor bug, and it didn't work at all. No idea what I'm doing wrong.
     
    Last edited:
    I think I see the issue.

    It should look like this:

    pbTrainerBattle(PBTrainers::RIVALM,"MBattle1Stunky",_I("You actually beat me?"),false,1,true)

    RIVALM
    MBattle1Stunky,1
    1,POTION
    GLAMEOW,10,,FAKEOUT,SCRATCH,GROWL,,,,0,false,,10,70,,false

    Because in the first line you specify rebattle #1 (see bold), but your trainer.txt trainer isn't written for a rebattle.

    Try that.
     
    Yeah, I saved the changes. I haven't checked the actual error yet since I was testing in debug mode which only tells me that the trainer mentioned doesn't exist, but I'll see what happens if I test in in game mode now.

    Edit: here's the error:

    Script 'Interpreter' line 276: RuntimeError occurred.

    Script error within event 16, map 8 (Team Galactic HQ F3):

    Exception: RuntimeError

    Message: Section109:194:in `pbMissingTrainer'Can't find trainer (RIVALM, MBattle1Stunky, ID true)

    ***Full script:

    pbTrainerBattle(PBTrainers::RIVALM,"MBattle1Stunky",_I("You actually beat me?"),false,true)

    Interpreter:243:in `pbExecuteScript'

    PokemonTrainers:318:in `pbTrainerBattle'

    (eval):1:in `pbExecuteScript'

    Interpreter:788:in `eval'

    Interpreter:243:in `pbExecuteScript'

    Interpreter:788:in `command_111'

    Interpreter:320:in `execute_command'

    Interpreter:193:in `update'

    Interpreter:106:in `loop'

    Interpreter:198:in `update'
     
    Last edited:
    Back
    Top