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

Custom messages in battle?

12
Posts
8
Years
    • Seen May 25, 2021
    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?
     

    TBM_Christopher

    Semi-pro Game Dev
    448
    Posts
    14
    Years
  • 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.
     
    824
    Posts
    8
    Years
  • 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).
     
    824
    Posts
    8
    Years
  • 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).
     
    12
    Posts
    8
    Years
    • Seen May 25, 2021
    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.
     
    12
    Posts
    8
    Years
    • Seen May 25, 2021
    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.
     
    59
    Posts
    8
    Years
    • Seen Aug 9, 2020
    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.
     

    Sir_Tman

    Overworked game Dev
    201
    Posts
    8
    Years
  • 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