This post was flagged by the community and is temporarily hidden.
Chapter 3: The Event Arrays
You may find yourself asking, “What in the hell is a POIN array?”
To answer that question, look below:
See ThisChapter? That’s the label for the POIN array, which can be found below:
ThisChapter: POIN TurnBasedEvents POIN CharacterBasedEvents POIN LocationBasedEvents POIN MiscBasedEvents POIN Dunno Dunno Dunno POIN Tutorial POIN TrapData TrapData POIN Units Units POIN $0 $0 $0 $0 $0 $0 POIN BeginningScene EndingScene
It’s included in the template already, so you shouldn’t have to mess with it at all.
Basic format is:
CHAR EventID label [charID1,charID2] 0x0
There is also a macro for character events that work both ways:
CHES 0x0 itemID [X,Y] 0x14 (don’t change the 0x0 and 0x14 unless you want to do an AFEV linked to the event ID (0x0) and if you do, change that to a value higher than 0x7
CHES 0x0 0xXXXX0077 [X,Y] 0x14
XXXX is the amount in hex, and always terminate with 0077
Armories and Shops:
SHOP 0x0 ID [X,Y] 0x16 //armory = 0x16
SHOP 0x0 ID [X,Y] 0x17//vendor = 0x17
SHLI Item1 Item2 Item3...
The basic format for a turn event is
TURN EventID SceneLabel [Turn,(End_Turn-1)] Phase
0x0 runs the event before the player phase, 0x8 runs it before the enemy phase, and 0x4 runs it before the NPC phase.
There are macros in Main Code Helpers.txt of the EA Standard Library that take the form of:
#define TurnEventPlayer(eventID,pointer,startTurn,amountOfTurns) "TURN eventID pointer [startTurn, startTurn+amountOfTurns-1] 0"
If your chapter is a defend/survive map, this is where you’d put the thing that calls the ending scene.
TURN 0xA EndingScene [7,0] 0x0 would end the chapter at the start of Turn 7. You always want to do the number of turns + 1 for this. So if you have a 6 turn defense map, you’d have this be on turn 7.
The template has
CauseGameOverIfLordDies by default, but this is where you specify the thing that tells the game to jump to the ending scene if it is a rout or defeat boss mission (
AFEV’s (AFter EVents) can also go here:
AFEV eventID SceneLabel eventIDofPreviousEvent
Chapter 4: Scene Construction
Loading Backgrounds and Text
Fading in and out:
- FADI time //Fade-in with black
- FADU time //Fade-out with black
- FAWI time //Fade-in with white
- FAWU time //Fade-out with white
To load a background:
SETVAL 0x2 (background ID); CALL $9EE2E8
You can use the macro
To remove the background:
There is a macro
Text(background,text)which does all this for you, but you can’t change backgrounds mid-conversation.
BG to BG transitions
For BG to BG fading, you need:
_0x2141 0x1B 0x1 0x4 //does the transitioning. Parameters are backgroundID, unknown, speed of transition REMOVEPORTRAITS
After the first BG and before the text stuff that follows.
Do your conversations with
TEXTSHOW (text ID)and
REMA is used to clear the screen (which you should be doing when you change conversations or end a scene)
TEXTCONT is used when you have a [LoadOverworldFaces] in your text.
[Load units/move units/other things]
Music change codes
- MUSC songID plays the specified song (you can also use the song’s name as it appears in your music definitions)
- MUSS (MUSic Store)
- MUSM (MUSic Mute)
- MURE (MUSic REstore)
- CAM1 [XX,YY]
- Focuses the Camera at coordinates XX YY
- CAM1 characterID
- Focuses the camera on a specific character
These flash the cursor on a character or area of a map, for time you can use anything, but 60 is equal to FE6/FE7’s automatically timed cursor.
To enable the prep screen in your chapter, all you have to do is add
GotoPrepScreen to the end of your BeginningScene
Sample opening scene
BeginningScene: ENUT 0xC6 ENUT 0xC7 ENUT 0xC8 ENUT 0xC9 ENUT 0xCA ENUT 0xCB ENUT 0xCC //Unlocks guide menu entries MUSC 0x07 SETVAL 0x2 Forest; CALL $9EE2E8 //BGStart TUTORIALTEXTBOXSTART SETVAL 0xB 0xFFFFFFFF TEXTSHOW 0x98B //narration TEXTEND _0x2141 0x1B 0x1 0x4 //does the transitioning. Parameters are backgroundID, unknown, speed of transition REMOVEPORTRAITS //no idea what this is, but is necessary MUSC 0x24 //SETVAL 0x2 0x1B; CALL $9EE2E8 //BGStart TEXTSHOW 0x90D//banter TEXTEND MUSC 0x0 TEXTCONT TEXTEND MUSC Lost_Heart TEXTCONT TEXTEND CALL $9EE2C4 //BGEnd MUSC 0x0 LOAD1 0x1 Units ENUN LOAD1 0x1 Commander ENUN LOAD1 0x1 NPCGuys ENUN CAM1 [8,8] STAL 25 ENUN FlashCursor(Owen,60) MUSC 0x24 SETVAL 0x2 0x25; CALL $9EE2E8 //loads bg, bgstart TEXTSHOW 0x90E//entering the fort TEXTEND CALL $9EE2C4 //bgend CAM1 [8,4] MOVE 0x10 Sawyer [11,3] MOVE 0x10 Owen [10,3] MOVE 0x10 Elijah [10,4] MOVE 0x10 Eagle [11,4] STAL 30 MUSC 0x24 SETVAL 0x2 Fort; CALL $9EE2E8 TEXTSHOW 0x90F//talking to commander TEXTEND MUSC 0x2E0 STAL 100 TEXTCONT TEXTEND MUSC 0x25 TEXTCONT TEXTEND CALL $9EE2C4 CAM1 [8,8] _LOAD1 0x1 BossMan ENUN STAL 20 MOVE 0x10 Sawyer [11,10] MOVE 0x10 Owen [10,10] MOVE 010 0x84 [12,10] STAL 65 SETVAL 0x2 0x25; CALL $9EE2E8 TEXTSHOW 0x910//Leonhardt shows up TEXTEND CALL $9EE2C4 MOVE 0x10 0x68 [1,11]//move boss to his spot MOVE 0x10 0x84 [10,2]//moves commander MOVE 0x10 Owen [10,3] MOVE 0x10 Sawyer [11,3] _LOAD1 0x1 Enemies ENUN TEXTSHOW 0x911 TEXTEND REMA EVBIT_T 0x7 //required to stop weird blinking ENDA
Chapter 5: Inserting Maps/Tile Changes
- Most tile changes are handled by Tiled/the map inserter
- Pick your .tmx map, pick your ROM, pick an offset, and for the map/map change pointers, find the pointer of it from nightmare, open up a hex calculator (the default Microsoft one has one), multiply that number by 4, and add it to 8B363C.
So the pointer for the prologue map is 0x4, and in the hex calculator you’d do 4*4 + 8B363C and put the result in the map pointer box, the same process applies for the map changes pointer.
- Only manual tile changes need eventing
DOOR 0x00 DoorRemoval [X,Y] 0x12
In DoorRemoval (or whatever you call the label), you just need
Chapter 6: More Codes
FIG1 attacker defender 0x0 for normal fight
FIG2 attacker defender 0x0 for map animations only
FIG3 0 0 0 is used for the tutorial and rigs the results of the next battle.(not defined in eastdlib by default, the code is 0x3F42)
If your scripted battle uses the normal fight and one of the units dies, add these after the fighting part is done:
FE8 has those cool sepia flashback scenes, and now you can use them for yourself.
_0x2D20 0x4turns all map sprites sepia toned. Changing to 0x1 is blue, 0x2 is red, 0x3 is green
- You’ll need to insert your own sepia portraits and any new palettes you want to use (Town & Docks has a flashback palette available by default) and set them using Nightmare’s Chapter Data Editor.
Chapter 7: Conditions
Unlike FE7 the conditional check is in two parts.
- The first command writes a result to Slot 0xC e.g. CHECK_HARD will store 0(false) or 1(true) to Slot 0xC, while CHECK_MONEY stores your current Gold to Slot 0xC.
- The second command checks against the result in Slot 0xC.
- IFNE (conditionID) 0xC 0x0 compares slots 0xC and 0x0. Because Slot 0x0 is always 0, this means “If the previous command returned True…”
- You can also use IFEQ (equal), IFLT (less than), IFGE (greater or equal to) but remember you are comparing two slots, not a slot and a value.
The typical conditional will look something like:
CHECK_HARD IFNE 0x1 0xC 0x0 //Things that happen if Hard Mode GOTO 0x2 LABEL 0x1 //Things that happen if not Hard Mode LABEL 0x2
Here is a macro for the above:
#define IFTRUE(check,conditionid,iftrue,iffalse) "check; IFNE conditionid 0xC 0x0; CALL iftrue; ELSE conditionid+1; ENIF conditionid; CALL iffalse; ENIF conditionid+1"
Chapter 8: ASM Conditions/Effects
ASMC 0xCF461: Enables the use of the Guide for your project, if you want an area for lore or something related (this unlocks the whole guide, if you want to unlock it piece by piece you have to enable each entry manually).
ASMC 0x85375: Triggers a game over
Chapter 9: The World Map
Skipping over the world map:
- Disassemble the WM events from FE8 with the handy disassembler script (located in the scripts folder in the EA folder)
- There’s two WM events per chapter, WM Intro and WM1.
- For WM Intro: replace whatever code is in there with:
You can leave the offset the same since the new stuff is smaller than the old stuff, or you can point it somewhere else (though I’ve had issues when not using the original pointers).
- For WM1:
EVBIT_MODIFY 0x1 //Don't touch
WM_SPAWNLORD 0x0 0x0 0xYY 0xZZ 0x0 // WM_SPAWNLORD 0x0 0x0 0xYY 0xZZ 0x0 YY = main lord. ZZ = just completed chapter
WM_LOADLOCATION2 0x0 0xXX 0x0 //Silently and instantly load world map location. All three XX's should be the same. Remember that this XX should be the world map location offset and be the same location the chapter occurs in vanilla FE8
WM_SETDESTINATION 0x0 0xXX 0x0 //Sets WM destination
_0xA640 0x0 0x0 0xXX //sets your position to that place
As with the WM Intro event, you can keep the offset the same or change it to something else.
And the codes for the XX’s are as follows
0x00 Border Mulan
0x01 Castle Frelia
0x03 Borgo Ridge
0x04 Za'ha Woods
0x06 Adlas Plains
0x09 Port Kiris
0x0A Teraz Plateau
0x0B Caer Pelyn
0x0C Hamill Canyon
0x0D Jehanna Hall
0x0E Fort Rigwald
0x11 Za'albul Marsh
0x12 Grado Keep
0x13 Jehanna Hall
0x14 Renais Castle
0x15 Narube River
0x16 Neleras Peak
0x17 Rausten Court
0x18 Darkling Woods
0x19 Black Temple
0x1A Tower of Valni
0x1B Lagdou Ruins
0x1C Melkaen Coast
After you edit the events, just reassemble them in EA and you should be good to go!
Skipping the talk with Hayden after chapter 1
IFEQUAL 0x1 0xC 0x0
WM_LOADLOCATION2 0x0 0x0 0x0 //Might as well load Border Mulan here (optional)
WM_LOADLOCATION2 0x0 0x1 0x0 //Like CREATENEXTDESTINATION except silent and instant
WM_SETDESTINATION 0x0 0x1 0x0
_0xA640 0x0 0x0 0x01 //like MOVESPRITETO except silent and instant
Just make a new text file, copy that in, pick an offset for the second part, assemble it in EA, and that headache of a scene should be gone!
If you receive an error that says
File SkipHayden.txt, Line 5, Column 1: No code named GOTO_IFEF found. change it to CHECK_EVENTID
Manipulating the world map
A start for maipulating the world map can be found here.
Changing skirmish spawn locations and probabilities
There are 3 offsets of interest.
Skirmish Location Table - $206948
Eirika Mode Skirmish Probability Table - $206A48
Ephraim Mode Skirmish Probability Table - $206AAB
Chapter 10: Misc Info
Custom chapter titles
Chapter titles in FE8 are images and require a little more effort to get working compared to FE7, which is just straight text.
So, the easiest way to get your chapter titles in FE8 is to make the chapter title in FE7 and then do a few more things to get it in FE8.
Step 1: Make whatever your chapter title is supposed to be in FE8 in FE7 (using FEditor)
Step 2: Load up FE7 and get to this screen and pause the emulator:
Step 4: Find the right BG with the chapter title and click save and name it whatever you want and save it wherever you want.
Step 5: Open it in some sort of image editor (probably Usenti)
Step 6: Crop as little of the image as possible (try to just get the words for the title and a little extra room if you want) and save it as its own thing
Step 7: Open this template in Usenti
Step 8: Drop the chapter title in on top of the template in Usenti, match the background color of the pasted image with the color of the template (inkdropper on template background, then fill bucket on background of the title stuff).
Step 9: Save it (REMEMBER TO SAVE AS, NOT SAVE, SO YOU DON’T OVERWRITE THE TEMPLATE)
Step 10: Open the ROM in GBAGE, go to image controls and go to the chapter image you need to change (the chapter images should start at 1406/1407)
Step 11: Insert the image by clicking import a bitmap and make sure your checkboxes are the same as mine.
Step 12: Pick a new offset for the image in the event that the new title is bigger than the old one (you should pick a new offset anyway just to be safe).
Assuming all goes well, it should be inserted into the game now!
Remember to open up the ROM and make sure the image is aligned properly, if it’s not open it up in Usenti and move the title to where you think it should be to make it look centered. When you’re satisfied with where you moved it repeat the GBAGE insertion steps.
And if it’s still not lined up right, just keep repeating the process until it looks right in the ROM.
If this sounds like a huge pain in wherever, then don’t worry. Circles has got you covered. This ASM hack allows one to use text entries for titles like FE7. If you want to use pictures in your title cards or something, then the above method still exists.
Pay to Recruit Events
SETVAL 0x4 0x03E8 // this sets the amount of gold that must be paid (in this case, 03E8 in hex=1000) CHECK_MONEY //stores current gold to slot 0xC IFGE 0x0 0xC 0x4 // Do you have the money? Memory slot 0x4 has the money stored EVBIT_F 0x3 // unknown, but necessary Text(0x0B14) // this has a [Yes] command. Just use any text with a [Yes] command SETVAL 0x7 0x1 // Stores 0x1 (yes) to slot 7 IFEQ 0x1 0xC 0x7 // If Slot C matches Slot 7 SLOTS_ADD 0x32 // Slot 2 = Slot 3 (what was in slot 3??) SLOTS_ADD 0x43 // Slot 3 = Slot 4 (Slot 3 now = price) GIVETOSLOT3 // Give Item in slot 1 to char in slot 3?? UNKNOWN //CALL events that happen "if you have the money and you choose Yes". Better to include ENDB or things may screw up ELSE 0x2 ENIF 0x0 //CALL events that happen "if you don't have the amount of money." The Yes/No choice isn't even displayed. ENIF 0x1 //CALL events that happen "if you DO have the money, but you said No". ENIF 0x2 ENDA
GLOWING_CROSS charID STAL Time END_GLOWING_CROSS
Makes a glowing circle under the specific chracter for the specific amount of time
EARTHQUAKE_START 0x100 STAL Time EARTHQUAKE_END
Changing the 0x100 modifies the quake but for the best earthquake results you might as well leave it be so it looks nice.
So, FE8 is a bit weird with music transitions in text. In FE7, you’d simply use multiple text slots. In FE8; however, you use only one. Here is how you do it.
Start your text events like normal:
TEXTSTART TEXTSHOW textid TEXTEND
Next it gets a bit interesting.
To specify the music you want to change to, use the following events:
MUSC music TEXTCONT TEXTEND
If you want the music before the change to fade out a bit, use the following code before the music code:
_0x1322 0x7FFF TEXTCONT TEXTEND
Now, we’re not done yet, next comes the tricky part. What you need to do next is open up your text editor.
In your text slot you need to add in this code to the specific area you want the music to change:
So, in the end, your text slot should look something like this.
[OpenLeft] So... Mycen said no, did he?[.] What a shame.[.][A][X] [LoadOverworldFaces] [OpenRight] Wait!--[A][0x02] I'll join in my Gramp's place![.][A][X]
May i ask how to do this? I really don’t understand how to change the tilesets like Fort2 in FE8, what should i change? Sorry to trouble you
Changing tilesets in FE8 actually has very little (if anything) to do with eventing. Also this thread is super outdated.
If you hop on the FEU Discord server, you can get the help you need. Or just feel free to DM me if you’re using buildfiles. Can’t really help with FEB, though.
Unlisted/locked at OP’s request.