summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Attack-animation-tiles.md16
1 files changed, 8 insertions, 8 deletions
diff --git a/Attack-animation-tiles.md b/Attack-animation-tiles.md
index 2173225..6a838f7 100644
--- a/Attack-animation-tiles.md
+++ b/Attack-animation-tiles.md
@@ -9,12 +9,12 @@ Before starting the tutorial, I strongly recommend to know how animations work i
* ### **A/ Method 1: Moving black tiles and replacing them**
This is the best way if you only need few tiles.
-1. Move your tiles
+**1. Move your tiles**
First you need to know that the font tileset (in gfx/font/font.png) is used in battle just like the 2 attack animation tilesets. If you look at this font tileset, you will notice a white empty space (enough for 32 tiles) right after the 64 characters, BUT this space can't be used for the tiles that use 4 colors. The font tileset is coded in 1 bit per pixel (1bpp), which means that it only uses black (and white for the transparency of course). No gray.
Now the interesting thing is that many tiles in the attack tilesets (22 in total) only use black. So, as you probably want to add 4-color tiles, you can just move the black tiles from the attack tilesets to the unused space in the font tileset, and then replace these black tiles by your custom tiles.
-2. Change the tile IDs in frameblocks
+**2. Change the tile IDs in frameblocks**
From this point, it's a bit complicated to explain but I will do my best and show an example.
So, after moving your tiles, change the tile IDs in the frameblocks so that the animations find the new location of the moved tiles. Otherwise, the attacks using these tiles will not find them (they would use the new replaced tiles and that's not what we want). Just change data/battle_anims/frame_blocks.asm.
@@ -22,7 +22,7 @@ You need to do a little bit of investigation for that, I mean you need to find w
Important to know: the font tileset can be used along with attack_anim_1 or attack_anim_2 (and even attack_anim_3 if you add a 3rd tileset).
The tile IDs in the free slots of the font tileset go from 0x90 to 0xAF.
-3. An example with the question mark tiles**
+**3. An example with the question mark tiles**
Let's make all this clear with an example. The question mark tiles in attack_anim_1 are fully black, then you can move them to the font tileset. Now, put your new custom tiles where the question mark is in attack_anim_1.
Now you need to change the ID of the question mark tiles in the frameblocks. Start with the first tile.
@@ -43,7 +43,7 @@ If you manage to keep a bank with few data in it, you can think of adding more t
This method can be improved, you are welcome to share anything useful.
-1. Adding the gfx pointer to the engine routine
+**1. Adding the gfx pointer to the engine routine**
In engine/battle/animations.asm, add these lines under the AnimationTileset2 pointer:
`AnimationTileset3:`
@@ -51,7 +51,7 @@ In engine/battle/animations.asm, add these lines under the AnimationTileset2 poi
Then add this under the 3 anim_tileset lines: anim_tileset x, AnimationTileset3
Replace the "x" by the number of tiles you have in your tileset (32 if you stick to this number).
-2. Restructure the banks
+**2. Restructure the banks**
Adding a tileset will probably make the bank space overflow. This bank should be bank1E normally. You need to move some data in this bank to another bank. For this, create a new bank and a new section for it in layout.link (the file name may change depending on the updates of the pokered repository). Type in something like:
`ROMX d`
@@ -60,12 +60,12 @@ Adding a tileset will probably make the bank space overflow. This bank should be
Then you can move the data from bank1E in main.asm to your new bank, but make sure to keep these includes in the same bank: engine/battle/animations.asm, data/moves/animations.asm, data/battle_anims/subanimations.asm, data/battle_anims/frame_blocks.asm, engine/overworld/cut2.asm and engine/overworld/dust_smoke.asm.
These files need each other in some way, don't put them in separate banks.
-3. Affect the tileset to an animation
+**3. Affect the tileset to an animation**
In data/moves/animations.asm, set the 3rd parameter of the animation you want to 3. This tells the compiler that the animation uses the tileset 3. We do count tilesets from 0 but 0, 1 and 2 are for tilesets 1 and 2, and 3 is for tileset 3.
-4. Change the FIRST_SE_ID constant
+**4. Change the FIRST_SE_ID constant**
In constants/move_animation_constants.asm, set this constant to 0xC5 (replace $C0 by $C5).
Then remove 5 constants among the special effect animations (the ones beginning by "SE").
@@ -79,7 +79,7 @@ Same thing in data/battle_anims/special_effect_pointers.asm, you have to remove
Now you can use your new tileset.
-5. Why setting FIRST_SE_ID to 0xC5?
+**5. Why setting FIRST_SE_ID to 0xC5?**
This part is not necessary for the tutorial but it's meant to explain what happens in the code.
When you set the tileset ID of an animation to 3, this causes a bug as soon as you use your new tileset (if FIRST_SE_ID is left to 0xC0). The bug comes from the PlayAnimation routine in engine/battle/animations.asm.