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

[Scripting Question] Final Pokemon BGM and trainer text?

  • 14
    Posts
    5
    Years
    • Seen May 28, 2022
    Hi. I'm looking for a way to change the battle BGM and have the trainer to say something when they get to their final Pokemon like in Black and White and Sword and Shield. I have found a few tutorials on here but none that are thorough enough and I can't see the wiki tutorial now because my computer won't allow me to use wayback machine.
    Thanks!
     
    Load your project and then open the 'Script Editor' by pressing F11. You must now search for the line:

    Code:
    @scene.pbTrainerSendOut(index,pokemon)
    which is located around line 2234.

    After this add in the lines:
    Code:
          # Last Pokemon script; credits to venom12 and HelioAU
          if pbPokemonCount(@party2)==1
            # Define any trainers that you want to activate this script below
            if isConst?(@opponent.trainertype,PBTrainers,:Leader_Brock)
              @scene.pbShowOpponent(0)
              # For each defined trainer, add the BELOW section for them
              if isConst?(@opponent.trainertype,PBTrainers,:Leader_Brock)
                pbBGMPlay("LastPkMnGym",100,100)
                pbDisplayPaused(_INTL("Ah ha ha! It itches! It itches!"))
              end
              # For each defined trainer, add the ABOVE section for them
              @scene.pbHideOpponent
            end
          end
    You are able to define any amount of trainers in the first if line, these are the ones that will allow the rest of the script to execute. The next line you should enter only a single trainer, no ors should be added - if you want more trainers you can add them.
    https://web.archive.org/web/2018031...om/wiki/Tutorial:Last_Pokémon_message_and_BGM
    i didn't copy the aditional trainers part, but its basically the same thing. elsif trainer type is gymleader 2, do the thing, yadda yadda.
     
    Thanks so much! This worked perfectly.

    Hi, could you give me a hand with doing multiple trainers. It came up with an error when I tried to do so.
     
    Last edited by a moderator:
    This is not difficult to do, but you simply need to edit the script slightly. Your script should be something like:
    Code:
            if isConst?(@opponent.trainertype,PBTrainers,:Leader_Brock) or isConst?(@opponent.trainertype,PBTrainers,:Leader_Misty) or isConst?(@opponent.trainertype,PBTrainers,:Champion_Lance)
    This means that both Leader_Brock, Leader_Misty, and Champion_Lance can now activate the script, now you need to define individual text for them:
    Code:
              if isConst?(@opponent.trainertype,PBTrainers,:internalname)
                pbBGMPlay("bgmtitle",100,100)
                pbDisplayPaused(_INTL("your message here"))
              end
    This is the text that you can copy+paste, and then edit, to set messages for them.
    Code:
              if isConst?(@opponent.trainertype,PBTrainers,:Leader_Brock)
                pbBGMPlay("LastPkMnGym",100,100)
                pbDisplayPaused(_INTL("Ah ha ha! It itches! It itches!"))
              end
              if isConst?(@opponent.trainertype,PBTrainers,:Leader_Misty)
                pbBGMPlay("LastPkMnGym",100,100)
                pbDisplayPaused(_INTL("Hmm... You're pretty good..."))
              end
              if isConst?(@opponent.trainertype,PBTrainers,:Champion_Lance)
                pbBGMPlay("LastPkMnChampion",100,100)
                pbDisplayPaused(_INTL("All right!\nI though this would never happen!"))
              end
     
    Back
    Top