FE8 conditions?

Hi there,
I staretd to hack FE8 because I think it’s better as a base for what I have planned. But right now I don’t understand how the Condtions work. Like, I want to trigger two events, if a certain ID is not active, which is the ID of the boss quote. The Event Guide for FE8 gave me no answer as well as diving through the vanilla events. Can anyone explain it so I undestand it?

I’m not sure when you’re checking for these events, but it sounds like here’s what you need:

CHECK_EVENTID 0x1
I think this is the event id that gets triggered when the boss quote has been played.
What’ll happen now is that the game checks if your event id has been triggered (duh), and
then writes the result (either 0 or 1) to memory slot 0xC.

IFNE 0x1 0xC 0x0
//This stands for IF Not Equal. If not equal to what? We look at the last two arguments, 0xC and 0x0. Both of these are memory slots. We’re going to compare the contents of them. Slot 0x0 always has 0. Slot 0xC has the result of our event id checking code above. So it’ll either have a 0 or a 1 in it. If it has a 1 (event id was set), then the two slots are not equal. If the slots are not equal, than we jump to label 0x1. Where’s that? Keep reading.

(your events that occur if the event id was not set)

LABEL 0x1
This is the code we’ll jump to if the slots weren’t equal (ie, the event id was triggered). Note that the 0x1 here matches with the 0x1 in IFNE 0x1 0xC 0x0. If we jumped here, then we didn’t execute the above events.

(rest of the code follows)

Hope that helps!

So right now it’s freezing, when the Text should activate but everything works, when the ID is active. Pretty sure I done something wrong, but I can’t figrue out what.

Event:
CHECK_EVENTID 0x11
IFNE 0xA0 0xC 0x0
GOTO 0x2
LABEL 0x1
TEXTSHOW 0x09A4
TEXTEND
REMA
LABEL 0x2
EVBIT_T 0x7
ENDA

You have IFNE 0xA0 0xC 0x0. If the event id is set, then you’re telling it to jump to LABEL 0xA0. Except there is no such thing. So it freezes. Now let’s say the event ID isn’t set and we don’t branch to our (nonexistent) label. The next command is GOTO 0x2, which is an unconditional jump to the end. So even if the ID isn’t set, you’re still skipping the events you want to run. I think what you want is:

Event: (also, change the event label name to something a bit less generic)
CHECK_EVENTID 0x11
IFNE 0x2 0xC 0x0
Text(0x9A4)
LABEL 0x2
EVBIT_T 0x7
ENDA
1 Like

Yeah the Event is a bit longer, so I shorted it for the parts we need here. That worked after I used IFEQUAL instead of IFNE. Thanks for the patience and the help! By the way, do the ENIF and ELSE still work like in FE7? For example if I want to write an event like this:

Check if Event ID is active
-> If yes, show this text
-> If no, show an other text
Continue with the event

Just asking to get an understanding for the condtions.

They do work. ENIF is LABEL and ELSE is GOTO. They were changed because the names are confusing. If you look at EA Standard Library/Conditionals Backwards Compatibility.txt you can find the the older definitions, if those are more appealing for whatever reason.

Okay… Funny thing now, is that the condition works perfect now, but when a player unit moves or simply waits, the ending scene is triggered. O.o

[details=Events]> #include EAstdlib.event

EventPointerTable(0x07,ThisChapter)

ORG 0x9E863C
ThisChapter:
POIN TurnBasedEvents
POIN CharacterBasedEvents
POIN LocationBasedEvents
POIN MiscBasedEvents
POIN Dunno Dunno Dunno
POIN Tutorial
POIN Traps1 Traps2
POIN Units Units
POIN $0 $0 $0 $0 $0 $0
POIN BeginningScene EndingScene

TurnBasedEvents:
TURN 0x00 SecondTurn [02,00] 0x0
TURN 0x03 Tonywaits [03,00] 0x0
TURN 0x04 Tonywaits2 [04,00] 0x0
AFEV 0x05 Tonydefeated 0x16
AFEV 0x07 Tonyattacked 0x11
END_MAIN

CharacterBasedEvents:
END_MAIN

LocationBasedEvents:
END_MAIN

MiscBasedEvents:
CauseGameOverIfLordDies
AFEV 0x8 EndingScene 0x02
END_MAIN

Dunno:
//DO NOT TOUCH
WORD $00

Tutorial:
//DO NOT TOUCH
WORD $00

Traps1:

ENDTRAP
ALIGN 4

Traps2:
ENDTRAP
ALIGN 44

Bossarrive:
UNIT ONeill 0x12 ONeill Level(1,Enemy,False) [0,2] 0b 0x0 0x1 BossREDAs [IronSword] [0x3,0x3,0x9,0x20]
UNIT

Bad:
UNIT 0x69 Fighter 0x00 Level(1,Enemy,False) [9,6] 0b 0x0 0x1 Tonys [0x82] [0x3,0x3,0x9,0x20]
UNIT

Units:
UNIT Eirika EirikaLord Eirika Level(1,Ally,False) [5,3] 0b 0x0 0x1 EirikaMove [IronSword] [0x0,0x0,0x0,0x0]
UNIT

Good:
UNIT Seth 0x18 Eirika Level(1,Ally,False) [7,9] 0b 0x0 0x1 EirikaMove [IronBow, Herbs] [0x0,0x0,0x0,0x0]
UNIT

SethMove:
REDA [7,8] 0x10 0x00 0x00 0x00 0x00
ENDA

EirikaMove:
REDA [5,3] 0x10 0x00 0x00 0x00 0x00
ENDA

Tonys:
REDA [9,6] 0x10 0x00 0x00 0x00 0x00
ENDA

BossREDAs:
REDA [5,2] 0x10 0x00 0x00 0x00 0x00
ENDA

BeginningScene:
_LOAD1 0x1 Units
_LOAD1 0x1 Bad
_0x1324 0x7FFF
STAL 100
MUSC 0x0029
SETVAL 0x2 0x0D; CALL $9EE2E8
TEXTSHOW (0x999)
TEXTEND
REMA
SETVAL 0x2 0x2D; CALL $9EE2E8
TEXTSHOW (0x99A)
TEXTEND
REMA
MUSC 0x00
STAL 16
SETVAL 0x2 0x34; CALL $9EE2E8
_0x1A22
TEXTSHOW (0x9A2)
TEXTEND
REMA
_0x2620 0x1300
_0x2B22
_0x1324 0x7FFF
FADI 16
MUSC 0x004C
SETVAL 0x2 (0x35); CALL $9EE2E8
TEXTSHOW (0x99B)
TEXTEND
REMA
FADI 16

_0x2620 0x1300
_0x2B22
Text(0x13,0x099C)
REMA
STAL 10
MUSC 0x0024
CUMO Tony_P
STAL 60
CURE
Text(0x99D)
EVBIT_T 0x7
ENDA

SecondTurn:
CUMO Tony_P
STAL 60
CURE
MUSI
Text(0x99E)
REMA
MUNO
ENUN
EVBIT_T 0x7
ENDA

Tonyattacked:
CAM1 Tony_P
STAL 60
CUMO Tony_P
MUSI
STAL 6
CURE
TEXTSHOW 0x99F
TEXTEND
REMA
MUNO
EVBIT_T 0x7
ENDA

Tonywaits:
CUMO Tony_P
STAL 60
CURE
Text(0x9A3)
CHECK_EVENTID 0x11
IFEQUAL 0x12 0xC 0x0
Text(0x9A3)
LABEL 0x12
EVBIT_T 0x7
ENDB

Tonywaits2:
CUMO Tony_P
STAL 60
CURE
Text(0x9A3)
CHECK_EVENTID 0x11
IFEQUAL 0x13 0xC 0x0
Text(0x9A4)
LABEL 0x13
EVBIT_T 0x7
ENDB

Tonydefeated:
CUMO Eirika
STAL 60
CURE
MUSC 0x0024
TEXTSHOW 0x9A0
TEXTEND
REMA
_SETVAL 0x3 0x6C
_GIVETO 0x1
MUNO
_LOAD1 0x1 Bossarrive
ENUN
_LOAD1 0x1 Good
ENUN
EVBIT_T 0x7
ENDB

EndingScene:
MUSC 0x0031
SETVAL 0x2 (0x13); CALL $9EE2E8
TEXTSHOW 0x9A5
TEXTEND
FADI 16
REMA
MNC2 0x01
STAL 1
ENDA

MESSAGE Events end at offset currentOffset[/details]

I’ve heard that the game likes to use event IDs from 0x0 to 0xA for various things. I’ve never used those myself. I usually just use 0x10 and up, so I’m not sure. Maybe try putting the event IDs to values 0xB and higher? I’d give that a shot.

Yeah, it’s EventID’s 0x0 - 0x6 that shouldn’t be used for normal stuff.

0x0 - Always False
0x1 - Boss Quote
0x2 - Boss Death Quote
0x3 - Seize
0x4 - Music Change
0x5 - Unknown 
0x6 - Rout
0x7 - First safe EventID

E - Why do you have AFEV’s in your TurnBasedEvents? Pretty sure they’re meant to go in MiscBasedEvents like you’ve got for that one AFEV.

Thanks, I changed the IDs and it works fine now. The AFEVs are there because I want to activate the event when a turn begins and not when the ID is triggered.

Oh crap I didn’t notice that.
Why wouldn’t you just use a TURN event for that? What exactly are you trying to do for this event?

In this case it triggers when a specific enemy is defeated, so the boss appears. By using an AFEV as a turn event the event triggers on a turn begin instead of an instant activation. This way the event can trigger any turn and not on a specific turn. (Well I could use (0,255) as turns, bit I thought it’s more elegant this way).
The second AFEV activates when the specific enemy is attacked. Since the enemy doesn’t attack on his side it get’s activated on the begin of the enemy turn.

For your first AFEV, here’s what you’re going to want to do.

  1. Trigger an event ID (let’s call it #1) at the beginning of the chapter.
  2. Put event ID #2 on the enemy’s death that you want to trigger it.
  3. Make an AFEV triggered by event ID #2 with a command that makes event ID #1 untriggered.
  4. Make a TURN event (All turns) with event ID #1 with commands to the boss spawning.
  5. Put an event ID conditional (event ID #3) around the boss spawning command so it only happens if ID #3 is not triggered, and trigger event ID #3 at the end of the boss spawn command to ensure that it only happens once.

For your second one, you can do the same thing except with battle quotes and different ID’s I think.

Let me know if I misinterpreted your plans or if this doesn’t wok.