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

Animating battle sprites problem

65
Posts
9
Years
  • I'm having a problem with the Animation Tutorial of Luka S.J.

    I was using the last version of essentials when I started to find some differences between the tutorial and the actual script.

    Problems began to appear when the tutorial says that I should delete the function pbPlayCry on def pbTrainerSendOut and def pbSendOut, but I couldn't find that, at least, not in the definition.

    But I followed the Tutorial, ignoring the problem above, but when I enter on a battle, the Cry is played 2 times, and I'm not sure where should I delete the function pbPlayCry

    Also, when I enter the Summary menu, that error appears

    ---------------------------
    Pokemon Essentials
    ---------------------------
    Exception: NoMethodError

    Message: undefined method `bitmap' for #<BitmapWrapper:0xa92c188>

    PokemonSprite:71:in `setPokemonBitmap'

    PokemonSummary:83:in `pbStartScene'

    PokemonSummary:972:in `pbStartScreen'

    PokemonParty:881:in `pbSummary'

    PokemonParty:1984:in `pbPokemonScreen'

    PokemonParty:1893:in `loop'

    PokemonParty:2019:in `pbPokemonScreen'

    PokemonPauseMenu:173:in `pbStartPokemonMenu'

    PokemonPauseMenu:172:in `pbFadeOutIn'

    PokemonPauseMenu:172:in `pbStartPokemonMenu'

    Any help is welcome.
     

    Luka S.J.

    Jealous Croatian
    1,270
    Posts
    15
    Years
  • Yo yo yo. Firstly, that tut is waaay, outdated. The new instances of the battle scene don't handle sprites they way they used to.

    Secondly, I'm working on a sweet new animation method for the sprites, that replaces the old bitmap wrapper with a new one, adding support for sweet gen-5 like animations (that aren't GIFs). Along with that I have some tools with it that can convert GIFs to the format. Anyway, long story short. I'm going to be uploading the stuff somewhere in the next week (hopefully), so you might want to wait for that. If two frame animations are your thing, I'm sure that by now there are much simpler and more efficient methods of doing those anyway, so dwelling on that old tut isn't very beneficial.

    Also your error comes from the fact that the new pbLoadPokemonBitmap uses AnimatedBitmaps, which behave very differently to just regular bitmap wrappers. The entire Essentials system has been adapted to use those new AnimatedBitmaps, as they provided support for GIFs and such. So with my old method, I didn't use the AnimatedBitmap thing, and now when you plug and play it, you're missing functions which get called from other systems.

    If you're interested > new bitmap class <

    [EDIT]
    Now that you brought it up, I'll add support for two frame animations to the new bitmap loader. For those that prefer the "older" look. Implementation on how to actually use that, will come at a later time.
     
    Last edited:
    65
    Posts
    9
    Years
  • Oh, thanks, well, I'm not a programmer, but I had some few classes about C-language, and I kind of understand some parts of scripts.
    But, if you excuse me, I would like to know how this your new script works.
    I took a look but, I can't figure it out, it says that it's not compatible with Gif, but there are some functions that calculate the number of frames and starts a loop. Or it uses an animated PNG?
     

    Luka S.J.

    Jealous Croatian
    1,270
    Posts
    15
    Years
  • You replace the AnimatedBitmap instances within the def pbLoadPokemonBitmapSpecies, with my new AnimatedPokemonBitmap. The sprites have to be correctly formatted, and I have made a few conversion tools to convert from GIF to PNG, and resize from 2*px resolution to 1*px resolution. Alternatively you can download the pack I've compiled for the format.
     
    65
    Posts
    9
    Years
  • Oh, thanks, it really works.

    Oh, just a tip, in the pack that you linked, the sprites can reduced using simple tools, like Paint.NET. An example, Venusaur sprite can be reduced from 110kb to 70kb. But this is not a problem, just a tip.

    Anyway, as far as I tested, you script was working fine.
     

    Luka S.J.

    Jealous Croatian
    1,270
    Posts
    15
    Years
  • Oh, thanks, it really works.

    Oh, just a tip, in the pack that you linked, the sprites can reduced using simple tools, like Paint.NET. An example, Venusaur sprite can be reduced from 110kb to 70kb. But this is not a problem, just a tip.

    Anyway, as far as I tested, you script was working fine.

    Considering that I have already reduced the sprites from the 800kb+ they were in GIF format to this, saving up even more space is not much of a concern to me at this moment. The user is feel free to use my repacked sprites, or repack their own (on the topic of sprites, backsprites for alternate formes are messed up). And yes, it really works. I'm including it in an add-on I'm making for Essentials. You might want that when it comes out.
     
    65
    Posts
    9
    Years
  • Ah, sorry to bother you again, but I'm having a problem with the Pokédex. In the main Pokédex Screen and the Form Page all frames are displayed at the same time. I managed to fix in the Info page, by replacing AnimatedBitmap with AnimatedPokemonBitmap, but I couldn't find a way to fix the others.
     
    57
    Posts
    10
    Years
    • Seen Sep 10, 2022
    I'm really interested in this project, I love gen 5 animated sprites!
    I searched in scripts.rxdata - SpriteWindow and replaced "class AnimatedBitmap" with "class AnimatedPokemonBitmap" using your code here
    https://pastebin.com/i63Za203
    But this makes the game to crash, so I don't understand how your code works, con you make a short tutorial please?
     
    65
    Posts
    9
    Years
  • Hm, well, I'll tell you what i did, I created a new script section above Main, and then, in Pokémon Utilities, I replaced every AnimatedBitmap with AnimatedPokemonBitmap
     
    57
    Posts
    10
    Years
    • Seen Sep 10, 2022
    Thank you it really works!
    Anyway animated bitmap sprites stop during attack animations.
    So I prefer using GIFs that never stop!

    Just go in PokeBattle_ActualScene

    search for def pbInputUpdate

    and just add a line with: pbFrameUpdate(nil)

    That's much more simple for me =)
     

    Luka S.J.

    Jealous Croatian
    1,270
    Posts
    15
    Years
  • Ah, sorry to bother you again, but I'm having a problem with the Pokédex. In the main Pokédex Screen and the Form Page all frames are displayed at the same time. I managed to fix in the Info page, by replacing AnimatedBitmap with AnimatedBitmapWrapper, but I couldn't find a way to fix the others.

    This was just an idea in development, I haven't fully implemented all of it yet, so I have not released an official tutorial. That being said, to fix your problem, go to the PokemonPokedex script, and in the class PokemonPokedexScene, under def setIconBitmap, replace
    Code:
    @sprites["icon"].setBitmap(file)
    with
    Code:
    @sprites["icon"].bitmap=AnimatedBitmapWrapper.new(file).bitmap

    Hm, well, I'll tell you what i did, I created a new script section above Main, and then, in Pokémon Utilities, I replaced every AnimatedBitmap with AnimatedPokemonBitmap

    I never told you to replace every single instance of AnimatedBitmap inside the PokemonUtilities. I only told you to replace the instances within def pbLoadPokemonBitmapSpecies, which there are two of.
    ___________________________________________________________________________________________________________
    I'm really interested in this project, I love gen 5 animated sprites!
    I searched in scripts.rxdata - SpriteWindow and replaced "class AnimatedBitmap" with "class AnimatedPokemonBitmap" using your code here
    https://pastebin.com/i63Za203
    But this makes the game to crash, so I don't understand how your code works, con you make a short tutorial please?

    Serious talk here. It gets really frustrating and demotivating for developers like me to release any kind of public scripts, when the users are not capable of following simple instructions. I'd advise reading what we actually write, before trying to blindly implement things.

    Thank you it really works!
    Anyway animated bitmap sprites stop during attack animations.
    So I prefer using GIFs that never stop!

    The GIFs by default are not animated within attack animations either. Using GIFs over what I did offers you no advantages what-so-ever. The reason your GIFs animate, is because of the pbFrameUpdate method, which you have to manually put in the AnimationCore. The pbFrameUpdate updates my animated bitmaps just like it would regular GIFs, since my system is completely plug and play. No additional methods are need. If you already had updates in places for your GIFs, my sprites will update as well.
     
    Last edited:
    65
    Posts
    9
    Years
  • I never told you to replace every single instance of AnimatedBitmap inside the PokemonUtilities. I only told you to replace the instances within def pbLoadPokemonBitmapSpecies, which there are two of.

    That's what I did, sorry, I just forgot to write that I replaced every instance within pbLoadPokemonBitmapSpecies.
     
    57
    Posts
    10
    Years
    • Seen Sep 10, 2022
    It's my fault, I'm not good in english, I'm sorry.

    Finally I managed to get it work and it's perfect!
     
    57
    Posts
    10
    Years
    • Seen Sep 10, 2022
    You replace the AnimatedBitmap instances within the def pbLoadPokemonBitmapSpecies, with my new AnimatedPokemonBitmap. The sprites have to be correctly formatted, and I have made a few conversion tools to convert from GIF to PNG, and resize from 2*px resolution to 1*px resolution. Alternatively you can download the pack I've compiled for the format.

    Your sprite pack is awesome but I saw some "bugs".

    I noticed the sprite "023sb" is a shiny abra (back) instead of a shiny ekans (back) and this goes till "063sb" from 064 it's ok.

    Another thing is I saw dugtrio animations has 3 frames in which you can spot a white square that covers the pokemon.

    Over these little things your work is well done!
     

    Luka S.J.

    Jealous Croatian
    1,270
    Posts
    15
    Years
  • Your sprite pack is awesome but I saw some "bugs".

    I noticed the sprite "023sb" is a shiny abra (back) instead of a shiny ekans (back) and this goes till "063sb" from 064 it's ok.

    Another thing is I saw dugtrio animations has 3 frames in which you can spot a white square that covers the pokemon.

    Over these little things your work is well done!

    I know there are bugs. Chansey's animations are messed up as it starts missing limbs. Diglett completely disappears on some frames. Most of the alternate form backsprites don't have correct transparencies, and so on. This actually stems from the problem of RMXP not playing GIFs properly. All the PNGs from my pack are formatted from GIFs loaded through RMXP. So if you used the original GIFs, you'd get the same problems at higher file sizes, and potential system crashes. I don't have the time or patience, to manually go through 2700+ sprites in Fireworks, and correctly adjust their transparencies and frames in the GIFs before converting them. Like I said, this is still work in progress, which is why I haven't made any formal tutorials of it. I've simply provided you with a more efficient alternative to using GIFs. If you want to maximize the results of that, you're going to have to sort out the sprites to your liking.
     
    Last edited:
    65
    Posts
    9
    Years
  • Replacing @sprites["icon"].bitmap=AnimatedPokemonBitmap.new(file).bitmap fixed the main Pokédex bug, but the Info page and Form Page still display all frames at once.
    But, like you said, "This was just an idea in development", so if you have time, that problem still need to be fixed.
    I'll keep trying to fix this problem by my own (but I'm not sure about my success).
    Anyway, great work, I'll look forward for your add-on.
     

    Luka S.J.

    Jealous Croatian
    1,270
    Posts
    15
    Years
  • This was just an idea in development, I haven't fully implemented all of it yet, so I have not released an official tutorial. That being said, to fix your problem, go to the PokemonPokedex script, and in the class PokemonPokedexScene, under def setIconBitmap, replace
    Code:
    @sprites["icon"].setBitmap(file)
    with
    Code:
    @sprites["icon"].bitmap=AnimatedBitmapWrapper.new(file).bitmap
    Replacing @sprites["icon"].bitmap=AnimatedBitmapWrapper.new(file).bitmap fixed the main Pokédex bug, but the Info page and Form Page still display all frames at once.
    But, like you said, "This was just an idea in development", so if you have time, that problem still need to be fixed.
    I'll keep trying to fix this problem by my own (but I'm not sure about my success).
    Anyway, great work, I'll look forward for your add-on.

    My apologies, I misunderstood you. I thought you only needed the fix for the main Pokedex page. In PokemonNestAndForm replace all AnimatedBitmap instances with my AnimatedBitmapWrapper. In PokemonPokedex, around line 727 you should see
    Code:
    pkmnbitmap=AnimatedBitmap.new(pbPokemonBitmapFile(species,false))
    replace the AnimatedBitmap part in that, with my AnimatedBitmapWrapper.


    *compatibility with EB2015
     
    Last edited:
    Back
    Top