Pokemon Moves - haven1433/HexManiacAdvance GitHub Wiki

This page explains the various ways that a pokemon can learn and use moves in the game, and how to adjust those moves with HexManiacAdvance.

Level Up Moves

What are level up moves?

Most pokemon can learn moves by leveling up. For example, Bulbasaur learns Leech Seed at level 7.

How are they stored in the ROM?

Each pokemon has a table of moves they can learn. Each moves takes up 2 bytes. 7 bits are used for the level, and 9 bits are used for the move. This means that pokemon can only learn 512 unique moves via leveling up. After the last move, the table ends with FF FF. Finally, the game maintains a table of pointers, where each pointer leads to one of these level-up move tables.

How can I edit them with HexManiacAdvance?

HexManiacAdvance automatically finds the level-up moves. You can go to them by choosing Edit -> Goto and then typing data.pokemon.moves.levelup.

You can edit the move directly by just typing in the value that you want with a level-move pair selected. For example, you can select a pair and then type 15 PoisonPowder to make the pokemon learn PoisonPowder at level 15. Autocomplete can assist you when looking for moves.

You can also edit a pokemon's list of moves using the Text tool or Table tool. With either the pointer to the table selected or any entry in the table selected, open the Text tool or Table tool. Then you'll be able to freely edit and reorder the moves. This also lets you edit moves using copy paste. When using a tool, if you change the size of a table, HexManiacAdvance will automatically repoint the data for you to prevent collisions.

Note that when working with moves that have a space in the name, you'll have to put the move name in quotes.

Egg Moves

What are Egg Moves?

In the generation 3 pokemon games, it's possible to leave two pokemon in the daycare. If they're different genders and share an egg group, you'll eventually get an egg that's the same species as the mother. However, it might be able to take some moves from the father. These are called Egg Moves, and the game stores a list for each pokemon that could hatch from an egg to track what moves it can learn in this way.

How are they stored in the ROM?

The game stores a single massive list, where each 2-bytes represents either a pokemon or a move. If it's a move, it's just the 2-byte code for the move. If it's the pokemon, it's the 2-byte code for the pokemon plus 20000. I'm not sure why they picked 20000, but since there are less than 20000 moves, it makes it easy to do some simple math to determine whether those two bytes represent a pokemon or a move.

How can I edit them with HexManiacAdvance

HexManiacAdvance automatically finds the Egg Moves. You can go to them by choosing Edit -> Goto and then typing data.pokemon.moves.egg.

You can edit the move or pokemon directly by just typing in the value that you want with any entry selected. For example, you can select an entry and then type PoisonPowder to make the pokemon able to learn PoisonPowder via breeding. Or you can type '[Squirtle]' to change the current entry to Squirtle, meaning that future moves in the list are available for squirtle to learn via breeding. Autocomplete can assist you when looking for moves and pokemon.

You can also edit a the list of Egg Moves using the Text tool. With either the pointer to the table selected or any entry in the table selected, open the Text tool. Then you'll be able to freely edit and reorder the moves and pokemon. This also lets you edit list using copy / paste. When using a tool, if you change the size of a table, HexManiacAdvance will automatically repoint the data for you to prevent collisions.

Tutor Moves

What are Tutor Moves?

Through FireRed, LeafGreen, and Emerald, you can find characters willing to teach your pokemon special moves. Each of these moves can usually only be taught once, but there's no reason that needs to be true: it's just the limit put into the game scripts. Each of these moves is teachable to only some pokemon.

How are they stored in the ROM?

The moves are stored in a simple list, where each move takes up 2 bytes. There is no terminator.

The game also stores a compatibility table, which uses 1 bit per move to express what moves are learnable for each pokemon. For example, in FireRed, Bulbasaur can learn "Swords Dance", "Body Slam", Double-Edge, Mimic, and Substitute, but not the other available tutor moves. So the bits for those moves are set to one, while the bits for the other moves are set to zero. FireRed has a similar 2-byte segment for each pokemon. Note that in Emerald, each segment is 4-bytes long, because there are more tutor moves.

How can I edit Tutor Moves with HexManiacAdvance?

HexManiacAdvance automatically finds both the list of tutor moves and the list of pokemon compatibility. You can edit them individually, but naively adding more moves to the end of the tutor move list won't work: the game is hard-coded to think that each compatibility is only two bytes long. However, if you want, you can ask HexManiacAdvance to edit the code to make this more dynamic.

To do so, choose Utilities -> Make Tutors Expandable. Doing so will edit the game code to calculate the width of the bit-array based on the length of the tutor move list.

Note that using the Make Tutors Expandable utility will break the 3 "special" tutors in FireRed and LeafGreen: the tutors for the elemental hyper beam moves teachable to the three starters are special and handled by unique code. If you still want them, it's fairly easy to add these back in once the utility is run.

Basic Editing

The tutor move list can be found by choosing Edit -> Goto and typing "data.pokemon.moves.tutors". You can edit the moves inline by selecting the move you want to edit. As you type, an auto-complete list will appear to help you choose a move. You can also use the Table tool to select the move from a list of all moves.

The tutor compatibility list can be found by choosing -> Edit -> Goto and typing "data.pokemon.moves.tutorcompatibility". The easiest way to edit the table is using the table tool. For any pokemon you select, the table tool will show you a set of checkboxes, where each checkbox.

Advanced Editing

If you want to add a new move, select the last move in the list and choose "Add New" in the Table tool. However, note that this action is NOT SAFE unless you've used the Utilities -> Make Tutors Expandable tool. If you expanded tutors in this way without using the utility, it's not too late! You can run the utility at any time and it should work.

Expanding the tutor move table will require repointing that table, along with expanding and repointing the tutor compatibility table. HexManiacAdvance will do all of the needed repoints and expansions automatically.