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

[Script] [Emerald] A trainer battle is occurring twice when there's no clear indication in the script of a repeated battle.

  • 136
    Posts
    5
    Years
    • Seen Dec 31, 2024
    I'm very sorry for posting so many help threads. But I literally could not find another thread from searching that has someone else dealing with this same problem.
    In the attached script, it's basically the character entering the champion's room and triggering almost the same thing as base Emerald's Wallace battle, but with a different trainer, instead.
    What happens is, after the opening dialogue, the player gets thrown into the battle, as expected, with different music thanks to "playsong". But after victory, it does the battle again! Even though, I only put the "trainerbattle" command on 1 line of code, and followed that with "setflag" and "goto". What's interesting (and makes sense) is that the regular trainer battle theme plays on the 2nd battle. And if I change who the trainer is, it repeats that trainer twice instead of two different trainers back to back.

    From my testing, the player only battles this trainer twice, not infinitely. The other parts of the script work fine.

    I literally don't know what's wrong with the script, and why I'm getting 2 battles back to back. Help would be appreciated.
     

    Attachments

    • script e476e8 (Superboss 3 compiled).txt
      8.9 KB · Views: 3
    This is from a different script for the battle before that one:
    [PokeCommunity.com] [Emerald] A trainer battle is occurring twice when there's no clear indication in the script of a repeated battle.


    I also used "special 0x3E" and I remember that battle not repeating. Would you agree it's some sort of complicated bug with "trainerbattle 0x3..."?
     
    Sounds interesting, maybe I can use that as a simple way to make battles repeatable, without having to edit every script.
     
    Back
    Top