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

[Other Question] How can I make my own custom transitions for battles?

14
Posts
5
Years
    • Seen Feb 11, 2021
    I would like to add custom transitions for the villain team battles, like the Team Plasma ones.
    How can I do it?
     
    15
    Posts
    5
    Years
    • Seen Sep 24, 2020
    If you mean the VS display that comes before important battles, I can explain that. This process is similiar for other ui elements, so you also may be able to adapt this process to other transition aspects.

    1. In Graphics/Transitions you have vsTrainer and vsBar files. The according numbers belong together. So vsbar0 will be the background for vstrainer0 and so forth. If you add a new vs trainer you also need to add a vsbar with the same number.
    2. You have vsTrainer0 and vsTrainer 1 , those refer to your own character (male/female) and left half of the vs screen. To change this half, you either need to edit the files, replace them or add new ones. You can have multiple VSscreens for yourself- To have a second one, you would for example make a file with vsTrainer0_1 , vsTrainer0_2 and so on. (note that all trainer0 variants will use the default bar0, except you also make multiple versions of the Bar and rename them accordingly)

    - Those Variants refer to the outfit your current player is wearing. So if you want to use VsTrainer1_3, you would need to change the player outfit before - and add sprites for them as well.

    3. For the right half, the process is easier. All you need to do here is add a vsTrainer(X).png in the right size. Replace X with the number of your trainertype (trainertypes.txt). For example, your trainerclass has the number 50 - then you would create the files vsTrainer50.png and vsBar50.png. The great thing is, you dont need to do any additional scripting. The game will automatically play the vs animation if according files exist. You can also replace other ui elements as you see fit. Enjoy!

    If you have further questions, ask ahead. This Thing is a bit dififcult to explain and understand at first.
     
    14
    Posts
    5
    Years
    • Seen Feb 11, 2021
    If you mean the VS display that comes before important battles, I can explain that. This process is similiar for other ui elements, so you also may be able to adapt this process to other transition aspects.

    1. In Graphics/Transitions you have vsTrainer and vsBar files. The according numbers belong together. So vsbar0 will be the background for vstrainer0 and so forth. If you add a new vs trainer you also need to add a vsbar with the same number.
    2. You have vsTrainer0 and vsTrainer 1 , those refer to your own character (male/female) and left half of the vs screen. To change this half, you either need to edit the files, replace them or add new ones. You can have multiple VSscreens for yourself- To have a second one, you would for example make a file with vsTrainer0_1 , vsTrainer0_2 and so on. (note that all trainer0 variants will use the default bar0, except you also make multiple versions of the Bar and rename them accordingly)

    - Those Variants refer to the outfit your current player is wearing. So if you want to use VsTrainer1_3, you would need to change the player outfit before - and add sprites for them as well.

    3. For the right half, the process is easier. All you need to do here is add a vsTrainer(X).png in the right size. Replace X with the number of your trainertype (trainertypes.txt). For example, your trainerclass has the number 50 - then you would create the files vsTrainer50.png and vsBar50.png. The great thing is, you dont need to do any additional scripting. The game will automatically play the vs animation if according files exist. You can also replace other ui elements as you see fit. Enjoy!

    If you have further questions, ask ahead. This Thing is a bit dififcult to explain and understand at first.


    I didn't mean that. I was referring to transitions like that ones in Pokemon trainer battles:
     

    Attachments

    • How can I make my own custom transitions for battles?
      HonoredAggravatingIchidna-size_restricted.gif
      283.3 KB · Views: 32
    1,682
    Posts
    8
    Years
    • Online now
    Those are coded in script section Transitions, unless it's a simple transition, in which case it's this fancy grayscale image. The grayscale image is a 256-grayscale indexed image, and it automatically draws the pattern from the blackest part of the image to the whitest part. This is enough to perform the effect you want.

    If you're coding a new transition, you will need to edit def self.judge_special_transition to add your code with its "filename". I won't go into too much detail on creating a new transition, partially because I've never really coded one, but you can look at the rest of that script section for reference.

    Once you have your transition and its associated filename, we must go to def pbBattleAnimation, to edit which animation the game picks when it wants to start a regular battle (i.e. not one with a fancy vs animation).
    Code:
        # Determine which animation is played
        location = 0   # 0=outside, 1=inside, 2=cave, 3=water
        if $PokemonGlobal && ($PokemonGlobal.surfing || $PokemonGlobal.diving)
          location = 3
        elsif $PokemonTemp.encounterType &&
           ($PokemonTemp.encounterType==EncounterTypes::OldRod ||
           $PokemonTemp.encounterType==EncounterTypes::GoodRod ||
           $PokemonTemp.encounterType==EncounterTypes::SuperRod)
          location = 3
        elsif $PokemonEncounters && $PokemonEncounters.isCave?
          location = 2
        elsif !pbGetMetadata($game_map.map_id,MetadataOutdoor)
          location = 1
        end
        anim = ""
        if PBDayNight.isDay?
          case battletype
          when 0, 2 # Wild, double wild
            anim = ["SnakeSquares","DiagonalBubbleTL","DiagonalBubbleBR","RisingSplash"][location]
          when 1 # Trainer
            anim = ["TwoBallPass","ThreeBallDown","BallDown","WavyThreeBallUp"][location]
          when 3 # Double trainer
            anim = "FourBallBurst"
          end
        else
          case battletype
          when 0, 2 # Wild, double wild
            anim = ["SnakeSquares","DiagonalBubbleBR","DiagonalBubbleBR","RisingSplash"][location]
          when 1 # Trainer
            anim = ["SpinBallSplit","BallDown","BallDown","WavySpinBall"][location]
          when 3 # Double trainer
            anim = "FourBallBurst"
          end
        end
    This entire bit does the battle animation selection. It's all commented out, or you can kind of figure out what it's doing by reading it. If all you want to do is swap out the animations, than you can just change the strings and call it a day. Adding more is a bit involved, so I won't get into it unless you need to.
     
    14
    Posts
    5
    Years
    • Seen Feb 11, 2021
    Those are coded in script section Transitions, unless it's a simple transition, in which case it's this fancy grayscale image. The grayscale image is a 256-grayscale indexed image, and it automatically draws the pattern from the blackest part of the image to the whitest part. This is enough to perform the effect you want.

    If you're coding a new transition, you will need to edit def self.judge_special_transition to add your code with its "filename". I won't go into too much detail on creating a new transition, partially because I've never really coded one, but you can look at the rest of that script section for reference.

    Once you have your transition and its associated filename, we must go to def pbBattleAnimation, to edit which animation the game picks when it wants to start a regular battle (i.e. not one with a fancy vs animation).
    Code:
        # Determine which animation is played
        location = 0   # 0=outside, 1=inside, 2=cave, 3=water
        if $PokemonGlobal && ($PokemonGlobal.surfing || $PokemonGlobal.diving)
          location = 3
        elsif $PokemonTemp.encounterType &&
           ($PokemonTemp.encounterType==EncounterTypes::OldRod ||
           $PokemonTemp.encounterType==EncounterTypes::GoodRod ||
           $PokemonTemp.encounterType==EncounterTypes::SuperRod)
          location = 3
        elsif $PokemonEncounters && $PokemonEncounters.isCave?
          location = 2
        elsif !pbGetMetadata($game_map.map_id,MetadataOutdoor)
          location = 1
        end
        anim = ""
        if PBDayNight.isDay?
          case battletype
          when 0, 2 # Wild, double wild
            anim = ["SnakeSquares","DiagonalBubbleTL","DiagonalBubbleBR","RisingSplash"][location]
          when 1 # Trainer
            anim = ["TwoBallPass","ThreeBallDown","BallDown","WavyThreeBallUp"][location]
          when 3 # Double trainer
            anim = "FourBallBurst"
          end
        else
          case battletype
          when 0, 2 # Wild, double wild
            anim = ["SnakeSquares","DiagonalBubbleBR","DiagonalBubbleBR","RisingSplash"][location]
          when 1 # Trainer
            anim = ["SpinBallSplit","BallDown","BallDown","WavySpinBall"][location]
          when 3 # Double trainer
            anim = "FourBallBurst"
          end
        end
    This entire bit does the battle animation selection. It's all commented out, or you can kind of figure out what it's doing by reading it. If all you want to do is swap out the animations, than you can just change the strings and call it a day. Adding more is a bit involved, so I won't get into it unless you need to.

    Great! Thanks for the information.
     
    Back
    Top