• 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!
  • Which Pokémon Masters protagonist do you like most? Let us know by casting a vote in our Masters favorite protagonist poll here!
  • Red, Hilda, Paxton, or Kellyn - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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.

Updating animated gif battlers (fixed)

KillerMapper

Helix Follower
  • 200
    Posts
    10
    Years
    Hello,

    I tried to replace the battler sprites by animated ones (gif format). Sprites are displayed correctly, but not animated except during the move selection.

    I tried to find some fixes but without any success for now. I tried to look in the code, but I'm lost in it. I only know very basics. Seems like I need to update the sprites during the attacks... Any ideas for this ?

    I'm surprised there is no tutorial about this problem. Maybe I missed it ?

    Thanks.
     
    Last edited:
    It's not a problem. Essentials was not designed in the start to be utilizing animated GIFs as Pokemon Sprites. That being said, this question has been asked and answered numerous times already. All you had to do is search this forum.

    Anyway, check this thread here.
     
    Well... I've been looking in all this forum and I successfully missed this topic...

    I'll try to get this working now. Thanks for your help.

    Edit : it worked, battlers are animated. But...
    I can't rid of this : i.imgur.com/lGphJtH.jpg

    When the foe pokémon faints, it's sprite goes down as usual, then vanishes. But it comes back immediately, when the message "The foe X fainted". I've just added "pbFrameUpdate(nil)" where it was needed to update the battler gifs, nothing more.

    I looked on the script that manage fainted pokémon animation :

    Code:
    # This method is called whenever a Pokémon faints.
      def pbFainted(pkmn)
        frames=pbCryFrameLength(pkmn.pokemon)
        pbPlayCry(pkmn.pokemon)
        frames.times do
          pbGraphicsUpdate
          pbInputUpdate
          pbFrameUpdate(nil)
        end
        @sprites["shadow#{pkmn.index}"].visible=false
        pkmnsprite=@sprites["pokemon#{pkmn.index}"]
        ycoord=0
        if @battle.doublebattle
          ycoord=PokeBattle_SceneConstants::PLAYERBATTLERD1_Y if pkmn.index==0
          ycoord=PokeBattle_SceneConstants::FOEBATTLERD1_Y if pkmn.index==1
          ycoord=PokeBattle_SceneConstants::PLAYERBATTLERD2_Y if pkmn.index==2
          ycoord=PokeBattle_SceneConstants::FOEBATTLERD2_Y if pkmn.index==3
        else
          if @battle.pbIsOpposing?(pkmn.index)
            ycoord=PokeBattle_SceneConstants::FOEBATTLER_Y
          else
            ycoord=PokeBattle_SceneConstants::PLAYERBATTLER_Y
          end
        end
        pbSEPlay("faint")
        loop do
          pkmnsprite.y+=8
          if pkmnsprite.y-pkmnsprite.oy+pkmnsprite.src_rect.height>=ycoord
            pkmnsprite.src_rect.height=ycoord-pkmnsprite.y+pkmnsprite.oy
          end
          pbGraphicsUpdate
          pbInputUpdate
          pbFrameUpdate(nil)
          break if pkmnsprite.y>=ycoord
        end
        8.times do
          @sprites["battlebox#{pkmn.index}"].opacity-=32
          pbGraphicsUpdate
          pbInputUpdate
    #      pbFrameUpdate(nil)
        end
        @sprites["battlebox#{pkmn.index}"].visible=false
        pkmn.pbResetForm
      end

    This is the default script in PE, with some extra pbFrameUpdate.
    The battler sprite should vanish progressively then become invisible. But it keep going back immediately when the next text message appears... The issue is probably in another script...

    Maybe I could just move the sprite to a higher y coord, so it goes outside the screen. I'll try it later.

    Edit : ok the fix worked.
     
    Last edited:
    Back
    Top