• 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!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • 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.

[Error] Animated Sprites EBDX Problem (19.1)

YashPokeFan123

#PokeFan
  • 283
    Posts
    4
    Years
    • Seen Sep 27, 2024
    Hi, i have extracted Ebdx files into my game directly. but animated sprites doesnot come tell how i can fix it. its only static sprites

    Edit - Its problem with gen 8 project. but can you tell how to fix with gen 8 project
     
    Last edited:
    I actually 'had' this same exact issue yesterday when finally intergrated those two system to get a feel for what the community been up to over so long.

    I was rather confused regarding how the two systems were supposed to interact. It is purposeful that static sprites overlap animated sprite, it would have been awesome if Project Gen 8 had a separate folder that doesn't include the first 650 pokemons, thus static sprite wouldn't overlap.

    One solution would be to either Delete all the static sprite that would overlap the animated numbered sprite, or rename the animated numbered sprite to the symbols the static sprites currently possess.

    Both seems 'rather' annoying even with a renamer.

    The 'easiest' solution, or rather the solution that was appropriate for my situation was just to simply change how Luka's script would prioritize numbered. Alternatively, you could put all EBDX battler sprite into the graphics battler, and have it rename it then move it back, blah blah blah. (I spent like a good 1 hour on this lol, and my skills and patience didn't allow me to rename all animated sprite to symbols. Which is fine, another day.

    Copy and Paste this into the 'battler bitmap.rb' within '[000] battle core'.

    All the chances (3 slight changes) just prioritize numbered over symbol. e.g. 001 will be prioritize over BULBASAUR.

    Spoiler:
     
    Last edited:
    I actually 'had' this same exact issue yesterday when finally intergrated those two system to get a feel for what the community been up to over so long.

    I was rather confused regarding how the two systems were supposed to interact. It is purposeful that static sprites overlap animated sprite, it would have been awesome if Project Gen 8 had a separate folder that doesn't include the first 650 pokemons, thus static sprite wouldn't overlap.

    One solution would be to either Delete all the static sprite that would overlap the animated numbered sprite, or rename the animated numbered sprite to the symbols the static sprites currently possess.

    Both seems 'rather' annoying even with a renamer.

    The 'easiest' solution, or rather the solution that was appropriate for my situation was just to simply change how Luka's script would prioritize numbered. Alternatively, you could put all EBDX battler sprite into the graphics battler, and have it rename it then move it back, blah blah blah. (I spent like a good 1 hour on this lol, and my skills and patience didn't allow me to rename all animated sprite to symbols. Which is fine, another day.

    Copy and Paste this into the 'battler bitmap.rb' within '[000] battle core'.

    All the chances (3 slight changes) just prioritize numbered over symbol. e.g. 001 will be prioritize over BULBASAUR.

    Code:
    #===============================================================================
    #  Loads an animated BitmapWrapper for Pokemon
    #===============================================================================
    def pbLoadPokemonBitmap(pokemon, back = false, scale = EliteBattle::FRONT_SPRITE_SCALE, speed = 2)
      return pbLoadPokemonBitmapSpecies(pokemon, pokemon.species, back, scale, speed)
    end
    #===============================================================================
    #  Loads an animated BitmapWrapper for Pokemon species
    #===============================================================================
    def pbLoadPokemonBitmapSpecies(pokemon, species, back = false, scale = EliteBattle::FRONT_SPRITE_SCALE, speed = 2)
      ret = nil
      pokemon = pokemon.pokemon if pokemon.respond_to?(:pokemon)
      species = :BIDOOF if GameData::Species.exists?(:BIDOOF) && defined?(firstApr?) && firstApr?
      # sauce flip
      species = pokemon.species if species.nil? && pokemon.respond_to?(:species)
      # return question marks if no species provided
      return BitmapEBDX.new("Graphics/EBDX/Battlers/000", scale) if species.nil?
      # applies scale
      scale = back ? EliteBattle::BACK_SPRITE_SCALE : EliteBattle::FRONT_SPRITE_SCALE
      # gets additional scale (if applicable)
      s = EliteBattle.get_data(species, :Species, (back ? :BACKSCALE : :SCALE), (pokemon.form rescue 0))
      scale = s if !s.nil? && s.is_a?(Numeric)
      # get more metrics
      s = EliteBattle.get_data(species, :Species, :SPRITESPEED, (pokemon.form rescue 0))
      speed = s if !s.nil? && s.is_a?(Numeric)
      if pokemon.egg?
        bitmapFileName = sprintf("Graphics/EBDX/Battlers/Eggs/%s", species) rescue nil
        if !pbResolveBitmap(bitmapFileName)
          bitmapFileName = sprintf("Graphics/EBDX/Battlers/Eggs/%03d", GameData::Species.get(species).id_number)
          if !pbResolveBitmap(bitmapFileName)
            bitmapFileName = sprintf("Graphics/EBDX/Battlers/Eggs/000")
          end
        end
        bitmapFileName = pbResolveBitmap(bitmapFileName)
      else
        shiny = pokemon.shiny?
        shiny = pokemon.superVariant if (!pokemon.superVariant.nil? && pokemon.superShiny?)
        params = [species, back, pokemon.female?, shiny, (pokemon.form rescue 0), (pokemon.shadowPokemon? rescue false), (pokemon.dynamax rescue false), (pokemon.dynamax && pokemon.gfactor rescue false)]
        bitmapFileName = pbCheckPokemonBitmapFiles(params)
      end
      if bitmapFileName.nil?
        bitmapFileName = "Graphics/EBDX/Battlers/000"
        EliteBattle.log.warn(missingPokeSpriteError(pokemon, back))
      end
      animatedBitmap = BitmapEBDX.new(bitmapFileName, scale, speed) if bitmapFileName
      ret = animatedBitmap if bitmapFileName
      # Full compatibility with the alterBitmap methods is maintained
      # but unless the alterBitmap method gets rewritten and sprite animations get
      # hardcoded in the system, the bitmap alterations will not function properly
      # as they will not account for the sprite animation itself
    
      # alterBitmap methods for static sprites will work just fine
      alterBitmap = (MultipleForms.getFunction(species, "alterBitmap") rescue nil) if !pokemon.egg? && animatedBitmap && animatedBitmap.totalFrames == 1 # remove this totalFrames clause to allow for dynamic sprites too
      if bitmapFileName && alterBitmap
        animatedBitmap.prepare_strip
        for i in 0...animatedBitmap.totalFrames
          alterBitmap.call(pokemon, animatedBitmap.alter_bitmap(i))
        end
        animatedBitmap.compile_strip
        ret = animatedBitmap
      end
      # adjusts for custom animation loops
      data = EliteBattle.get_data(species, :Species, :FRAMEANIMATION, (pokemon.form rescue 0))
      unless data.nil?
        ret.compile_loop(data)
      end
      # applies super shiny hue
      ret.hue_change(pokemon.superHue) if pokemon.superHue && !ret.changedHue?
      # refreshes bitmap
      ret.deanimate if ret.respond_to?(:deanimate)
      return ret
    end
    #===============================================================================
    #  Pokemon icon aditions
    #===============================================================================
    def pbPokemonIconFile(pokemon)
      bitmapFileName = nil
      species = :BIDOOF if GameData::Species.exists?(:BIDOOF) && defined?(firstApr?) && firstApr?
      # sauce flip
      species = pokemon.species
      bitmapFileName = pbCheckPokemonIconFiles([species, (pokemon.female?),
         pokemon.shiny?,(pokemon.form rescue 0),(pokemon.shadowPokemon? rescue false)],
         pokemon.egg?)
      return bitmapFileName
    end
    #===============================================================================
    #  Loads animated BitmapWrapper for species
    #===============================================================================
    def pbLoadSpeciesBitmap(species, female=false, form=0, shiny=false, shadow=false, back=false, egg=false, scale=EliteBattle::FRONT_SPRITE_SCALE)
      ret = nil
      species = :BIDOOF if GameData::Species.exists?(:BIDOOF) && defined?(firstApr?) && firstApr?
      # return question marks if no species provided
      return BitmapEBDX.new("Graphics/EBDX/Battlers/000", scale) if species.nil?
      # applies scale
      scale = back ? EliteBattle::BACK_SPRITE_SCALE : EliteBattle::FRONT_SPRITE_SCALE
      # gets additional scale (if applicable)
      s = EliteBattle.get_data(species, :Species, (back ? :BACKSCALE : :SCALE), (form rescue 0))
      scale = s if !s.nil? && s.is_a?(Numeric)
      # check sprite
      if egg
        bitmapFileName = sprintf("Graphics/EBDX/Battlers/Eggs/%s", species) rescue nil
        if !pbResolveBitmap(bitmapFileName)
          bitmapFileName = sprintf("Graphics/EBDX/Battlers/Eggs/%03d", GameData::Species.get(species).id_number)
          if !pbResolveBitmap(bitmapFileName)
            bitmapFileName = sprintf("Graphics/EBDX/Battlers/Eggs/000")
          end
        end
        bitmapFileName = pbResolveBitmap(bitmapFileName)
      else
        bitmapFileName = pbCheckPokemonBitmapFiles([species, back, female, shiny, form, shadow, false, false])
      end
      if bitmapFileName
        ret = BitmapEBDX.new(bitmapFileName, scale)
      end
      # adjusts for custom animation loops
      data = EliteBattle.get_data(species, :Species, :FRAMEANIMATION, form)
      unless data.nil?
        ret.compile_loop(data)
      end
      # refreshes bitmap
      ret.deanimate if ret.respond_to?(:deanimate)
      return ret
    end
    #===============================================================================
    #  Returns error message upon missing sprites
    #===============================================================================
    def missingPokeSpriteError(pokemon, back)
      error_b = back ? "Back" : "Front"
      error_b += "Shiny" if pokemon.shiny?
      error_b += "/Female/" if pokemon.female?
      error_b += " shadow" if pokemon.shadowPokemon?
      error_b += " form #{pokemon.form} " if pokemon.form > 0
      return "Looks like you're missing the #{error_b} sprite for #{GameData::Species.get(pokemon.species).real_name}!"
    end
    #===============================================================================
    #  New methods of handing Pokemon sprite name references
    #===============================================================================
    def pbCheckPokemonBitmapFiles(params)
      species = params[0]; back = params[1]; factors = []
      factors.push([5, params[5], false]) if params[5] && params[5] != false # shadow
      factors.push([2, params[2], false]) if params[2] && params[2] != false # gender
      factors.push([3, params[3], false]) if params[3] && params[3] != false # shiny
      factors.push([6, params[6], false]) if params[6] && params[6] != false # dynamaxed
      factors.push([7, params[7], false]) if params[7] && params[7] != false # gigantimaxed
      factors.push([4, params[4].to_s, ""]) if params[4] && params[4].to_s != "" && params[4].to_s != "0" # form
      tshadow = false; tgender = false; tshiny = false; tform = ""
      for i in 0...(2**factors.length)
        for j in 0...factors.length
          case factors[j][0]
          when 2   # gender
            tgender = ((i/(2**j))%2 == 0) ? factors[j][1] : factors[j][2]
          when 3   # shiny
            tshiny = ((i/(2**j))%2 == 0) ? factors[j][1] : factors[j][2]
          when 4   # form
            tform = ((i/(2**j))%2 == 0) ? factors[j][1] : factors[j][2]
          when 5   # shadow
            tshadow = ((i/(2**j))%2 == 0) ? factors[j][1] : factors[j][2]
          when 6   # dynamaxed
            tdyna = ((i/(2**j))%2 == 0) ? factors[j][1] : factors[j][2]
          when 7   # gigantimaxed
            tgigant = ((i/(2**j))%2 == 0) ? factors[j][1] : factors[j][2]
          end
        end
        folder = "Graphics/EBDX/Battlers/"
        if tshiny && back
          folder += "BackShiny"
        elsif tshiny
          folder += "FrontShiny"
        elsif back
          folder += "Back"
        else
          folder += "Front"
        end
        dirs = []; dirs.push("/Gigantimax") if tgigant; dirs.push("/Dynamax") if tdyna && !tgigant; dirs.push("/Female") if tgender; dirs.push("")
        for dir in dirs
          bitmapFileName = sprintf("#{folder}#{dir}/%03d%s%s", GameData::Species.get(species).id_number, (tform != "" ? "_" + tform : ""), tshadow ? "_shadow" : "")
          ret = pbResolveBitmap(bitmapFileName)
          return ret if ret
        end # flip
        for dir in dirs
          bitmapFileName = sprintf("#{folder}#{dir}/%s%s%s", species, (tform != "" ? "_" + tform : ""), tshadow ? "_shadow" : "") rescue nil
          ret = pbResolveBitmap(bitmapFileName)
          return ret if ret
        end
      end
      return nil
    end
    #===============================================================================
    #  Returns full path for sprite
    #===============================================================================
    def pbPokemonBitmapFile(species, shiny, back=false)
      folder = "Graphics/EBDX/Battlers/"
      if shiny && back
        folder += "BackShiny/"
      elsif shiny
        folder += "FrontShiny/"
      elsif back
        folder += "Back/"
      else
        folder += "Front/"
      end
      name = sprintf("#{folder}%03d", GameData::Species.get(species).id_number)
      ret = pbResolveBitmap(name)
      return ret if ret
      name = sprintf("#{folder}%s", species) rescue nil
      return pbResolveBitmap(name)
      # name = sprintf("#{folder}%s", species) rescue nil
      # ret = pbResolveBitmap(name)
      # return ret if ret
      # name = sprintf("#{folder}%03d", GameData::Species.get(species).id_number)
      # return pbResolveBitmap(name)
    end
    #===============================================================================
    #  Game data overrides
    #===============================================================================
    module GameData
      #-----------------------------------------------------------------------------
      #  Species class (bitmaps)
      #-----------------------------------------------------------------------------
      class Species
        #---------------------------------------------------------------------------
        #  get bitmap from species
        #---------------------------------------------------------------------------
        def self.sprite_bitmap(species, form = 0, gender = 0, shiny = false, shadow = false, back = false, egg = false)
          return pbLoadSpeciesBitmap(species, (gender == 1), form, shiny, shadow, back, egg)
        end
        #---------------------------------------------------------------------------
        #  get bitmap from Pokemon
        #---------------------------------------------------------------------------
        def self.sprite_bitmap_from_pokemon(pokemon, back = false, species = nil)
          return pbLoadPokemonBitmapSpecies(pokemon, species, back)
        end
        #---------------------------------------------------------------------------
        #  get icon from species
        #---------------------------------------------------------------------------
        def self.icon_bitmap(species, form = 0, gender = 0, shiny = false, shadow = false)
          species = :BIDOOF if GameData::Species.exists?(:BIDOOF) && defined?(firstApr?) && firstApr?
          filename = self.icon_filename(species, form, gender, shiny, shadow)
          return (filename) ? AnimatedBitmap.new(filename).deanimate : nil
        end
        #---------------------------------------------------------------------------
        #  get icon from Pokemon
        #---------------------------------------------------------------------------
        def self.icon_bitmap_from_pokemon(pkmn)
          species = (GameData::Species.exists?(:BIDOOF) && defined?(firstApr?) && firstApr?) ? :BIDOOF : pkmn.species
          return self.icon_bitmap(species, pkmn.form, pkmn.gender, pkmn.shiny?, pkmn.shadowPokemon?, pkmn.egg?)
        end
        #---------------------------------------------------------------------------
      end
      #-----------------------------------------------------------------------------
    end

    Very much thanks for helping me
     
    Gg to your changes when I push the next update. The proper approach is to delete all the static sprites and use the sprite sheets provided by EBDX, if you want sprite animation from EBDX. You should not be fiddling with the scripts for something as trivial as this.
     
    Thank you very much for sharing this solution.
    Is there any way to do the same with the Cries?
    In my project I have more than one version of Cries, so renaming everything seems like a herculean task.
    Thank you!
     
    Back
    Top