- 1,315
- Posts
- 17
- Years
- Seen Jun 11, 2024
So I've managed to figure out enough to make decent custom battle animations. So far, I've managed to splice multiple animations together, and to add backgrounds to an animation action.
From what I've figured out so far, there are at least two types of actions:
1) a background
2) a movement of a graphic (requires loading correct graphics)
Note: Everything in this document/tutorial is designed with FireRed in mind. There are pointers within the animation scripts, meaning that unfortunately, these have to be ROM-specific. These will work with FireRed, and only FireRed.
Here's what I've got of the scripting language so far: (credits at bottom of post for people who found these)
------------------------------------------------------------------
00 XX 27 = loads image data, XX is an argument
00 XX 28 = same thing as above, but loads from a different bank of graphics
02 = executes current animation segment
05 = waits for current animation segment to finish
06 = does absolutely nothing
07 = does absolutely nothing
08 = ends the animation script (DO NOT CONFUSE WITH POINTER!!!)
0E XX XX XX 08 = jumps to another animation, continues execution of original script when finished (can be used to combine multiple animations to play right after another)
11 XX XX XX 08 = same as above, haven't figured out the difference yet
19 XX XX = plays a sound
Display a non-scrolling, static background: (note: if you change 17 to 16, then transparency effects will be deactivated)
Display a scrolling background: (note: if you change 17 to 16, then transparency effects will be deactivated)
-WW = selects which background graphics to display
Choose one of these for the WW byte:
-XX = how fast background scrolls horizontally
-YY = how fast background scrolls vertically
-ZZ = not sure but its either 00 or 01
Here is what each background looks like:
Judging by unLZ, these backgrounds are simply tilesets+tilemaps. If we could find the table(s), we could theoretically expand them and have custom backgrounds.
To display the Psychic-background correctly, do not use the scrolling background command, instead use the 0E command, using it like this:
This will display the Psychic-type BG, while also animating it correctly.
To end any scrolling background (also works with the Psychic-BG animation):
Usually this is placed at the end of the script. If you're going to place it at the end of the script, make sure you add an extra 08 byte to the end of it, otherwise the game will freeze.
The table for the battle backgrounds starts at 0x3ADE18, and ends at 0x3ADF5B. The format goes like:
[XX XX XX 08] [YY YY YY 08] [ZZ ZZ ZZ 08] XX = pointer to graphics, YY = pointer to palette, ZZ = pointer to tilemap
Repoint and extend it, and you can create custom backgrounds:
Some other info (remember, these are FireRed offsets):
0x247094 = Attack names
0x250C04 = Attack data
0x4886E8 = Attack description pointers
0x1D65A8 = Battle script pointers
0x1C68F4 = Attack Animation pointers
To find the offset of an animation, follow these instructions:
Eventually I will post a list of all the animation offsets, I haven't finished typing them all out yet.
Step-by-step example at creating a custom animation:
Example 1: Adding a background to an existing animation
So let's say we wanted to create a 4th Gen move. How about... Night Slash. We'll use Slash with the Dark-type background.
1. Using the steps I showed earlier in this thread, find the offset of whatever animation you want to base it by. The Slash animation is at 0x1caf7b. Insert the Slash animation data into free space, and then go to Night Slash's (or whatever your move is called) slot in the animation table and point to the animation data you just inserted.
2. For anyone else using it off of Slash's animation, this is the hex data for the Slash animation:
Right now, our animation looks exactly like Slash:
3. Now earlier in this thread, I mentioned the scrolling background animation command. Use it, and set WW as the Dark-BG. Place it at the beginning of the animation, and the Slash animation right afterwords. Our animation data should now look like this:
Now we got the Dark-background! ...except that it doesn't disappear after the attack is done. That's because we need to add the BG-clear command.
4. As I mentioned earlier, the BG clear command is: 0E C7 59 1D 08. Remove the 08 byte from our current animation (NOT THE BG COMMAND!!!), then add the BG clear command at the end, and add an extra 08 byte to end the animation, otherwise the game will crash. Our script should now look like this:
Now we have a flawless Night Slash animation! And yes, the background will return to normal after execution of the attack.
Just for giggles, you can alter the second byte of the BG command (which also happens to be the second byte of our entire Night Slash animation) to change the background (I referred to it as the WW byte):
(lol Aurora Slash)
(lol Twinkle Slash)
And that, is essentially how you take a non-BG animation and add a BG to it.
Example 2: Merging two animations to play right after another
Some info on the 02 command (thanks to DoesntKnowHowToPlay):
Doing colored backgrounds:
Getting the background to change depending on what side you're on:
Credits:
-Jambo51 for explaining how to add new attacks, and the offset of several tables, which helped me test animations
-DoestKnowHowToPlay for already documenting some of the commands
-Darthatron for finding the table containing all the animation command routines, hopefully these can be used to find out what each command does
EDIT: Some useful information found by Doesn'tKnowHowToPlay and dreamengine:
https://www.pokecommunity.com/posts/7481054/
https://www.pokecommunity.com/posts/7485231/
https://www.pokecommunity.com/posts/7485560/
From what I've figured out so far, there are at least two types of actions:
1) a background
2) a movement of a graphic (requires loading correct graphics)
Note: Everything in this document/tutorial is designed with FireRed in mind. There are pointers within the animation scripts, meaning that unfortunately, these have to be ROM-specific. These will work with FireRed, and only FireRed.
Here's what I've got of the scripting language so far: (credits at bottom of post for people who found these)
------------------------------------------------------------------
00 XX 27 = loads image data, XX is an argument
00 XX 28 = same thing as above, but loads from a different bank of graphics
02 = executes current animation segment
05 = waits for current animation segment to finish
06 = does absolutely nothing
07 = does absolutely nothing
08 = ends the animation script (DO NOT CONFUSE WITH POINTER!!!)
0E XX XX XX 08 = jumps to another animation, continues execution of original script when finished (can be used to combine multiple animations to play right after another)
11 XX XX XX 08 = same as above, haven't figured out the difference yet
19 XX XX = plays a sound
Display a non-scrolling, static background: (note: if you change 17 to 16, then transparency effects will be deactivated)
Code:
14 [B]WW[/B] 17
Display a scrolling background: (note: if you change 17 to 16, then transparency effects will be deactivated)
Code:
14 [B]WW[/B] 17 03 2D B8 0B 08 05 04 00 [B]XX[/B] 00 [B]YY ZZ[/B] 00 FF FF
Choose one of these for the WW byte:
Spoiler:
00 = Dark-type BG, example: Faint Attack
01 = same as 00
02 = Ghost-type BG, can scroll horizontally, example: Shadow Punch
03 = Psychic-type BG, example: Psychic (EXCEPT IT DOESN'T ANIMATE)
04 = high-impact BG, light coming from top right, example: Focus Punch
05 = high-impact BG, light coming from bottom left
06 = high-impact BG, light coming from top left
07 = Horn Drill BG, can scroll horizontally and vertically, example: Horn Drill
08 = same as 07, but image is mirrored horizontally
09 = high-speed BG, can scroll horizontally, example: Mach Punch
0A = same as 09, but image is mirrored horizontally
0B = Thunder BG, can scroll horizontally, example: Thunder
0C = Guillotine BG, light coming from top right, example: Guillotine
0D = Guillotine BG, light coming from bottom left
0E = Guillotine BG, light coming from top left
0F = Ice-type BG, can scroll horizontally, example: Sheer Cold
10 = Space-oriented BG, can scroll horizontally and vertically, example: Cosmic Power
11 = Seismic Toss/Sky Uppercut BG, can scroll horizontally and vertically, example: Sky Uppercut
12 = Flying-type BG, can scroll horizontally and vertically, example: Sky Attack
13 = same as 12, but image is mirrored horizontally
14 = Aurora Beam BG, can scroll horizontally, example: Aurora Beam
15 = Fissure BG, can scroll horizontally (but it artistically makes no sense to do so), example: Fissure
16 = Silver Wind BG, can scroll horizontally, example: Silver Wind
17 = same as 16, but image is mirrored horizontally
18 = SolarBeam BG, light coming from top right, example: SolarBeam
19 = SolarBeam BG, light coming from bottom left
1A = SolarBeam BG, light coming from top left
01 = same as 00
02 = Ghost-type BG, can scroll horizontally, example: Shadow Punch
03 = Psychic-type BG, example: Psychic (EXCEPT IT DOESN'T ANIMATE)
04 = high-impact BG, light coming from top right, example: Focus Punch
05 = high-impact BG, light coming from bottom left
06 = high-impact BG, light coming from top left
07 = Horn Drill BG, can scroll horizontally and vertically, example: Horn Drill
08 = same as 07, but image is mirrored horizontally
09 = high-speed BG, can scroll horizontally, example: Mach Punch
0A = same as 09, but image is mirrored horizontally
0B = Thunder BG, can scroll horizontally, example: Thunder
0C = Guillotine BG, light coming from top right, example: Guillotine
0D = Guillotine BG, light coming from bottom left
0E = Guillotine BG, light coming from top left
0F = Ice-type BG, can scroll horizontally, example: Sheer Cold
10 = Space-oriented BG, can scroll horizontally and vertically, example: Cosmic Power
11 = Seismic Toss/Sky Uppercut BG, can scroll horizontally and vertically, example: Sky Uppercut
12 = Flying-type BG, can scroll horizontally and vertically, example: Sky Attack
13 = same as 12, but image is mirrored horizontally
14 = Aurora Beam BG, can scroll horizontally, example: Aurora Beam
15 = Fissure BG, can scroll horizontally (but it artistically makes no sense to do so), example: Fissure
16 = Silver Wind BG, can scroll horizontally, example: Silver Wind
17 = same as 16, but image is mirrored horizontally
18 = SolarBeam BG, light coming from top right, example: SolarBeam
19 = SolarBeam BG, light coming from bottom left
1A = SolarBeam BG, light coming from top left
-XX = how fast background scrolls horizontally
-YY = how fast background scrolls vertically
-ZZ = not sure but its either 00 or 01
Here is what each background looks like:
Spoiler:
00:
01:
02:
03:
04:
05:
06:
07:
08:
09:
0A:
0B:
0C:
0D:
0E:
0F:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
1A:
![[PokeCommunity.com] Creating New Battle Animations [PokeCommunity.com] Creating New Battle Animations](https://i1151.photobucket.com/albums/o625/ChaosRush/New%20Attacks/83736fc5.png)
01:
![[PokeCommunity.com] Creating New Battle Animations [PokeCommunity.com] Creating New Battle Animations](https://i1151.photobucket.com/albums/o625/ChaosRush/New%20Attacks/1-1.png)
02:
![[PokeCommunity.com] Creating New Battle Animations [PokeCommunity.com] Creating New Battle Animations](https://i1151.photobucket.com/albums/o625/ChaosRush/New%20Attacks/2-1.png)
03:
![[PokeCommunity.com] Creating New Battle Animations [PokeCommunity.com] Creating New Battle Animations](https://i1151.photobucket.com/albums/o625/ChaosRush/New%20Attacks/3-1.png)
04:
![[PokeCommunity.com] Creating New Battle Animations [PokeCommunity.com] Creating New Battle Animations](https://i1151.photobucket.com/albums/o625/ChaosRush/New%20Attacks/4.png)
05:
![[PokeCommunity.com] Creating New Battle Animations [PokeCommunity.com] Creating New Battle Animations](https://i1151.photobucket.com/albums/o625/ChaosRush/New%20Attacks/5.png)
06:
![[PokeCommunity.com] Creating New Battle Animations [PokeCommunity.com] Creating New Battle Animations](https://i1151.photobucket.com/albums/o625/ChaosRush/New%20Attacks/6.png)
07:
![[PokeCommunity.com] Creating New Battle Animations [PokeCommunity.com] Creating New Battle Animations](https://i1151.photobucket.com/albums/o625/ChaosRush/New%20Attacks/7.png)
08:
![[PokeCommunity.com] Creating New Battle Animations [PokeCommunity.com] Creating New Battle Animations](https://i1151.photobucket.com/albums/o625/ChaosRush/New%20Attacks/8.png)
09:
![[PokeCommunity.com] Creating New Battle Animations [PokeCommunity.com] Creating New Battle Animations](https://i1151.photobucket.com/albums/o625/ChaosRush/New%20Attacks/9.png)
0A:
![[PokeCommunity.com] Creating New Battle Animations [PokeCommunity.com] Creating New Battle Animations](https://i1151.photobucket.com/albums/o625/ChaosRush/New%20Attacks/10.png)
0B:
![[PokeCommunity.com] Creating New Battle Animations [PokeCommunity.com] Creating New Battle Animations](https://i1151.photobucket.com/albums/o625/ChaosRush/New%20Attacks/11.png)
0C:
![[PokeCommunity.com] Creating New Battle Animations [PokeCommunity.com] Creating New Battle Animations](https://i1151.photobucket.com/albums/o625/ChaosRush/New%20Attacks/12.png)
0D:
![[PokeCommunity.com] Creating New Battle Animations [PokeCommunity.com] Creating New Battle Animations](https://i1151.photobucket.com/albums/o625/ChaosRush/New%20Attacks/13.png)
0E:
![[PokeCommunity.com] Creating New Battle Animations [PokeCommunity.com] Creating New Battle Animations](https://i1151.photobucket.com/albums/o625/ChaosRush/New%20Attacks/14.png)
0F:
![[PokeCommunity.com] Creating New Battle Animations [PokeCommunity.com] Creating New Battle Animations](https://i1151.photobucket.com/albums/o625/ChaosRush/New%20Attacks/15.png)
10:
![[PokeCommunity.com] Creating New Battle Animations [PokeCommunity.com] Creating New Battle Animations](https://i1151.photobucket.com/albums/o625/ChaosRush/New%20Attacks/16.png)
11:
![[PokeCommunity.com] Creating New Battle Animations [PokeCommunity.com] Creating New Battle Animations](https://i1151.photobucket.com/albums/o625/ChaosRush/New%20Attacks/17.png)
12:
![[PokeCommunity.com] Creating New Battle Animations [PokeCommunity.com] Creating New Battle Animations](https://i1151.photobucket.com/albums/o625/ChaosRush/New%20Attacks/18.png)
13:
![[PokeCommunity.com] Creating New Battle Animations [PokeCommunity.com] Creating New Battle Animations](https://i1151.photobucket.com/albums/o625/ChaosRush/New%20Attacks/19.png)
14:
![[PokeCommunity.com] Creating New Battle Animations [PokeCommunity.com] Creating New Battle Animations](https://i1151.photobucket.com/albums/o625/ChaosRush/New%20Attacks/20.png)
15:
![[PokeCommunity.com] Creating New Battle Animations [PokeCommunity.com] Creating New Battle Animations](https://i1151.photobucket.com/albums/o625/ChaosRush/New%20Attacks/21.png)
16:
![[PokeCommunity.com] Creating New Battle Animations [PokeCommunity.com] Creating New Battle Animations](https://i1151.photobucket.com/albums/o625/ChaosRush/New%20Attacks/22.png)
17:
![[PokeCommunity.com] Creating New Battle Animations [PokeCommunity.com] Creating New Battle Animations](https://i1151.photobucket.com/albums/o625/ChaosRush/New%20Attacks/23.png)
18:
![[PokeCommunity.com] Creating New Battle Animations [PokeCommunity.com] Creating New Battle Animations](https://i1151.photobucket.com/albums/o625/ChaosRush/New%20Attacks/24.png)
19:
![[PokeCommunity.com] Creating New Battle Animations [PokeCommunity.com] Creating New Battle Animations](https://i1151.photobucket.com/albums/o625/ChaosRush/New%20Attacks/25.png)
1A:
![[PokeCommunity.com] Creating New Battle Animations [PokeCommunity.com] Creating New Battle Animations](https://i1151.photobucket.com/albums/o625/ChaosRush/New%20Attacks/26.png)
Judging by unLZ, these backgrounds are simply tilesets+tilemaps. If we could find the table(s), we could theoretically expand them and have custom backgrounds.
To display the Psychic-background correctly, do not use the scrolling background command, instead use the 0E command, using it like this:
Code:
0E BB 59 1D 08
To end any scrolling background (also works with the Psychic-BG animation):
Code:
0E C7 59 1D 08
The table for the battle backgrounds starts at 0x3ADE18, and ends at 0x3ADF5B. The format goes like:
[XX XX XX 08] [YY YY YY 08] [ZZ ZZ ZZ 08] XX = pointer to graphics, YY = pointer to palette, ZZ = pointer to tilemap
Repoint and extend it, and you can create custom backgrounds:
![[PokeCommunity.com] Creating New Battle Animations [PokeCommunity.com] Creating New Battle Animations](https://i47.tinypic.com/2zy8qwi.png)
Some other info (remember, these are FireRed offsets):
0x247094 = Attack names
0x250C04 = Attack data
0x4886E8 = Attack description pointers
0x1D65A8 = Battle script pointers
0x1C68F4 = Attack Animation pointers
To find the offset of an animation, follow these instructions:
Spoiler:
1. Open up this link: https://bulbapedia.bulbagarden.net/wiki/List_of_moves
2. Find the move you want (for the sake of this example, we'll be using Surf)
3. According to the list, Surf is #57 in the game index
4. Open up Windows Calculator, switch to Programmer mode
5. (make sure the option on the left tab is set to, "Dec") type in 57 (or whatever number your attack is)
6. Click on "Hex"
7. Multiply it by 4
8. Add it by 1C68F4
9. Whatever the sum is, that offset contains the pointer to your animation. Open up a Hex editor, and go to that offset
10. The sum I got was 1C69D8. The bytes there are 01 FA 1C 08. The 08 indicates its a pointer.
11. If you know how to calculate pointers manually, good for you. If you don't, go find a Pointer Calculator on Google or something, or figure out how. With that said, the bytes 01 FA 1C 08 means its pointing to offset 0x1CFA01.
12. 0x1CFA01 is the Surf animation. Congratulations, you found the offset of your animation!
(To figure out when the animation starts and ends, simply make a new attack (assuming you've already looked at Jambo51's thread on adding new moves), and expand the attack animation table, and then paste the data of the Surf animation (or whatever attack) into free space and point one of the new attacks to that data. Then open up VBA, open up its Memory Viewer, and go to that data. Then replace the bytes and the end with FF, and keep testing it until the animation crashes (it should only crash when you change an 08 byte) Once it crashes, open up your hex editor, and go to the offset of the data, then make it look like how it does in VBA's memory viewer, then add an 08 at the end with the hex editor.
2. Find the move you want (for the sake of this example, we'll be using Surf)
3. According to the list, Surf is #57 in the game index
4. Open up Windows Calculator, switch to Programmer mode
5. (make sure the option on the left tab is set to, "Dec") type in 57 (or whatever number your attack is)
6. Click on "Hex"
7. Multiply it by 4
8. Add it by 1C68F4
9. Whatever the sum is, that offset contains the pointer to your animation. Open up a Hex editor, and go to that offset
10. The sum I got was 1C69D8. The bytes there are 01 FA 1C 08. The 08 indicates its a pointer.
11. If you know how to calculate pointers manually, good for you. If you don't, go find a Pointer Calculator on Google or something, or figure out how. With that said, the bytes 01 FA 1C 08 means its pointing to offset 0x1CFA01.
12. 0x1CFA01 is the Surf animation. Congratulations, you found the offset of your animation!
(To figure out when the animation starts and ends, simply make a new attack (assuming you've already looked at Jambo51's thread on adding new moves), and expand the attack animation table, and then paste the data of the Surf animation (or whatever attack) into free space and point one of the new attacks to that data. Then open up VBA, open up its Memory Viewer, and go to that data. Then replace the bytes and the end with FF, and keep testing it until the animation crashes (it should only crash when you change an 08 byte) Once it crashes, open up your hex editor, and go to the offset of the data, then make it look like how it does in VBA's memory viewer, then add an 08 at the end with the hex editor.
Eventually I will post a list of all the animation offsets, I haven't finished typing them all out yet.
Step-by-step example at creating a custom animation:
Example 1: Adding a background to an existing animation
Spoiler:
So let's say we wanted to create a 4th Gen move. How about... Night Slash. We'll use Slash with the Dark-type background.
1. Using the steps I showed earlier in this thread, find the offset of whatever animation you want to base it by. The Slash animation is at 0x1caf7b. Insert the Slash animation data into free space, and then go to Night Slash's (or whatever your move is called) slot in the animation table and point to the animation data you just inserted.
2. For anyone else using it off of Slash's animation, this is the hex data for the Slash animation:
Code:
00 C7 27 02 A4 35 3E 08 82 03 01 00 F8 FF 00 00 19 81 00 3F 04 04 02 A4 35 3E 08 82 03 01 00 08 00 00 00 03 1D 8B 09 08 02 05 01 00 04 00 00 00 12 00 01 00 19 81 00 3F 05 08
![[PokeCommunity.com] Creating New Battle Animations [PokeCommunity.com] Creating New Battle Animations](https://i46.tinypic.com/2s6o5mc.png)
3. Now earlier in this thread, I mentioned the scrolling background animation command. Use it, and set WW as the Dark-BG. Place it at the beginning of the animation, and the Slash animation right afterwords. Our animation data should now look like this:
Code:
14 00 16 03 2D B8 0B 08 05 04 00 00 00 00 00 00 FF FF 00 C7 27 02 A4 35 3E 08 82 03 01 00 F8 FF 00 00 19 81 00 3F 04 04 02 A4 35 3E 08 82 03 01 00 08 00 00 00 03 1D 8B 09 08 02 05 01 00 04 00 00 00 12 00 01 00 19 81 00 3F 05 08
![[PokeCommunity.com] Creating New Battle Animations [PokeCommunity.com] Creating New Battle Animations](https://i45.tinypic.com/ixqqmw.png)
Now we got the Dark-background! ...except that it doesn't disappear after the attack is done. That's because we need to add the BG-clear command.
4. As I mentioned earlier, the BG clear command is: 0E C7 59 1D 08. Remove the 08 byte from our current animation (NOT THE BG COMMAND!!!), then add the BG clear command at the end, and add an extra 08 byte to end the animation, otherwise the game will crash. Our script should now look like this:
Code:
14 00 16 03 2D B8 0B 08 05 04 00 00 00 00 00 00 FF FF 00 C7 27 02 A4 35 3E 08 82 03 01 00 F8 FF 00 00 19 81 00 3F 04 04 02 A4 35 3E 08 82 03 01 00 08 00 00 00 03 1D 8B 09 08 02 05 01 00 04 00 00 00 12 00 01 00 19 81 00 3F 05 0E C7 59 1D 08 08
![[PokeCommunity.com] Creating New Battle Animations [PokeCommunity.com] Creating New Battle Animations](https://i50.tinypic.com/33e6h79.png)
Now we have a flawless Night Slash animation! And yes, the background will return to normal after execution of the attack.
Just for giggles, you can alter the second byte of the BG command (which also happens to be the second byte of our entire Night Slash animation) to change the background (I referred to it as the WW byte):
![[PokeCommunity.com] Creating New Battle Animations [PokeCommunity.com] Creating New Battle Animations](https://i50.tinypic.com/2rlycjq.png)
(lol Aurora Slash)
![[PokeCommunity.com] Creating New Battle Animations [PokeCommunity.com] Creating New Battle Animations](https://i48.tinypic.com/1j7ply.png)
(lol Twinkle Slash)
And that, is essentially how you take a non-BG animation and add a BG to it.
Example 2: Merging two animations to play right after another
Spoiler:
Just find two separate animation hex data, and then remove the 08 byte from the end of one of them (except if its a pointer), then place the data of the second animation right after it. Alternatively, you can use the 0E or 11 command and point directly to it, but this will limit you to merging only 2 animations. By manually placing the data, you can have as many as you want, meaning you can create a move like, "Ridiculous Tackle", and have an animation that has the player Tackling the opponent 6 times.
If there's an 05 byte before the 08 byte, remove it, and then they'll play at the same time (perhaps with a slight delay)
If there's an 05 byte before the 08 byte, remove it, and then they'll play at the same time (perhaps with a slight delay)
Some info on the 02 command (thanks to DoesntKnowHowToPlay):
The first two bytes indicate what image data to use, while the next two bytes indicate the palette. The enumeration for this is the same as that of the 00 command- in order for an effect to work properly, the 00 command must have been called for both of these- otherwise the palette and/or image will not be loaded. While the existing animations appear to always have these be the same, they don't have to be- you can for instance give the Stun Spore seeds Fire Blast's palette this way. For some animations both of these are 00- I believe these are effects that don't use images, such as Earthquake's screen-shaking.
Doing colored backgrounds:
02 24 7B 3E 08 02 05 01 00 SS 00 00 00 YY 00 XX XX 05
Where XX XX is the color you want, YY is the intensity (0C for Giga Drain- 10 replaces the background entirely with the given color), and SS is the speed of the transition (01 for Giga Drain, but I imagine Hyper Beam and other attacks use the same logic with a higher value). To revert the background to normal, place the following:
02 24 7B 3E 08 02 05 01 00 SS 00 YY 00 00 00 XX XX 05 0B 03 0D
The values here do not have to be the same, but I'd advise making the color and intensity the same or it will abruptly change at the start of the transition back.
Getting the background to change depending on what side you're on:
21 07 XX 00 YY YY YY YY branches to YY YY YY YY if the side the attacker is on matches XX. Mega Punch's custom background operates by placing two of these in a row (with XX = 00 and 01) to branch to subroutines that set the background to the correct one and then return.
0F appears to return to where the initial script left off after a branch.
Credits:
-Jambo51 for explaining how to add new attacks, and the offset of several tables, which helped me test animations
-DoestKnowHowToPlay for already documenting some of the commands
-Darthatron for finding the table containing all the animation command routines, hopefully these can be used to find out what each command does
EDIT: Some useful information found by Doesn'tKnowHowToPlay and dreamengine:
https://www.pokecommunity.com/posts/7481054/
https://www.pokecommunity.com/posts/7485231/
https://www.pokecommunity.com/posts/7485560/
Last edited: