New guy trying to add menu skills


I just recently got into the Fire Emblem hacking scene and I’m trying to make a fun FE8 hack with a bunch of unique skills. I have some familiarity with high level programming (C++/Java) but not much in low level stuff like asm so its been slow progress so far. I’ve been doing the skills tutorials and I have a decent idea on how to do basic modifications to the asm code of existing skills.

Just to give you an idea of my goals, I’d like to have a hack where a player can do things like the Emblem finishers from Engage. I thought implementing something like Great Sacrifice would be realistic for a newbie, but perhaps I’ve underestimated the difficulty of the task.

The part where I’ve gotten stuck is figuring out how to add skills that would be triggered by menu commands. I’ve looked into the code for the Rally skills, since those match what I’m going for but I’m having a hard time figuring it out. How would I go about adding a menu option to a unit’s commands? Figuring out that part is the first hurdle for me to jump.

Advice or comments are welcome.

1 Like

I haven’t really done any command skill yet (though I should try soon) but I think that checking EngineHacks/Necessary/UnitMenu might be a good starting point.

1 Like

Awesome, that does look like what I’m looking for. Much appreciated. I haven’t messed around with buildfiles yet, so that is another thing to figure out.

OK, I found the function that creates the rally menu skill. For the benefit of other people searching for the same thing, I’ll post my findings here:

MenuCommand(UM_Rally, UM_RallyDesc, NormalText, RallyCommandUsability, RallyCommandEffect)

is called in EngineHacks/Necessary/UnitMenu/UnitMenu.event

where menuCommand has the following function header:

#define MenuCommand(name,description,colour,usability,effect) “WORD $80d7d94; SHORT name description; BYTE colour $4e; SHORT 0; POIN usability|1; WORD 0; POIN effect|1; WORD 0 0 0”

These are my best guesses for the requirements of these parameters. Hopefully, I’m not too off base with these:

Name and Description - A reference to a string defined in unitmenu_text.txt is passed in for both name and description. Description is the help text that shows up when pressing R on the skill in the menu. The strings are formatted in a particular way that I’m not 100% clear on, but it seems that [N] is used for newlines and [X] is used to terminate the string.
colour - A value between 0x0 and 0x5 that defines the color for the skill name string shown on the menu.
usability - a pointer to a function that decides whether the menu skill can be used at the moment. In the case of the Rally skill, it returns 1 if the ability can be used and 3 to hide it.
effect - a pointer to a function that performs the skill’s effect.

Both usability and effect are defined in the rally skills asm files.


After checking the usability function of Gaiden Magic, I’d like to add that, apparently, if it returns 2, it displays the command greyed out.

1 Like

I think it’s worth considering whether you want to use a submenu or not.

Unit Menu → Harden
Unit Menu → Buffs → Harden

It’s more complicated to use a submenu, but it improves the organization of it if you’re going to have many skills. You could make your command a Combat Art, for example, or mimic the menu by referencing this:

(But also it’s worth noting that you don’t need to #incbin the same code repeatedly like Sme did in this next section.)

#incbin "CombatArtUsability.dmp"
POIN SkillTester
WORD 6 //Adept art ID
POIN CombatArtCostTable

7743 showed me how to simplify it for my AoE hack, but AoE is probably not a great reference otherwise (as it isn’t organized that well and it’s very complex).

It’s probably easiest to just add new combat arts if you want a submenu.

Also if you haven’t yet had a look at fe-clib and Stan’s fe8u notes, I would recommend them.

For example, the stuff about a menu option being shown, greyed out, or hidden is here:

finally, join the discord and ask specific questions in #advanced_help #gba_coding_help

1 Like

Combat art skills are pretty similar to Engage style attacks and something like that could serve as a good template for what I’m trying to do. I’m also interested in implementing AoE attacks but that might be a bit too ambitious for me right now. I’ll still take a look at your code and see what I can learn from that. Those FE8notes look like a very thorough mapping of the ROM’s layout, I’ll give those a look.

I’m also trying to figure out how to make best use of the tools available for FE8 ROM hacking. I’m thinking of using FE_Builder for level design and setting up cutscene events, while developing the new skills separately using Buildfiles, but I’m not sure if that is a good idea or if it will be easy to merge those two later. Is there a way to upload edits to the SkillSet Library into FE_Builder without it becoming a giant mess?

A custom build is used for this. It takes about 5 mins to load and overwrites a few things back to the defaults. If you don’t really understand buildfiles, then it can be really frustrating. But if you understand them, then you might as well use one for your project assuming you’d prefer the easier customization of hacks in exchange for a less streamlined approach.

Vast majority of users start with febuilder and it is an amazing tool (even if just for reference when buildfiling), so definitely spend some time familiarizing yourself with it either way. Best to start with say a 1 chapter hack to get the ropes a little.

I haven’t figured out buildfiles yet. Still working through the tutorials. It makes sense so far and it seems almost obligatory if making significant changes to the skillset code. I do like the level editor that FE Builder provides, so ideally I can use them both without creating conflicts or overwriting each other’s changes. That is my main concern with using both in the same project.

Oh and yes, I’ve gotten a rough version of the prologue for my hack completed in FE Builder. I have a decent idea of how to make custom maps, characters, classes, weapons, etc… in that tool.

I would share some pics but for some reason FEUniverse isn’t letting me post them nor links. Maybe a new user restriction or something?

1 Like