• 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!
  • It's time to vote for your favorite Pokémon Battle Revolution protagonist in our new weekly protagonist poll! Click here to cast your vote and let us know which PBR protagonist you like most.
  • 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.

Elite Battle System - Change Battle Background for Terrain Effects

  • 4
    Posts
    6
    Years
    After hours of toiling away, tinkering with EBS, I finally found asked for help with a solution for changing the battle background when a terrain effect becomes active, using the Elite Battle System by Luka SJ.[/URL]

    Now, I'm going to share it, to help everyone else, so nobody else has to bother the poor man about this ever again.

    1. The first step is to, obviously, install Elite Battle System. If you haven't... go and do that.

    2. Navigate to the EliteBattle_1 script section. In the class PokeBattle_Scene, copy and paste the following around line 135:
    Code:
      #Change battle background
      def pbChangeBGSprite
        case $terrainEffectsBG
         when 0 # Normal
            @sprites["battlebg"].setBitmap($globalBackdrop,self)
          when 1 #Electric Terrain
            @sprites["battlebg"].setBitmap("zElectricTerrain",self)
        end
      end

    This method is designed to be infinitely expandable so that you can add as many terrain effects as you want. Remember that when doing so, you'll need to add to this piece of code, otherwise nothing will happen.
    Code:
         when 0 # Normal
            @sprites["battlebg"].setBitmap($globalBackdrop,self)

    $globalBackdrop is the backdrop that the method will reset to once the terrain effect ends. In order to get this variable, paste the following above "# Choose bases" in PBBackdrop. (I recommend line 89 for this, that's where I put it
    Code:
    $globalBackdrop = backdrop

    Code:
          when 1 #Electric Terrain
            @sprites["battlebg"].setBitmap("zElectricTerrain",self)

    The "zElectricTerrain" of this line is the name of battle back that you will be changing to once the respective terrain effect comes into play. For reference, these need to be kept within Graphics/Battlebacks/battlebg within your Pokemon Essentials folder, along with all the other battle backgrounds from EBS.

    3. The next step is making it activate when the moves are used. In PokeBattle_MoveEffects, find the code for the move Electric Terrain. Then, paste the following above "An electric current runs across the battlefield!"
    Code:
        $terrainEffectsBG=1
        @battle.scene.pbChangeBGSprite

    This tells the method what terrain effect to use, then calls it. Remember that for every other terrain effect you add to this method, the "$terrainEffectsBG=" will need to be a different number.
    This will make it so that the battle background changes whenever electric terrain is activated via the move.

    4. Now, we need to make it apply to more than just moves. Most notably, the Electric Surge ability, if you have that installed (If not, skip this step)
    This is the part where it could get tricky depending on how different people have integrated Electric Surge. Regardless, navigate to where you have it installed and, once again, paste the following above whatever message plays when the ability is activated.
    Code:
            $terrainEffectsBG=1
            @battle.scene.pbChangeBGSprite

    This will call the method and tell it to use Electric Terrain's graphic, just like the move.

    5. The final step is ensuring that it returns to normal at the correct time.
    In PokeBattle_Battle, find the code that ends Electric Terrain. It should be under the effects for Water Sport and Mud Sport.

    Then paste the following above "The electric current disappeared from the battlefield."
    Code:
            $terrainEffectsBG=0
            @scene.pbChangeBGSprite

    We don't need the full "@battle.scene.pbChangeBGSprite" here because we're already in the section of the script that handles the battle. I think that's why idk don't ask me but it breaks otherwise.

    That should now be everything. Huzzah.

    Using this same method it could easily be expanded to include the battle bases as well, but, at least it works.
     
    Do you have the animation when the terrain will gone?
     
    Not part of this, no. I'm sure with some tweaks it could be made to play an animation when it goes, maybe like a screen flash or something? That probably wouldn't be too difficult to implement. But as of right now, no.
     
    Not part of this, no. I'm sure with some tweaks it could be made to play an animation when it goes, maybe like a screen flash or something? That probably wouldn't be too difficult to implement. But as of right now, no.

    You can copy (and give credits) to Pokemon Reborn. They have animation for each Terrain Effect (less Psychic) but doesn't to when they gone.
     
    Back
    Top