[FE8] Enemy "Seize" (Or, how to get a Game Over if the enemy reaches the Throne/Gate)

I was looking for a way to make the enemies trigger the Game Over screen if they seized the throne/gate, but I didn’t know if that required ASM or something fancy like that.
Luckily I figured out a simple way to make a “if enemy reaches the throne is Game Over”

First, you set up the AREA event:

MiscBasedEvents:
AREA eventID eventPointer [X,Y] [X,Y]
END_MAIN

eventID has to be an unique ID.

Then the event:

eventPointer:
CHECK_ALLEGIANCE 0xFFFF
SVAL 0x7 0x02
BEQ 2 0x7 0xC
	ENUF eventID
	GOTO 1
LABEL 2
	GameOver
LABEL 1
EVBIT_T 0x7
ENDA

Ok, CHECK_ALLEGIANCE returns 0x00 if the unit is Ally, 0x01 if it’s NPC and 0x02 if it’s enemy. We use 0xFFFF to check the allegiance of the unit that triggered the event.
If the unit is not an enemy, then we turn off the flag so it can be triggered again (this is in case a non-enemy unit waits at the throne)
In the Label 2 you can set any event you want (conversations, tile changes, etc.) and the last thing is the GameOver (or you can remove that and set any other event as you like)

Finally, the enemy AI.
Byte 2 in the enemy AI controls the movement, and conveniently there’s a byte to make the enemies move towards the Throne/Gate.

[AI1,0x0D,AI3,AI4]

0x0D is the required byte. I haven’t tested all the AI combinations, but so far the Attack/Don’t attack bytes work fine, as well as all recovery bytes.

And that’s it. Now you can make surprise reinforcements that will ruin the player’s strategy because they forgot to put someone in the throne.
Untitled Project

Side notes:
If you want this for an specific point of the map and not a throne/gate, set 0x10 for the AI2 byte, that makes units to move to the point [15,17] by default, just change the values at 0x5A90C0 and 0x5A90C1 for the coordinates you want. I haven’t tried this, but it should work.

I hope this might be helpful for someone.

8 Likes

Just thought I’d mention that Target Coordinate is faster than Target Terrain (which can be pretty laggy for the ai on large maps).

Oh, and also that enemies will prefer attacking you over moving/seizing if you are within attack range (and ai1 says to attack).

1 Like

That would explain why it took 6~7 secs for the enemy to move to the throne.
I guess it’s faster in smaller maps (I’m using a 21x27 map here)

1 Like

Make sure you’re not calling the game over event; you should be setting the game over flag instead. I’ve had issues where calling the event causes the game to not let you restart the chapter until you reset.

Weird, because the opposite happens to me.
I have the 0x65 flag for certain characters and when they die I can’t restart the chapter until I reset.

How do I even go into the Area Event menu?



image

Got it what’s next?

If you don’t know how to make basic events I recommend you to follow a FEBuilder tutorial.

I know how to make basic events but I need to know how to set the enuf event ID

Never mind I got it, but how am I supposed to enter the AI Bytes?