diff options
author | RetroKoH <cmgaudet2010@gmail.com> | 2021-02-11 17:19:11 +0700 |
---|---|---|
committer | RetroKoH <cmgaudet2010@gmail.com> | 2021-02-11 17:19:11 +0700 |
commit | 2f8ef1c3c9669dcb3d08efdc15730708ee0939ee (patch) | |
tree | 339ba76a4646faaa678a011b421d06ac367e9caf | |
parent | 61fd0b3c764ed8a8c9fee7b3350aeacb600eb6bf (diff) |
Created Add a new move (markdown)
-rw-r--r-- | Add-a-new-move.md | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/Add-a-new-move.md b/Add-a-new-move.md new file mode 100644 index 0000000..4b66303 --- /dev/null +++ b/Add-a-new-move.md @@ -0,0 +1,110 @@ +This tutorial is for how to add new moves to the game. This is a relatively simple copy/paste job that should give you a basic idea of how move data is used in the game, and as such, we won't be making any new animations here. Also, if you want to have more than 255 moves in your hack, you will need to extend the move index to 2 bytes, which will also not be covered here. For this example, we'll be adding Heart Stamp, a move introduced in Generation V, as it is, more or less, a clone of Bite. + +**DISCLAIMER:** Always backup your disassembly before editing anything. Neither I (RetroKoH), or anyone in the community, are responsible for anything going awry. Always take care and be sure to report any issues or ask any questions if you are unsure. +**ALSO:** This guide assumes you are using the latest build of pokered. Older versions may have Labels and/or data in other files or folders. When in doubt, search through your disassembly or ask for help. + +## Contents +- [Define a move constant](#1-define-a-move-constant) +- [Give the move a name](#2-give-the-move-a-name) +- [Add move data](#3-add-move-data) +- [Add to movesets](#4-add-to-movesets) + +## 1. Define a move constant + +The first thing we will do is establish a constant value for our new move. Before doing that, we need to understand something: **MOVES use the same series of constants as their ANIMATIONS.** This is important to know for a couple of reasons. Now, before we do anything, let's make an adjustment to our constants. + +Go to [constants/move_constants.asm](../blob/master/constants/move_constants.asm) and change this: + +```diff + const SLASH ; a3 + const SUBSTITUTE ; a4 + +NUM_ATTACKS EQU const_value + -1 + + const STRUGGLE + + ; Moves do double duty as animation identifiers. + + const SHOWPIC_ANIM +``` +to this: + +```diff + const SLASH ; a3 + const SUBSTITUTE ; a4 + const STRUGGLE ; a5 ; < Move this here + +NUM_ATTACKS EQU const_value ; Now implement this here +const_value = STRUGGLE + 1 ; remaining animations constants start after STRUGGLE, like before + + ; Moves do double duty as animation identifiers. + + const SHOWPIC_ANIM +``` + +This allows all following constants such as SHOWPIC_ANIM to retain their value, while allowing us to add more moves. Bear in mind that STRUGGLE needs to remain at its current index, so all new moves **SHOULD** follow STRUGGLE. You CAN put new moves before STRUGGLE, providing you remove an existing move to offset what you add. With that out of the way, add this: + +```diff + const SLASH ; a3 + const SUBSTITUTE ; a4 + const STRUGGLE ; a5 + const HEART_STAMP ; a6 ; New move +``` + +## 2. Give the move a name + +Next, we will put the text name that will be displayed. Go to [data/moves/names.asm](../blob/master/data/moves/names.asm), which should have the **MoveNames::** label, and add this: + +```diff + db "SLASH@" + db "SUBSTITUTE@" + db "STRUGGLE@" + db "HEART STAMP@" ; Add this +``` + +"HEART STAMP" is 11 characters long. As a rule of thumb, try not to exceed 12 characters (e.g. "SELFDESTRUCT"). I may be wrong but I believe 12 is the limit that will fit on screen w/o causing glitches. + +## 3. Add move data + +Now for the easy part. Go to [data/moves/moves.asm](../blob/master/data/moves/moves.asm), which should have the **Moves:** label. You will see a set of data dedicated to moves and their attributes. Now, as Heart Stamp is effectively a variation of Bite, let's find BITE's data and copy that. Search for BITE, or just copy this: + +``` + move BITE, FLINCH_SIDE_EFFECT1, 60, NORMAL, 100, 25 +``` +And paste it at the end of the move data, but change the NORMAL to PSYCHIC, like so: +``` + move BITE, FLINCH_SIDE_EFFECT1, 60, PSYCHIC, 100, 25 ; Heart Stamp (Uses BITE animation) +``` + +Don't worry about "move BITE". All this means is that it uses BITE's animation. As I said, moves and animations use the same constants. If you don't like this animation, replace BITE with another move constant that is more suitable. With that, our move is officially in the game. Now we just need to add it to a moveset and put it in action. + +## 4. Add to movesets + +There are multiple ways we can implement the move into the game. For now, I'm going to show you the most simple and easy methods, so that you can see your move in action right away. First, let's set our new move as a starter's first move so we can test it immediately. I am a sucker for Water-type starters, so I'll be using Squirtle. Go to [data/pokemon/base_stats/squirtle.asm](../blob/master/data/pokemon/base_stats/squirtle.asm) and add the move like so: + +```diff +db TACKLE, TAIL_WHIP, HEART_STAMP, NO_MOVE ; level 1 learnset +``` + +When you start a new game, your Squirtle (or whichever inferior starter you chose) will have the new move right away, and it should work sufficiently. With that, let's go ahead and add it to Jynx, since it is actually Jynx's move. Go to [data/pokemon/evos_moves.asm](../blob/master/data/pokemon/evos_moves.asm), search for **JynxEvosMoves:**, and add the move like so: + +```diff +JynxEvosMoves: +; Evolutions + db 0 +; Learnset + db 18, LICK + db 23, DOUBLESLAP + db 31, ICE_PUNCH + db 35, HEART_STAMP ; Why not? You can place it wherever you want + db 39, BODY_SLAM + db 47, THRASH + db 58, BLIZZARD + db 0 +``` + +This allows Jynx to learn the move at Level 35. You can modify this as you see fit, but follow two rules: +1. Keep the levels in order. Meaning that if you change HEART_STAMP to be learnt at Level 9, place it at the top of the list, as 9 comes before the others. +2. Don't put two moves at the same level. It is possible to manipulate your engine to be able to allow for multiple moves at the same level. If you have implemented such a change, disregard this rule. Otherwise, adhere to it. + +There you have it! That's the simplest method for adding new moves to your ROM hack. Find me on the pret Discord server if you have any issues or if I've made any mistakes. Everything should be good to go though, and you're free to now add more moves as you see fit.
\ No newline at end of file |