View Single Post
Old March 16th, 2013 (4:35 PM).
miksy91's Avatar
miksy91 miksy91 is offline
Dark Energy is back in action! ;)
    Join Date: Oct 2008
    Location: A small country in the North
    Gender: Male
    Nature: Relaxed
    Posts: 1,438
    Originally Posted by Reygok View Post
    My question: I need a new offset for my new pokémon's moveset, how much space do I need?

    Thanks in advance for all answers
    There are more than 256 different moves in Gen III games. And what I refer this by is that 0x100 as hexadecimal number stands for 256 in decimal. And in other words, we can't describe all the moves by just using one single byte, we need another (or at least part of it).

    So basically, each move takes 2 bytes space. And pokemon's level value is only (at maximum) one byte long (which it most likely is) so there could be a structure such as this one built in the game for each pokemon:
    [Level] [Move parameter 1] [Move parameter 2] [Level] [Move parameter 1] [Move parameter 2] [Level] ...

    So each move takes three bytes, the level the pokemon learns the certain move at along with two bytes describing the move the pokemon learns. So if you for example make a certain pokemon learn 10 different moves, that takes (10 * 3 = ) 30 bytes (and 0x1E bytes in hex).
    And if that move data would be stored in offset 0x740005 in the rom for instance, the move data would end at offset 0x740005 + 0x1E - 0x1 = 0x740022


    Why did I subtract 0x1 from (0x740005 + 0x1E) there? Well the logic is exactly the same as in this following example.

    Think about reading pages 1 and 2 of a certain book. How many pages have you read? 2-1 = 1 ? No, you've read 2 pages, or 2-1 + 1 pages.

    This whole thing is just an assumption because I don't know if the structure really is like that. But you can easily check it out with a hex editor by looking for the move learning data of a certain pokemon.
    My Rom Hack

    Fixing bugs in a ROM hack
    CP of encountered pokemon in GO

    Learn how to hack GB/C games:

    Check my GameBoy/Color hacking videos in Youtube
    -The video set uses Pokemon Silver (U) rom for demonstrations