[FE7/FE6] Arch's Guide to Chapter Construction

Chapter 11: ASM Conditions

And we come back to conditions again. If you thought what we covered before was the end of things; well, you were wrong. Fire Emblem has quite a few “ASM-based” conditions. Now, before your brain turns off because “ASM OMG TOO HAAAAARRRRDDDD,” for the non-ASM-challenged among us, yes this can be used to make your own custom conditions. However, you don’t have to know any ASM to work with these, they work just like ordinary conditions.

IFAT conditionID ASMRoutine //If ASM condition is TRUE.
IFAF conditionID ASMRoutine //If ASM condition is FALSE.

Those are the two codes you need to know. They just check the ASM routine, and the routine comes back with either a ‘yes’ or ‘no’ for whether the condition has been met. That’s where the real power is, and those of you with ASM knowledge (or who have generous friends with ASM knowledge), you an create custom conditions.

Here’s a list of pointers we’ve documented from FE7:

0x7D2B1 //If the unit is lucky, used for desert items.
0x7A2F1 //If it's the player phase.
0x7D3F9 //If player has X gold (X specified by player, default is 20000).

I’ve got some documentation on the pay-to-recruit events.

And, as a little treat for the class (for making it through 10 chapters of this bullshit), I’m also going to share some custom conditions with you.

@CT075 made these for a chapter in Elibian Nights, which I used for reinforcement events.

EveryTwoTurns:
00 B5 01 20 03 49 09 88 01 40 00 29 00 D0 00 20 00 BD 00 00 08 BC 02 02 00

EveryFourTurns:
00 B5 01 20 03 49 09 88 03 22 11 40 00 29 00 D0 00 20 00 BD 08 BC 02 02 00

EverySixTurns:
00 B5 01 20 03 49 09 88 07 22 11 40 00 29 00 D0 00 20 00 BD 08 BC 02 02 00

Just copy/paste these into free space, and for your ASMRoutine remember to use the offset+1. You can find the source for that here. This is the code in action:

HorseReinforcements:
IFAF 0x03 0xDE0181 //Every four turns, the code was pasted at DE0180
LOU1 Whorses2
ELSE 0x04
ENIF 0x03
IFAF 0x05 0xDE0161 //Every two turns
LOU1 Whorses
ENUN
ENIF 0x05
ENIF 0x04
ENDA
....
Whorses:
UNIT 0x7E Paladin 0x00 Level(8,Enemy,True) [3,29] [3,29] [SilverLance] NoAI
UNIT

Whorses2:
UNIT 0x6B GreatKnight 0x00 Level(8,Enemy,True) [3,29] [3,29] [SteelBlade] NoAI
UNIT

Every two turns a Paladin will be loaded, except every four turns it’ll load a Great Knight instead. These were useful in constructing a chapter with endless reinforcements to vary the loading without a TurnEvent list a mile long for all the different reinforcements.

The chapter I made was essentially a forced loss for the player, whose ending event was triggered by an ASM condition Markyjoe created. It’s sort of the opposite of the DefeatAll enemies effect, triggering the ending when all allies are defeated.

ASME 0x00 SceneLabel ASMRoutine

In my MiscEvents, this was used (triggers an event based on the ASM condition being met).

AllDefeated:
00 21 00 22 09 48 40 58 00 28 0C D0 08 48 40 5C FF 28 04 D0 07 48 40 5C 00 28 02 D1 01 22 48 31 F0 E7 00 20 70 47 10 1C 70 47 00 00 50 BD 02 02 60 BD 02 02 63 BD 02 02

You can get your hands on the source here.

Finally, we have another condition @Nintenlord made for me based on the tactician’s gender. I use it to change the gender of the My Unit character for the Tale Select in Elibian Nights.

IfTactFemale:    
00 B5 06 48 00 F0 08 F8 00 06 00 28 01 D1 01 20 00 E0 00 20 02 BC 08 47 00 47 00 00 C9 A3 07 08

These are just a few examples of the power that ASM conditions can unleash.

@Agro’s notes: I strongly suggest you check out this thread as some more custom assembly conditions are being written and released.

1 Like