• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
  • The Eevee Expo Game Jam has concluded! 🎉 Head on over to the game jam forum to play through the games.
    Don't forget to come back September 21st to vote for your favorites!
  • Reminder: AI-generated content is not allowed on the forums per the Rules and Regulations. Please contact us if you have any questions!
[Frame 2 Project] Gen 4 Battle Entry Animations

Resource [Frame 2 Project] Gen 4 Battle Entry Animations 1.0.1

PikachuMazzinga

🍝 cooking pixels 🍝
Member
Joined
Jan 30, 2021
Posts
35
PikachuMazzinga submitted a new resource:

[Frame 2 Project] Gen 4 Battle Entry Animations - You know those animations Pokémon had in DP/PT/HGSS, this is a plugin/framework for that thing 👍

[Frame 2 Project]
Gen 4 Battle Entry Animations
by 🦆 PikachuMazzinga & 🐊 Brawligator

Last year we brought you Tower of Ashes with a snippet of this feature.
Today we bring you the full thing as a standalone plugin for Essentials v21+!
(I'd say this is still in beta really as we want to squash some bugs and improve user experience in the future)


What does this Plugin do?...​

Read more about this resource...
 
Very cool project idea. I always thought these animations had a lot more charm than the fully animated Gen 5 sprites.
 
Unfortunately, I don't think this works out of the box with v20.1 and earlier. So far, it's using the lerp function which I think was only included starting in v21, and the update function in the Battle::Scene::BattlerSprite class isn't the same as the one for v20.1, so it crashes due to needing to handle frames in v20.1. There are probably other incompatibilities, too.
 
Unfortunately, I don't think this works out of the box with v20.1 and earlier. So far, it's using the lerp function which I think was only included starting in v21, and the update function in the Battle::Scene::BattlerSprite class isn't the same as the one for v20.1, so it crashes due to needing to handle frames in v20.1. There are probably other incompatibilities, too.
This is a known issue and will be addressed in the v1.0.1, releasing in a few days time.
Thank you for your comment and your patience.
 
I'm releasing my project tomorrow and was trying to have everything ready to go by yesterday, but I'm still making sure to grab this and implement it. This is great for someone like me, who has a lot of custom Pokémon and wasn't willing to make full animations for every one of them, but still wants some movement to make things more lively. Thanks for this.

EDIT: Quick question. Does this support different animations for different forms? From what I can tell, it doesn't, but I wanted to make sure.
 
Last edited:
I'm releasing my project tomorrow and was trying to have everything ready to go by yesterday, but I'm still making sure to grab this and implement it. This is great for someone like me, who has a lot of custom Pokémon and wasn't willing to make full animations for every one of them, but still wants some movement to make things more lively. Thanks for this.

EDIT: Quick question. Does this support different animations for different forms? From what I can tell, it doesn't, but I wanted to make sure.
The current version does not support different animation patterns for different forms of the same species, like the original ds games, but it is a feature we plan to add in a future release. 👍
 
Potential glitch to bring to your attention. I implemented the evolution screen animation into an unedited evolution screen script as instructed, and when the Pokémon plays the animation after evolution, it will revert to its previous form for the animation.
 
Potential glitch to bring to your attention. I implemented the evolution screen animation into an unedited evolution screen script as instructed, and when the Pokémon plays the animation after evolution, it will revert to its previous form for the animation.
What version of essentials are you running?
Did you use the provided example script for that version or did you add the animation call into the script manually?
 
What version of essentials are you running?
Did you use the provided example script for that version or did you add the animation call into the script manually?

I'm using v21.1. I did add the animation call manually, as I had some changes in UI_Evolution that I've made, but nothing that should affect this script, from what I can tell. Perhaps this was my mistake, all I did was move over the "@sprites["rsprite2"].pbPlayIntroAnimation" line into the proper place in the script, as, from what I could tell, that was the only thing changed in your provided script example. Was there something else I missed? Sorry if this was a false alarm.
 
I'm using v21.1. I did add the animation call manually, as I had some changes in UI_Evolution that I've made, but nothing that should affect this script, from what I can tell. Perhaps this was my mistake, all I did was move over the "@sprites["rsprite2"].pbPlayIntroAnimation" line into the proper place in the script, as, from what I could tell, that was the only thing changed in your provided script example. Was there something else I missed? Sorry if this was a false alarm.
Inside of the 004_UI_Evolution.rb we provided, check the pbEvolutionSuccess method and the order it is doing all the updates to the Pokémon itself.
Base Essentials modifies the species of the Pokémon a little too late for our purposes, so you might want to move it up a bit referencing the provided script as follows:
  • evolution preparations
  • Check for consumed item and check if Pokémon should be duplicated
  • Modify Pokémon to make it evolved (@pokemon.species = @newspecies)
  • Play cry of evolved species
  • <now you should play play the animation>
  • wait for cry to finish
  • post-evolution stuff like dex updates and moves

Ruby:
Expand Collapse Copy
  def pbEvolutionSuccess
    $stats.evolution_count += 1
    
    oldspeciesname = @pokemon.name
    newspeciesname = GameData::Species.get(@newspecies).name

    # Check for consumed item and check if Pokémon should be duplicated
    pbEvolutionMethodAfterEvolution

    # Modify Pokémon to make it evolved
    was_fainted = @pokemon.fainted?
    @pokemon.species = @newspecies
    @pokemon.hp = 0 if was_fainted
    @pokemon.calc_stats
    @pokemon.ready_to_evolve = false
    
    # Play cry of evolved species
    cry_time = GameData::Species.cry_length(@newspecies, @pokemon.form)
    Pokemon.play_cry(@newspecies, @pokemon.form)
        
    # FRAME2 PROJECT ADDITION
    @sprites["rsprite2"].pbPlayIntroAnimation

    timer_start = System.uptime
    loop do
      Graphics.update
      pbUpdate
      break if System.uptime - timer_start >= cry_time
    end

    pbBGMStop
    # Success jingle/message
    pbMEPlay("Evolution success")
    pbMessageDisplay(@sprites["msgwindow"],
                     "\\se[]" + _INTL("Congratulations! Your {1} evolved into {2}!",
                      oldspeciesname, newspeciesname) + "\\wt[80]") { pbUpdate }
    @sprites["msgwindow"].text = ""

    # See and own evolved species
    was_owned = $player.owned?(@newspecies)
    $player.pokedex.register(@pokemon)
    $player.pokedex.set_owned(@newspecies)
    moves_to_learn = []
    movelist = @pokemon.getMoveList
    movelist.each do |i|
      next if i[0] != 0 && i[0] != @pokemon.level   # 0 is "learn upon evolution"
      moves_to_learn.push(i[1])
    end
    # Show Pokédex entry for new species if it hasn't been owned before
    if Settings::SHOW_NEW_SPECIES_POKEDEX_ENTRY_MORE_OFTEN && !was_owned &&
       $player.has_pokedex && $player.pokedex.species_in_unlocked_dex?(@pokemon.species)
      pbMessageDisplay(@sprites["msgwindow"],
                       _INTL("{1}'s data was added to the Pokédex.", newspeciesname)) { pbUpdate }
      $player.pokedex.register_last_seen(@pokemon)
      pbFadeOutIn do
        scene = PokemonPokedexInfo_Scene.new
        screen = PokemonPokedexInfoScreen.new(scene)
        screen.pbDexEntry(@pokemon.species)
        @sprites["msgwindow"].text = "" if moves_to_learn.length > 0
        pbEndScreen(false) if moves_to_learn.length == 0
      end
    end
    # Learn moves upon evolution for evolved species
    moves_to_learn.each do |move|
      pbLearnMove(@pokemon, move, true) { pbUpdate }
    end
  end
 
Inside of the 004_UI_Evolution.rb we provided, check the pbEvolutionSuccess method and the order it is doing all the updates to the Pokémon itself.
Base Essentials modifies the species of the Pokémon a little too late for our purposes, so you might want to move it up a bit referencing the provided script as follows:
  • evolution preparations
  • Check for consumed item and check if Pokémon should be duplicated
  • Modify Pokémon to make it evolved (@pokemon.species = @newspecies)
  • Play cry of evolved species
  • <now you should play play the animation>
  • wait for cry to finish
  • post-evolution stuff like dex updates and moves

Ruby:
Expand Collapse Copy
  def pbEvolutionSuccess
    $stats.evolution_count += 1
 
    oldspeciesname = @pokemon.name
    newspeciesname = GameData::Species.get(@newspecies).name

    # Check for consumed item and check if Pokémon should be duplicated
    pbEvolutionMethodAfterEvolution

    # Modify Pokémon to make it evolved
    was_fainted = @pokemon.fainted?
    @pokemon.species = @newspecies
    @pokemon.hp = 0 if was_fainted
    @pokemon.calc_stats
    @pokemon.ready_to_evolve = false
 
    # Play cry of evolved species
    cry_time = GameData::Species.cry_length(@newspecies, @pokemon.form)
    Pokemon.play_cry(@newspecies, @pokemon.form)
     
    # FRAME2 PROJECT ADDITION
    @sprites["rsprite2"].pbPlayIntroAnimation

    timer_start = System.uptime
    loop do
      Graphics.update
      pbUpdate
      break if System.uptime - timer_start >= cry_time
    end

    pbBGMStop
    # Success jingle/message
    pbMEPlay("Evolution success")
    pbMessageDisplay(@sprites["msgwindow"],
                     "\\se[]" + _INTL("Congratulations! Your {1} evolved into {2}!",
                      oldspeciesname, newspeciesname) + "\\wt[80]") { pbUpdate }
    @sprites["msgwindow"].text = ""

    # See and own evolved species
    was_owned = $player.owned?(@newspecies)
    $player.pokedex.register(@pokemon)
    $player.pokedex.set_owned(@newspecies)
    moves_to_learn = []
    movelist = @pokemon.getMoveList
    movelist.each do |i|
      next if i[0] != 0 && i[0] != @pokemon.level   # 0 is "learn upon evolution"
      moves_to_learn.push(i[1])
    end
    # Show Pokédex entry for new species if it hasn't been owned before
    if Settings::SHOW_NEW_SPECIES_POKEDEX_ENTRY_MORE_OFTEN && !was_owned &&
       $player.has_pokedex && $player.pokedex.species_in_unlocked_dex?(@pokemon.species)
      pbMessageDisplay(@sprites["msgwindow"],
                       _INTL("{1}'s data was added to the Pokédex.", newspeciesname)) { pbUpdate }
      $player.pokedex.register_last_seen(@pokemon)
      pbFadeOutIn do
        scene = PokemonPokedexInfo_Scene.new
        screen = PokemonPokedexInfoScreen.new(scene)
        screen.pbDexEntry(@pokemon.species)
        @sprites["msgwindow"].text = "" if moves_to_learn.length > 0
        pbEndScreen(false) if moves_to_learn.length == 0
      end
    end
    # Learn moves upon evolution for evolved species
    moves_to_learn.each do |move|
      pbLearnMove(@pokemon, move, true) { pbUpdate }
    end
  end

Understood. Sorry for the false alarm. That's what I get for trying to implement a new plugin as fast as possible while my main focus is elsewhere. Thanks for the help.

EDIT: Yeah, actually looking through the code now, and the mistake I made was obvious. It works perfectly now. Sorry again. For whatever it's worth, I would suggest you mark the other changes you made in the example script in the same way you did for the animation function. In addition to not actually comparing the two versions of the script, my problem was that I assumed you had marked all changes you made to the base script.
 
Last edited:
Thanks for this, I think this animations give any game an instant glow up. I was wondering if there would be an easy way to implement a "playAnim" command inside DBK midbattle scripting, similar to the "playCry" command that already exists, it could be cool to have such ability when scripting a battle
 
Will there be Pokémon metrics that come with it? My front and back sprites are positioned weirdly. Sorry if somenoe asked this already.
 
Will there be Pokémon metrics that come with it? My front and back sprites are positioned weirdly. Sorry if somenoe asked this already.
Yes, one of the next things on the todo list is to move the animation data in the pokemon metrics pbs so the appropriate positioning of the various sprites will come along with those.

You can still go in the debug sprite positioner and adjust them to your own liking 👍
 
Is this plugin compatible with Essentials Deluxe?
Code:
Expand Collapse Copy
=================

[Pokémon Essentials version 20.1]
[v20.1 Hotfixes 1.0.7]

Exception: ArgumentError
Message: wrong number of arguments (given 7, expected 2..3)

Backtrace:
[Essentials Deluxe] Species Files.rb:77:in `check_graphic_file'
[[F2P] Gen 4 Battle Entry Animations] MethodOverrides.rb:330:in `sprite_name_from_pokemon'
[[F2P] Gen 4 Battle Entry Animations] script.rb:22:in `initialize'
[[F2P] Gen 4 Battle Entry Animations] MethodOverrides.rb:259:in `new'
[[F2P] Gen 4 Battle Entry Animations] MethodOverrides.rb:259:in `pbPlayIntroAnimation'
PictureEx:128:in `call'
PictureEx:128:in `callback'
PictureEx:441:in `block in update'
PictureEx:348:in `each'
PictureEx:348:in `each_with_index'
 
Is this plugin compatible with Essentials Deluxe?

Hi, as it's outlined in the main post:
⚠️ This Plugin may not be fully compatible with others that do similar things like gen 5 animations or battle scene overhauls

It looks like the plugin you are using is also aliasing some of the file-fetching methods MethodOverrides.rb overrides.
I can look into this to provide support for the users of this other plugin;
can you confirm you are using Deluxe Battle Kit on its latest release version?

If you need help fixing this issue or if you already have a solution for it, I'd be glad to assist you directly on the dedicated #🚩-report-an-issue chat of the discord.
 
Hi, as it's outlined in the main post:


It looks like the plugin you are using is also aliasing some of the file-fetching methods MethodOverrides.rb overrides.
I can look into this to provide support for the users of this other plugin;
can you confirm you are using Deluxe Battle Kit on its latest release version?

If you need help fixing this issue or if you already have a solution for it, I'd be glad to assist you directly on the dedicated #🚩-report-an-issue chat of the discord.
he can't since he is on v20.1, so maybe theres is some method that only exist on v21.1 that is causing the crash for him?
 
he can't since he is on v20.1, so maybe theres is some method that only exist on v21.1 that is causing the crash for him?
Well, this plugin is also compatible with v20.1, so if I was to find a solution to their issue, I would need a copy of their version of that other plugin anyway.
 
Back
Top