summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSonikkuA-DatH <58025603+SonikkuA-DatH@users.noreply.github.com>2021-11-24 13:49:03 -0800
committerSonikkuA-DatH <58025603+SonikkuA-DatH@users.noreply.github.com>2021-11-24 13:49:03 -0800
commitf786a7174e046957eeb7a9a95b956ba412d6e5af (patch)
tree2e562f800ca41f068cab9c8d9c296fd19b102166
parent6b79c1947bca75f0a831624506736e09588177bf (diff)
Adding page for Spinda spots
-rw-r--r--Spinda-Second-Frame-Spot-Addition.md81
1 files changed, 81 insertions, 0 deletions
diff --git a/Spinda-Second-Frame-Spot-Addition.md b/Spinda-Second-Frame-Spot-Addition.md
new file mode 100644
index 0000000..efc058b
--- /dev/null
+++ b/Spinda-Second-Frame-Spot-Addition.md
@@ -0,0 +1,81 @@
+Note: requires one to remove Spinda from the "HasTwoFrameAnimation" exclusion list in [src/pokemon.c](https://github.com/pret/pokeemerald/blob/master/src/pokemon.c)
+
+For those that try to edit Spinda's graphics to use two frame anims like most other mons (or have a fakemon with it's own spot variances), you may have noticed that for the second frame, the spots disappear. This is because the spots are aligned to the first frame, so when the second frame is shown, the game shifts it up by 64 pixels, which has nothing since it's offscreen
+
+So how do we address this? Simple
+
+Head to [src/pokemon.c](https://github.com/pret/pokeemerald/blob/master/src/pokemon.c), and duplicate the DRAW_SPINDA_SPOTS define, making a new name for the define
+```diff
++#define DRAW_SPINDA_SPOTSB \
++{ \
++ int i; \
++ for (i = 0; i < 4; i++) \
++ { \
++ int j; \
++ u8 x = gSpindaSpotGraphics[i].x + ((personality & 0x0F) - "**A**"); \
++ u8 y = gSpindaSpotGraphics[i].y + (((personality & 0xF0) >> 4) - "**B**"); \
++ \
++ for (j = 0; j < 16; j++) \
++ { \
++ int k; \
++ s32 row = gSpindaSpotGraphics[i].image[j]; \
++ \
++ for (k = x; k < x + 16; k++) \
++ { \
++ u8 *val = dest + ((k / 8) * 32) + \
++ ((k % 8) / 2) + \
++ ((y >> 3) << 8) + \
++ ((y & 7) << 2); \
++ \
++ if (row & 1) \
++ { \
++ if (k & 1) \
++ { \
++ if ((u8)((*val & 0xF0) - 0x10) <= 0x20) \
++ *val += 0x40; \
++ } \
++ else \
++ { \
++ if ((u8)((*val & 0xF) - 0x01) <= 0x02) \
++ *val += 0x04; \
++ } \
++ } \
++ \
++ row >>= 1; \
++ } \
++ \
++ y++; \
++ } \
++ \
++ personality >>= 8; \
++ } \
++}
+```
+
+Now **A** and **B** in the original function were 8 and 8 respectively. They represent the spot position based on the main sprite position
+Since the sceond frame is 64 pixels raised, the y value (B) should reflect that. However this also depends on what the second frame looks like
+Personally for me I did this
+
+![](https://i.imgur.com/G516X64.png)
+
+Where Spinda's head is the same vertical position for a 64 sprite boundary, but is 4 pixels more to the left. So my code looks like this for that snippet
+```diff
++ u8 x = gSpindaSpotGraphics[i].x + ((personality & 0x0F) - 12); \
++ u8 y = gSpindaSpotGraphics[i].y + (((personality & 0xF0) >> 4) + 56); \
+```
+
+When you're satisfied, scroll down to `void DrawSpindaSpots` and add your newly made define
+```diff
+void DrawSpindaSpots(u16 species, u32 personality, u8 *dest, bool8 isFrontPic)
+{
+ if (species == SPECIES_SPINDA && isFrontPic)
+ DRAW_SPINDA_SPOTS;
++ DRAW_SPINDA_SPOTSB;
+}
+```
+
+And that's it. Here's how mine looks for spot placement
+
+![](https://i.imgur.com/NOXnYK2.gif)
+
+Remember to edit your anim tables! \ No newline at end of file