[FE7] Condition Writing Help

I’'ve been trying to create a event where it checks if two (or more if possible) are dead, then specific conversations don’t happen and it’s not working, can anyone point me in the right direction?

Can the above also work with gaiden chapters, where both characters have to be alive for the gaiden chapter requirements?

IFCT 0x00 0x34
IFCT 0x00 0x35
TEX1 0x92D
REMA
ELSE 0x36
ENIF 0x35
TEX1 0x92F
REMA
ENIF 0x36

Sorry if this is confusing, there must be something I’m missing. What’s the difference between a conditionID and an event ID? I thought all “ID’s” were the numbers from 0x00 to 0xFF?

Condition IDs use their own set of numbers that are separate from Event IDs.
Condition ID 0x01 is not the same as Event ID 0x01. They both range from 0x00 to 0xFF

There’s a condition that checks if a character is dead: IFCD ConditionalID Character

an event ID (which is a bad name for it; i prefer the term “scene trigger”) is a switch that “toggles” on or off depending on what you tell it to do. typically, you use a scene trigger to tell the game that a certain thing has already happened (we can’t visit this house because we’ve already visited it before, so we flip the trigger to “on” to show that we’ve done it) or to check those same things later down the line (oyu want to give an item as a reward for visiting this village a few turns later, so we have to check if the trigger is “on”). as you may have guessed, there are 255 (0xFF) of these, and the switch you flip is the number you put.

a condition ID is just a way of telling the game where a “conditional block” starts and stops. when you do IFCA 0x1 [other stuff], the game checks if the character is (whoever). If it is, then we just keep going along the block. If it isn’t, the game needs to know where to go next, right? so it just skips everything it sees until it sees an ENIF 0x1 (ENd IF 0x1). It knows to look for 0x1 in particular because that’s the conditional ID you gave that IF condition. If you’d used condition ID 0xAB, you’d need to use ENIF 0xAB instead. ELSE does something similar; it just doesn’t check anything and instead scrolls down the line for its own ENIF.

Does conditional ID’s have the same restrictions or rules as event ID’s? Ex: 0x01 - 0x05 is hardcoded for certain things, 0x65 = hardcoded for gameover upon activating, stuff like this? Are there certain conditional ID’s that are remembered by the game/ can only be used once like any event ID’s/scene triggers after 0x80? and others are like 0x06 - 0x40 where they refresh every chapter?

…which means I can’t use 0x00 as a conditional ID then? unless 0x00 is not read the same way as event ID’s/scene triggers?

IFCD 0x01 Guy
ENUN
ELSE 0x02
ENIF 0x01
LOU1 Guy1
ENUN
STAL 0x1E
ENIF 0x02

Trying to process the information after trying this but it didn’t work, how is this statement read when put into a sentence? Is it saying: If the character Guy is dead, do nothing, or else load the unit group Guy1? Or am I not reading the statements correctly? Because Guy IS alive but the unit group is not loading, the statement above only does whatever I put after the IFCD and before ELSE. I’m trying to do a " if (character) is dead, do nothing, but if not(aka alive) then something else should happen.

But that conflicts with what you told me that ELSE does not scan and just scrolls down the line for its own ENIF.(which I didn’t know btw, so thank you @CT075 )

Another thing is, do the conditional IDs keep scanning down the line until it returns false or true?

the snippet you posted works like this:

IFCD 0x01 Guy // Is Guy dead? (0x01)
// If yes: Keep going
// If no: Go down until you see ENIF 0x01 or ENDA
ENUN
ELSE 0x02 // Go to ENIF 0x02
ENIF 0x01 // If Guy is not dead, the next thing we see is here
LOU1 Guy1
ENUN
STAL 0x1E
ENIF 0x02 // If we got to the ELSE (only possible if Guy was dead), we end up here
// Other stuff

Do you see why the stuff between ELSE and ENIF 0x2 will never be seen if Guy is dead?

I think so…the stuff between ELSE and ENIF 0x02 should be seen in this case right? In other words the snippet I posted should work then, if I wanted nothing to happen if Guy is dead, and the unit group is to spawn if he is alive.

How would this account for wanting to have a statement that checks if more than one character is dead? and if anyone of those characters are dead then the gaiden chapter doesn’t load. It seems the way the ROM checks requirements, is it goes in order down the line of code.

Then you need to write out a condition to check if any of those characters is dead. The game will keep passing through them until one of the conditions returns as true. If none of them return true, then you get to the gaiden.

Alternatively, you could attach an event ID to their death quote for that chapter only and give them all the same trigger ID. Make a condition that checks if the trigger ID is true. If it’s false (therefore none of them died) then you proceed to the gaiden.

This is seriously outdated, but it should give you a hint.

You might want to note that JUMP has been replaced with GOTO

I think I’m starting to grasp the eventing statements, and the link you sent CT was really helpful. Thanks everyone!

Could I get a second pair of eyes on this bit of If-Thens?

I’m trying to write a statement that checks if both Ninian and Uther are dead then certain bits of dialogue show but if only Ninian is alive than something else happens, then if only Uther is alive then something else happens. To test this, I loaded both Ninian and Uther as ally units before cutting to the events. Only the first part of the checks happens, the part that should play if only both are dead.

IFCD 0x00 0x33 Ninian
IFCD 0x00 0x34 Uther
BACG 0x43
FADU 10
TEX1 0x9FA /// if both are dead
JUMP Daendscript
ENIF 0x34
BACG 0x43
FADU 10
TEX1 0x9F8 /// if ninian is dead
JUMP Daendscript
ENIF 0x33
IFCD 0x00 0x35 Uther
BACG 0x43
FADU 10
TEX1 0x9F9 /// if uther is dead
JUMP Daendscript
ENIF 0x35
STAL 0x08
ENDA

//other stuff

Daendscript:
STAL 0x08
MUEN 0x05
UnitClear
STAL 0x08
MNCH 0x10
ENDA

^^ this last part is all the way on the bottom of the event file past align and ending events, I’m only mentioning this because in the past, I noticed the ordering of certain labels or categories matter but in this case I’m not sure.

It looks like you’re confusing the concept of a conditional ID with character IDs.

You don’t ENIF on the character ID, you ENIF on unique conditional IDs (well, unique for that chunk of conditions).

IFCD 0x00 0x33 Ninian
    IFCD 0x01 0x34 Uther
       BACG 0x43
       FADU 10
       TEX1 0x9FA /// if both are dead
       JUMP Daendscript
    ENIF 0x01 // Close the Uther branch
    //
    // If we got here, we know that Uther is not dead, but Ninian is
    BACG 0x43
    FADU 10
    TEX1 0x9F8 /// if ninian is dead
    JUMP Daendscript
ENIF 0x00 // close the Ninian branch
IFCD 0x02 0x35 Uther
    BACG 0x43
    FADU 10
    TEX1 0x9F9 /// if uther is dead
    JUMP Daendscript 
ENIF 0x02 // Close the second Uther branch
STAL 0x08
ENDA

//
//other stuff
//
Daendscript:
STAL 0x08
MUEN 0x05
UnitClear
STAL 0x08
MNCH 0x10
ENDA
1 Like

Oooohhh…thats where I went wrong. I must have mixed up some of the command formats in my notes. Thanks for taking a look, Prime!