How to make conditional events at the end of a chapter? [FE7] [FEBuilder]

Does anybody know a simple way how to make conditional events at the end of a chapter in FE7?
Say, for example, you’d get a different conversation if X/Y lived or died.
There’d be four scenarios:
X dies, Y lives.
Y dies, X lives.
X and Y both live.
X and Y both die.

I remember doing something similar, It went something like this.

CHECK_ALIVE (UnitID_A)
___BEQ, else goto conditionID 0x1
___CHECK_ALIVE (UnitID_B)
______BEQ, else goto conditionID 0x3
______(whatever eventing you wanna do here)
______GOTO conditionID 0x3
___LABEL conditionID 0x1
______CHECK_ALIVE (UnitID_B)
_________BEQ, else goto conditionID 0x2
____________(whatever eventing you wanna do here)
____________GOTO conditionID 0x3
______LABEL conditionID 0x2
__________CHECK_ALIVE (UnitID_A)
_____________BEQ, else goto conditionID 0x3
_____________(whatever eventing you wanna do here)
_____________GOTO conditionID 0x3
LABEL conditionID 0x3

You can probably polish up the coding a bit but that’s the general jist. Hope this helps!

Not exactly sure on how to program into FEBuilder, but the general gist would be:

EventPointer:
IFCD 0x20 0x01
JUMP BranchOutcome1
ELSE 0x21
ENIF 0x20
JUMP BranchOutcome2
ENIF 0x21
ENDA

BranchOutcome1:
IFCD 0x22 0x02 //X is dead, Y is dead
(events)
ELSE 0x23 //X is dead, Y is alive
ENIF 0x22
(events)
ENIF 0x23
ENDA

BranchOutcome2:
IFCD 0x24 0x02 //X is alive, Y is dead
MUS1 0x0C
TEX1 0x852
ELSE 0x25 //X is alive, Y is alive
ENIF 0x24
MUS1 0x0D
TEX1 0x853
ENIF 0x25
ENDA

FEBuilder seems to display ELSE/ENIF codes as GOTO/LABEL instead. So just replace the old ELSE and ENIF codes with GOTO and LABEL instead. If condensed and updated to use newer code, the events may look like:

EventPointer:
IFCD 0x20 0x01
IFCD 0x21 0x02//X is dead, Y is dead
MUS1 0x0A
TEX1 0x850
GOTO 0x22//X is dead, Y is alive
LABEL 0x21
MUS1 0x0B
TEX1 0x851
LABEL 0x22
GOTO 0x23
LABEL 0x20
IFCD 0x24 0x02//X is alive, Y is dead
MUS1 0x0C
TEX1 0x852
GOTO 0x25//X is alive, Y is alive
LABEL 0x24
MUS1 0x0D
TEX1 0x853
LABEL 0x25
LABEL 0x23
ENDA

This is roughly how the events look in FEBuilder, following the order of events directly above.

I tried that event, but it made the game freeze here

There also seems to be a WORD code that occurs after each IFCD command. Try adding those and see if it works?

Those just seem to come up if you don’t properly label stuff.

Is that so?
I decided to export the code that FEBuilder had in regards to that event, so try exporting your event file, then importing it with the code below added to it? You should be able to tweak it to your needs once you have it inserted into FEBuilder.

Code

550000002000000001000000 //If character is dead, execute it below (jump to condition label if it is alive)[Conditional ID:0x20][Character_to_check:0x1 Lau]
00000000 //WORD
550000002100000002000000 //If character is dead, execute it below (jump to condition label if it is alive)[Conditional ID:0x21][Character_to_check:0x2 Brandon]
00000000 //WORD
78000A00 //Change BGM to [MUSIC:0xA Distant Travels]
0D00000050080000 //[Talk:0x850 He’s almost defeated]
4500000022000000 //GOTO[Conditional ID:0x22]
4400000021000000 //LABEL[Conditional ID:0x21]
78000B00 //Change BGM to [MUSIC:0xB Inescapable Fate]
0D00000051080000 //[Talk:0x851 I must be next to the enemy!]
4400000022000000 //LABEL[Conditional ID:0x22]
4500000023000000 //GOTO[Conditional ID:0x23]
4400000020000000 //LABEL[Conditional ID:0x20]
550000002400000002000000 //If character is dead, execute it below (jump to condition label if it is alive)[Conditional ID:0x24][Character_to_check:0x2 Brandon]
00000000 //WORD
78000C00 //Change BGM to [MUSIC:0xC Enemies Appear]
0D00000052080000 //[Talk:0x852 I want to fight! I m]
4500000025000000 //GOTO[Conditional ID:0x25]
4400000024000000 //LABEL[Conditional ID:0x24]
78000D00 //Change BGM to [MUSIC:0xD The Messenger]
0D00000053080000 //[Talk:0x853 My sword cannot lose]
4400000025000000 //LABEL[Conditional ID:0x25]
4400000023000000 //LABEL[Conditional ID:0x23]
0A00000000000000 //ENDAEvent end command

Did it work when you tried it?

Yeah. It works for me.

How do I do this for whether you killed the boss within a certain turn count?