View Single Post
Old June 20th, 2010 (10:19 AM). Edited November 15th, 2011 by altariaking.
altariaking's Avatar
altariaking altariaking is offline
Needs NO VMs...
    Join Date: Dec 2009
    Location: Scotland, Lesmahagow
    Age: 43
    Gender: Male
    Nature: Naive
    Posts: 1,098
    We all know that from Emerald the Pokemon were animated. However, what if this was possible in Ruby and FireRed?
    Well, it is.
    The offset 1E7C64 in Ruby (2349BC in FireRed) is the pointer to the data that tells us how the sprites behave when they appear. So, first of all, simply repoint it to another offset. Simply take your desired offset (I'll be using 0xB00000) and split it into segments.
    B0 00 00
    Then, swap the first two digits (B0) with the last two (00), and then add 08 to the end. So now we have this:
    00 00 B0 08
    Now, we must go to the offset it was repointed to, and then we need the animation data.
    The first byte is the frame number.
    The second byte does nothing.
    The third byte is how long the image is displayed.
    The fourth byte, again, does nothing.
    To end the animation you must add
    FF FF 00 00
    So, here is an example of it all in action:
    00 00 0F 00
    01 00 0F 00
    00 00 0F 00
    01 00 0F 00
    00 00 0F 00
    FF FF 00 00
    Of course you can make this code longer if you want, and even add more frames.
    Now, all sprites will have a second frame, so now just insert the two frames for every sprite. A good, efficient way to do this is to insert a blank 128x64 image over every Pokemon in Unl-Z GBA, and then use Advanced Sprite Editor to insert all of the individual frames. You must do this for EVERY Pokemon and their Backsprite, otherwise there are a lot of bugs. Like turning into the Hero.

    There are, however, a few bugs with using this. For instance, as I stated previously, if you don't insert two frames for a Pokemon, it will turn into the player's backsprite. When you exit the bag, or Pokemon menu during a battle, the Pokemon's sprite will move again. Also, if you make the animation data short, then you might not see it during wild battles, and if you make it too long then it will take a while before it does its thing in Trainer battles and the stats screen and such. I think that's it. :\
    Reply With Quote