• 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!
  • Cyndy, May, Hero (Conquest), or Wes - 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.

Custom messages in battle?

  • 12
    Posts
    9
    Years
    • Seen Apr 18, 2025
    Basically the first Gym leader in my game is very important for the lore so I want some in-battle messages to appear after defeating some of his pokemon. Is there anyway to do this?
     
    If you fail to find anything to this effect, you could always break the battle into segments. Then, after each segment, cut back to the overworld for dialog, then start another battle.
     
    Couple questions:
    1.) Are you using Pokemon Essentials? (I assume you are, but want clarification).
    2.) If so, are you using the basic battle GUI or the Elite Battle System (can't remember if this is important.)
    3.) How many Pokemon is he ultimately going to have? (This will determine how many in-battle cut-ins you can do).
     
    1) yes
    2) Basic, ran into too many general issues with EBS
    3) 4

    Okay, here we go:
    Enter the script section PokeBattle_Battle, then search for "def pbSendOut". It should take you to the following function. Add in the red bits:
    Code:
      def pbSendOut(index,pokemon)
        pbSetSeen(pokemon)
        @peer.pbOnEnteringBattle(self,pokemon)
        if pbIsOpposing?(index)
          @scene.pbTrainerSendOut(index,pokemon)[COLOR="Red"]
          if $game_switches[112]
            case pbPokemonCount(@party2)
            when 3
              @battle.pbDisplayPaused("First Message")
            when 2
              @battle.pbDisplayPaused("Second Message")
            when 1
              @battle.pbDisplayPaused("Final Message")
            end
          end[/COLOR]
        else
          @scene.pbSendOut(index,pokemon)
        end
        @scene.pbResetMoveIndex(index)
        # Primal Reversion
        pbPrimalReversion(index)
      end

    You'll need to credit Zingzags in addition to me, as I adapted his code for changing the background music upon a Gym Leader's final Pokemon. Note that you'll have to turn global switch 112 on right before the battle and turn it off after the battle (make sure that it turns off even if the player loses).
     
    Wow this is twice you've come through for me. I really appreciate it man. Ill be sure to add Zingzags name to the credits too.
     
    Code:
    ---------------------------
    Pokemon Essentials Gen 6
    ---------------------------
    Exception: NoMethodError
    
    Message: undefined method `pbDisplayPaused' for nil:NilClass
    
    PokeBattle_Battle:1609:in `pbSendOut'
    
    PokeBattle_Battle:1642:in `pbReplace'
    
    PokeBattle_Battle:1665:in `pbRecallAndReplace'
    
    PokeBattle_Battle:1572:in `pbSwitch'
    
    PokeBattle_Battle:1544:in `each'
    
    PokeBattle_Battle:1544:in `pbSwitch'
    
    PokeBattle_Battle:4126:in `__clauses__pbEndOfRoundPhase'
    
    PokeBattle_Clauses:42:in `pbEndOfRoundPhase'
    
    PokeBattle_Battle:2801:in `pbStartBattleCore'
    
    PokeBattle_Battle:2800:in `logonerr'
    
    
    
    This exception was logged in 
    
    C:\Users\Valerie\Saved Games/Pokemon Essentials Gen 6/errorlog.txt.
    
    Press Ctrl+C to copy this message to the clipboard.
    ---------------------------
    OK   
    ---------------------------

    Error returned when after each pokemon is sent out.
     
    Yeah, I made a mistake. It should be self.pbDisplayPaused for each of them, not @battle.pbDisplayPaused

    Somewhat related: How about making the enemy trainer move to its end battle message, playing the message, then moving back? I'm trying to find the script in which the sprite moves, but I can't find it.
     
    try something more like this
    Spoiler:
    https://pastebin.com/gekjhZxS
    I sort of mix Rot8er_ConeX with Zingzags with my script.
    Also added a line if you want music also you don't need to use a switch you just have to put in a trainer type.
     
    Back
    Top