Custom Triangle Attacks: A Guide

So, do you want to have a custom Triangle Attack animation in your hack? Of course you do. But if you’re like me, you’ve heard that changing the triangle attack animation is nigh-on impossible, due to how the graphics are put in the rom, and that the animation scripting for it is still not understood. But after seeing this video, I went, “Well heck, if someone could do this a decade ago, surely it can’t be impossible, right?”

So I managed to figure out a hacky and limited way to replace the graphics. With this guide, you too can replicate my success(?)

What you’ll need

  • Usenti (need palette order to stay same)
  • GBA Graphics Editor (no, seriously.)
  • Template for anim you want to replace (see bottom of this post)
Step 1: What animation to replace?

So first we’ll talk about how the game decides what triangle attack animation to show (this guide pertains to FE8 in particular). There are two types of triangle attack: pegasus, and armor. For pegasus, there is lance pegasus, sword falco, and lance falco. For armors, there is lance knight, lance general, axe general, and handaxe general.
Looking in Builder:


From what I understand, the game checks if the given class is within the range to use armor triangle attack instead of pegasus triangle attack (see the patches for “Armor Triangle Attack Range From/To”). It then references the actual class to show promoted or unpromoted anims. Finally, it checks the weapon used. The weapon usage code I have not looked very deeply into, but this is something I could glean with some knowhow:

Spooky ASM

For the general:


For the falco:

The important thing here is that the lance anim seems to be the “default” case for all the anims: ie, if you have a warrior triangle attack that replaces the falcoknight (so they’re all using axes), the lance falco will be used. The unpromoted pegasus/knight don’t bother checking weapon since they don’t need to. Otherwise either try to match the anim to the weapon, or use your ASM knowledge to change the switch cases I showed.

Step 2: Okay, but how do I make the graphics?

So the animations are stored in the ROM like this (two sheets per anim):
axe general 1

axe general 2
Blugh. Let’s recolor that real quick:
Axe general recolor 1
Axe general recolor 2

So now I think you can see the issue: the graphics have been cut up to be compressed! So, replacing these means we need to cut up our graphics and put them in place. Fortunately, I’ve done some of the work for you. At the bottom of this post is a link to a folder of templates: for the pegasus/falco (all these use the exact same format thankfully), the knight, the lance general, the axe general, and the handaxe general.

For this tutorial, I’ll be using the simpler knight/general. These animations have 3 frames: standing, preparing to attack, and the attack. Note: the handaxe general’s attack has a special case where the axe is animated separately from the rest of the body, but the template should still work.
So let’s take a look at the axe general templates:
axe general standing

axe general attack prep

axe general attack hit

So what you’ll want to do here is paste your desired class’s frames in the colored boxes (don’t go outside the lines, but on the lines is fine):
axe general standing
And then use those colored boxes to align to where they need to go in the sheet:
axe general standing (1)
And then remove the boxes and crop to original size.
axe general standing (2)

For the prep/attacking frame, you can see that they’re on the same sheet, so you’ll have to merge them. See this halberdier for an example.
preliminary halb 2

These need to have the same palette order as the original animation (so that they don’t look like clown vomit when the game dynamically applies palettes during the triangle attack), so use usenti for that. Save as .bmps, 256 colors.
Screen Shot 2021-09-04 at 12.48.44 PM
After you have your two sheets, it’s time to insert!

Step 3: Put 'er in the ROM

So open up GBA Graphics Editor and open your ROM. Open the Image Control from Windows.


The triangle attack graphics start at 9 in the preset compressed graphics offsets, and in the order: pegasus 1, falco lance 1, falco sword 1, pegasus 2, falco lance 2, falco sword 2, knight 1, lance general 1, axe general 1, handaxe general 1, knight 2, lance general 2, axe general 2, handaxe general 2. Import over the slot you want.

Important: when importing, make sure to uncheck the “Import Palette” option, lest you ruin your ROM. Seriously.
Screen Shot 2021-09-04 at 12.58.18 PM

After your two sheets are imported, save as a new ROM (just in case), and test. With any luck, it worked!

Bonus case 1: Fuck fliers

So if you’ve looked in the folder of templates, you might have noticed what a mess the falco templates seem to be. This is because their animations is more complicated than the armor’s. The first sheet is relatively straightforward (note that this sheet contains the last two frames of the triangle attack, not the first frame (as with the general).
falco sheet 1

But the second sheet…hoo boy.

Basically what’s going on here is that there’s a “base frame” that the game uses for the body of the pegasus:
falco sheet 2 base frame
And then there are 4 different frames of the wings animating, all drawn on that base frame, to create the illusion of 4 entirely separate frames. Note that the front wing is drawn in front of the body, and the back wing is drawn behind the body.
falco sheet 2 wing frame 1
falco sheet 2 wing frame 2
falco sheet 2 wing frame 3
falco sheet 2 wing frame 4-1

So to replace this anim, you need to keep track of position of what’s on the base frame and what’s in the wing frames, copying stuff where necessary. Here’s what I did for the warrior speen:
warrior sheet 2

Definitely tedious, but if you gotta do it, you gotta do it.

Graphics folder
Edit: I’ve included some of the anims I did (credits to TBA for the halberdier), free for you to use or reference to make your own.

If you have any questions, please ask. If you have a better approach, definitely say so, because this is just what I found to work.

29 Likes

Update after a long time, but today I decided to mess around some more with triangle attacks, and managed to change the handaxe general animation to instead check for a third weapon type, which should offer a bit more flexibility.

I wrote this little installer that will edit the function to allow you to make this sort of change; it will also let you swap out the lance/axe checks for different weapon types, to save you a bit of time.

Armor Triangle Attack Weapon Swap
#ifndef _FE8_
    ERROR "You're not assembling to an FE8 ROM!"
#endif

#include EAStdlib.event
#include "Extensions/Hack Installation.txt"

// sword is 0, lance 1, axe 2, bow 3, staff 4, anima 5, light 6, dark 7

// change this value to set first weapon rank, replacing lance general
#define WeaponRankOne 0x1

// change this value to set second weapon rank, replacing axe general
#define WeaponRankTwo 0x2

//change this value to set the new weapon rank, replacing handaxe general
#define NewWeaponRank 0x0

PUSH

     
    ORG $07500A
	BYTE WeaponRankOne 0x28
	SHORT 0xD002 
	BYTE WeaponRankTwo 0x28
	SHORT 0xD00A 0xE003 0x2100 0x4688 0xE008 0x46C0 
	BYTE NewWeaponRank 0x28
	SHORT 0xD105 0x2202 0x4690 0x46C0 0xE001 0x2001 0x4680
	  

    
    ORG $075072
	BYTE WeaponRankOne 0x28
	SHORT 0xD002 
	BYTE WeaponRankTwo 0x28
	SHORT 0xD008 0xE002 0x2700 0xE006 0x46C0
	BYTE NewWeaponRank 0x28
	SHORT 0xD103 0x2702 0x46C0 0xE000 0x2701

POP

To celebrate, I’ve also done a bow general replacement for the handaxe general (in the graphics folder above). Given that you still need to be adjacent to the target, this should be quite useless, but I had fun, which is the important part.

bow general triangle

11 Likes