Welcome, reader, to Arch's Really Long Event Tutorial. This is the second edition of my Chapter Construction tutorial adapted for Serenes Forest (where I can't abuse my admin powers and have 1 chapter per post). I figured I would bring this tutorial over here in hopes more people would be able to learn from it. Before we begin I do understand that my writing skills are lacking, I ask for your tolerance. This guide mostly revolves around using the Event Assembler to create chapters. This guide assumes you have a basic knowledge of Fire Emblem hacking. Please do not attempt to learn event editing as your first bit of FE hacking. Before attempting to dive straight into the guide you'll need the proper tools.
- Nintenlord's Event Assembler
- Nintenlord's .MAR Inserter
- A hex editor (I personally use HxD)
- Nightmare Modules
- Xeld's FE Editor or the Text Editing Suites (for text editing).
MapsBefore you can start coding events you'll need a map to place the events on. Mappy is the best way to accomplish this. When your masterpiece of a map is complete go to "File" and select "Export" and then put a check mark in the box marked "Map Array (?MAR)" and then press "Ok".
Now that we've got the .MAR file we use Nintenlord's .MAR Inserter. Open it up and fill out the required information. If your starting chapter hacking you should already know what an offset is. Open up your ROM and find some empty space (there's quite a bit in the 00D00000 area or you can make your own). When you've found the offset you wish to write the map to put it in the "offset" box. Make sure your map's dimensions are correct (mappy will tell you the dimensions of the map).
When your map is inserted it's time to put the finishing touches on. First off open up the Event Table Nightmare Module. Find the chapter who's map you wish to replace and replace the offset of the original map with the offset of yours. Your map is almost ready! The only thing left to do is to open up the Chapter Data Nightmare Module and fix the tileset. When the module is loaded select the proper tileset for the chapter to use.
Congratulations! Your map is all inserted and ready for coding!
If your thinking this is going to be easy like the map, then you are dead wrong! Event coding is a tricky process and you will often find yourself frustrated at the fact that errors are quite difficult to spot unless their major errors.
I, the author of this tutorial, am not responsible for any head-to-desk injuries that may result from event glitches.
I will be teaching you using the Event Assembler because that is the easiest way to make events.
So, the first step is to create a .txt file. Name it whatever you wish.
Now, the first thing you need to know are the main types of events. There are turn-based events, location-based events, character-based events and miscellaneous events.
We start out by inserting the following code at the very top of our event file.
You don't need to know what that does, Nintenlord is the only one who needs to know. All you need to know is that you need to have that line of code at the top of your file, got it?
Next hit the 'Enter' key at least twice (I prefer twice), and insert this next lil' item.
This is going to do something extraordinarily useful for us. This edits the event pointer table with a pointer to your new events. All you have to do is replace the ?? with an actual value. When picking a value I find it useful to reference Nintenlord's notes on the pointer table.
Just pick a value. I'll usually use the value of the chapter I'm overwriting. If I'm making the Prologue to a game I'll use 0x06 (Prologue Events). You can use any slot you want but for more basic hackers I'd recommend sticking to overwriting the value of the chapter you're using.
Alright, the next thing we need to do is create our POINs. POIN stands for pointer which points to some data. In FE7 there are 16 starting POINs which each must go in a correct order. The first POIN points to your turn events. The second to your character events, the third to location events and the fourth to miscellaneous events. the 5th and 6th point to ballista data for normal and hard modes. 7-10 point to enemy data for all four modes (Eliwood Normal, Eliwood Hard, Hector Normal, Hector Hard) while 11-14 point to ally data for all four modes. 15 is your opening event and 16 is your closing event.
Now, this is all quite a lot to remember. It took me quite a while to memorize this. What really helped me to memorize it is this template I made. This has all the POINs sorted and labeled for you.
Now, your probably wondering "Turn_events? Opening_event? What does this mean?" Well, you see. ____ points to a specified event. 'Character_events' points to another location in the file labeled 'Character_events.' This method saves a lot of hassle as before you had to make all the character events and then handle the offset in the POIN table. Now all you have to do is label something and your good to go!
Another important concept I need to cover is how to specify where to write the data into the game. With old versions of the assembler you just filled in a box and that was it, however, Nintenlord thought it'd be more beneficial to specify it within the file. In that POIN template I posted above before the POINs there is another piece of code.
org 0x????????This specifies where you are writing your events. Just plug in a pointer. Use any space you want, I recommend using the free space which begins around D80000.
There is a template included in the Event Assembler download. For convenience I'll post it below. It has the basic setup for your event file.
This template not only includes the POINs but also the labels. Just follow the instructions in the template and you'll be well off!
Something worth noting, you can make comments in your event files. "//" is the code for the assembler to stop reading for the rest of that line. You can type anything after a "//" and it won't effect your events at all (very useful for noting where you put things).
Now that we have our setup I'll move on to teaching you some basics about making the events themselves.
Something you need to be wary of are the ENDA and ENDB commands. You put ENDA at the end of any event. ENDB is used in opening events of chapters that use the preparations screen.
The most basic scenic event you will need to know is how to load text. The basic text loading code is
TEX1 (Index of text)What's in parenthesis will be replaced by the value you need. The text index # is something you'll need to find on your own with the parser or FEditor.
But hey! What's a good conversation without a little music?
MUS1 (Value of song)
Now, when the little conversation is over you'll need to have a REMA command to clear the map of unwanted face sprites. You use this command anytime you load text and a background. You will also use the MUEN command to fade out music.
MUEN (value of fadeout, recommended 0x05)
Here is an example of a conversation
@Conversation1 MUS1 0x0076 TEX1 0x000008 MUEN 0x05 REMA ENDA
You can also use background for text.
BACG (Value of background)
Now, just instantaneously loading a background doesn't look good. For this we use the FADI and FADU to fade-in and fade-out respectively.
FADI (value of fade-in, recommended 0x10)
FADU (value of fade-in, recommended 0x10)
However, there is a quicker method. Thanks to Nintenlord's macros.
Text(background,text)This is the same thing as
FADI 0x10 BACG background FADU 0x10 TEX1 text REMA
Sometimes multiple conversations will take place back to back. If you want to change the background smoothly you can use this macro.
ChangeBackground(background)This would not be good to use with the Text(background,text) macro since that macro returns to the map.
A plain conversation is all fine and good but there are several things you can do with this conversation to make it a little more rewarding.
One thing we could do is give one of our units an item for initiating the conversation.
ITGV (Character to give to) (Item received)
A little bit of gold couldn't hurt...
MONE 0x00 (Amount)For that first parameter, your options are 0x00 (Village) or 0x01 (Cutscene). I don't know any more than that.
Oh hey, maybe even a recruitment conversation!
CUSI (character) (alliance)For the alliance $00 makes the character an ally, $57 makes the character and NPC, and $A7 makes the character an enemy.
There are all sorts of fun things you can make with events, however conversations is only one part of it. You can also play around with things on the map.
Like forcibly moving units.
MOVE (unit) (coordinates) - Co-ordinates are in this format [XX,YY]. Always have 2 digits for good measure (for example use 06 instead of 6) - The unit MUST be on the map to make this work. If the unit isn't it can cause all sorts of glitches.
Of course, sometimes you just want somebody to disappear.
Making units for your chapters is really quite simple. Anyone familiar with the Chapter Unit Editor nightmare modules will get this really fast.
UNIT (Unit value) (Class) (Leader) (Starting Level) (Loading Coordinates, [XX,YY]) (Starting Coordinates, [XX,YY]) [(Item1),(Item2),(Item3),(Item4)] [(AI byte1),(AI byte2),(AI byte3),(AI byte4)]
- The unit value is the unit's hex number. For instance if I wanted to load Eliwood then I would use 0x01. The unit's class is also a hex value. These hex values can be replaced with defined variables (shown below).
- The loading coordinates are where the unit is loaded, after being loaded the unit will move to its starting coordinates. For non-moving units just set both coordinates to be the same.
- The unit's leader is not of much importance, however I suppose you could put it in.
- Starting level is in hex, the values are a little funky so I have a list for you.
But, thanks to Nintenlord, there is a much more convenient way to do enemy levels. Instead of a hex value, use the following code.
For 'side' put either Ally, NPC or Enemy. For 'autolevel?' it will be either True of False. 'level' will be the numerical value of the level.
As you may have noticed there are two sets of coordinates. The loading coordinates are where the unit is loaded onto the map. Once loaded, a unit will move to the specified starting coordinates.
Then comes the unit's inventory, all values are once again in hex. If you don't want to use an inventory slot just use 0x00 to specify that there's no item in that slot. However, you cannot have a 0x00 followed by an item. If you do then your game will crash and...well... your ears will heart...
And now the finishing touch is the unit's artificial intelligence. It comes in four bytes.
And while we're on the topic of AI, I'd like to give you guys a list of AI combinations. AI combinations are combinations of AI bytes that create a desired effect.
You must create units in groups. The unit group will be loaded together so keep that in mind when grouping them together. A unit group must begin with the following:
(Unit group name): UNIT........
The name can be anything you choose. You end a group of units with:
Without the above code the game would keep loading data. For the game that code separates groups. The game only knows to stop loading when it reaches the end of a group.
Once you've got your units all created you're going to need to get them onto the map. The command to load units is:
LOU1 (Name of unit group) ENUNAlways place the ENUN code after loading or moving units.
For an example I'll show you guys a unit group from FE4A.
Chalphy: UNIT Sigurd Knight_lord 0x00 Level(5,Ally,False) [34,09] [34,12] [Iron_sword,Iron_lance]  UNIT Alec Cavalier Sigurd Level(2,Ally,False) [34,09] [35,11] [Iron_sword,Vulnerary]  UNIT Noish Cavalier Sigurd Level(3,Ally,False) [34,09] [33,11] [Steel_sword]  UNIT Empty
Did you notice that instead of using hex values I used actual names? This is an advanced feature of the assembler that I will cover that in the next section.
You can load an infinite number of groups with one LOU1 command. However, four per LOU1 is strongly recommended for the readability of your events.
LOU1 Group1 Group2 Group3 Group4When loading more than four groups just make a new LOU1 command below and continue. Remember to put ENUN once all your unit groups are loaded!
Recall a few chapters back, when instructing you on building the structure for your events, I told you to include this in your file always.
That file comes with the Event Assembler. It contains a plethora of macros and definitions for you to use. It contains a lot of data you don't really need, but there are some gems for ordinary non-Super Genius people like us. The definitions are what I'm looking at. Nintenlord has been nice enough to provide some default definitions for us. He has defined every item, character and class for all three games. Now, this is fine and dandy but being restricted to the definitions for the GBA games limits our ability to be creative. So I'm going to show you how to make your own definitions file.
Make a new .txt file, name it whatever you desire. For the purposes of this tutorial I will be demonstrating with 'definitions.txt'
Open up your newly created text file, it is (hopefully) blank.
The to make the definitions we need to write the following code.
#define (name) (value)
The name is the word you want to define and the value is the value in hex. Here's a sample from my 'FE4A_definitions.txt' file.
#define Sigurd 0x03
Now you can define until your face turns blue. But all that defining is rather useless when you can't use the definitions! So now you need to learn how to use them in your events. Just insert this into your events underneath "#include EAstdlib.event".
#include "(file name)"
For my example I will be using definitions.txt.
Remember, the file can be named whatever you like. Have fun defining! It makes the life of an event maker much MUCH easier.
Now that we've got a strong hold on the basic setup and the things that makeup the events themselves, it's time to start working on our types of events. This lesson will focus on location based events.
Now, before we get started into location events there is a very important concept I need to go over. This concept is the event number. Each even that is placed in one of the four types is labeled with an event number. Each event must have a different number than another event in the event file. Unless you want to have a "pick your poison" type of event. You could...oh say give two recruitment conversations the same event number. You recruit one of the characters but then you cannot recruit the other (like Johan and Johalva in FE4). It is reccomended that you put your event number in hex instead of a normal number (a.k.a. 0x05 instead of 05).
And now unto the location events! The most common location event I find myself using is the village event, which goes something like this...
Village(event#,nameofevent,x-coordinate,y-coordinate)The nameofevent works exactly the same as referencing a unit group.
Here's an example for you.
In addition to villages, we also have houses which can be revisited.
House(event#,nameofevent,x-coordinate,y-coordinate)Very similar to the setup for a village.
Now, another one that gets a lot of use from me is the seize command.
Seize(event#,nameofevent,x-coordinate,y-coordinate)As you should notice it follows the same basic setup as a village event. You can not include the nameofevent, which will result in it simply loading the event specified as the ending event. That would look like this:
Another fun location event is a Treasure Chest. There are two different formats you can use for a chest event. A chest where you get an item or a chest where you get money.
Chest(item,X-coordinate,Y-coordinate) ChestMoney(amountOfMoney,X-coordinate,Y-coordinate)Its as simple as that!
Now comes the door event.
And the last major location event I'll be teaching is the shop event.
Now, this one differs a bit. The pointer to the shop data will not be within the event file. And so, you have to use a pointer you make yourself to point to. For example I put my shop data at 0xD80000, my code would look like this.
There are multiple types of shops in the game. For an item shop replace 'Armory' with 'Vendor', for a Secret Shop replace 'Armory' with 'SecretShop'.
However, there is (of course) a way to do this in the assembler. You start off with an ID (@____ for you slow learners out there) and then use the code
You can have as many items as you want, put them hex values or defined variables. For example...
SHLI 0x01 0x02 0x03 0x04 0x05
SHLI IronSword SlimSword SteelSword SilverSword IronBlade
Character EventsOne of my favorite event types, character events. Now, character events are 'Talk' commands on the battlefield. Selecting the 'Talk' command initiates a conversation between the characters (something I've used a lot in FE4 Advance). Here's the format for a basic character event
CHAR (event#) (name of event) (initiating char) (receiving char) (condition)
Some of this should look familiar. Event number is still the same thing and the pointer works exactly the same. What's new here are the initiating and receiving characters. The initiating character, when moved next to the receiving character, has the 'Talk' command. The receiving character only receives the conversation, he/she can never initiate it. Pretty simple, right? The biggest new thing is condition. Just ignore that for now (you can use $0000000 for where the condition is supposed to be) as conditions will be covered in a later lesson.
This piece of code goes in the "Character_events" part of the POINs. Just place it under "Character_events:" and you're good to go. Remember to end that section with $00000000!
Here's an example from FE4A:
This is the Character_events table. It contains all my character events. The bolded character event is used in an example below.
CHAR 0x0E Alvis_and_Sigurd Alvis Sigurd 0x00
CHAR 0x0E Alvis_and_Sigurd Sigurd Alvis 0x00
CHAR 0x13 Alec_and_Ethlin Alec Ethlin 0x00
CHAR 0x0F Sigurd_and_Ethlin Ethlin Sigurd 0x00
CHAR 0x10 Lex_and_Sigurd Lex Sigurd 0x00
CHAR 0x10 Azel_and_Sigurd Sigurd Azel 0x00
CHAR 0x11 Cuan_and_Sigurd Cuan Sigurd 0x00
CHAR 0x11 Cuan_and_Sigurd Sigurd Cuan 0x00
MUS1 0x3D //line 338
The basic format for turn events is:
TURN (event#) (name of event) [starting turn,ending turn] (phase) 0x00
This looks somewhat familiar, right? I hope you're starting to get the concept of (event#) and (name of event). If you aren't I strongly suggest becoming familiar with those concepts before advancing further in the tutorial.
For (event#) you will almost always use 0. Turn events cannot repeat, therefore you should use 0.
Starting turn is the turn the event starts on. Ending turn is the turn the events end on. If you want the event to last 1 turn then have both values be the same. If you want it to span multiple turns (useful for reinforcements) then make them different values.
The phase is determined by 3 values only. 0x00 denotes Player Phase. 0x08 denotes Enemy Phase. 0x16(?) denotes Neutral Phase.
Here's my example. 5 turns of enemy reinforcements would be:
TURN 0 Reinforcements [10,15] 0x08 0x00
Reinforcements: LOU1 Reinfocement_units ENUN ENDA
This turn event starts on turn 10 and ends on turn 15, providing 5 turns of enemy reinforcements.
The TURN command goes under the "Turn_events" section of your file. Here's an example of my Turn_events section from Chapter 1 of FE4A.
TURN 0 Turn_twenty_five [30,00] 0x00 0x00 //Turn 25 Event (marks Ch. 1x)
TURN 0 Turn_two [02,00] 0x00 0x00 //Jamka and Eden event
TURN 0 Reinforcements [10,10] 0x08 0x00 //Reinforcements event
TURN 0 Opening_event [01,00] 0x00 0x00 //Opening event
An important thing to note: I included my opening event in the Turn_events area. Why did I do this if Opening Event is already specified with the POINs? My Chapter 1 does not utilize the Preparations Screen. For chapters that do not use the Prep Screen you must include the opening event in the Turn_events area. For your opening event is must start before the Player's Phase of Turn 1.
BallistaePrepare yourself to tackle the shortest lesson of this tutorial. This one is even smaller than the last. Ballistae events look like this:
BLST (coordinates) (type)
The types are
34 = Normal Ballista 35 = Iron Ballista 36 = Killer Ballista
And coordinates work the same as they always do. Just make sure all your Ballista events are under the "Ballista:" section and you're good to go.
A list of BLST events should end in BLST (with nothing else written).
BLST [01,05] 34 BLST [01,06] 35 BLST [01,04] 35 BLST ALIGN 4 CODE $00
Notice something else, I used ALIGN 4. I strongly recommend putting this at the end of your Ballista lists under the blank BLST. It helps keep the data aligned properly, which means less headaches for you!
Misc. EventsNow, misc. events are tricky little guys. They don't follow any particular pattern or event do the same thing. One command is completely different from another.
The most common Misc. event is the Game Over command, which allows you to be defeated.
Then another common one is the area event, like the hidden treasure in the desert.
AREA (event number) (name of event) (starting coordinate) (ending coordinate)
Starting coordinate and ending coordinate are the only new things. The two sets of coordinates together create a range where the area event can happen. If you want it to be only one tile on the map then just have the two sets of coordinates the same. I compared this event to the desert chapters. However it doesn't automatically base the activation rate off luck unless you specify it (which will be covered in the lesson on conditions).
Another commonly used one is the command for Route missions
DefeatAll(name of ending event)
And then there's the command for missions where you must kill the boss.
DefeatBoss(name of ending event)
And that's all there is to know. Here's an example of a Misc_events area.
AREA 0x26 Marpha_siezed [26,24] [26,27] //Game over if castle siezed command
TextI'm not going to spend much time on text. Consider this a mini-chapter. There are already tutorials that teach text editing so its a a waste of time to make another for this tutorial.
I personally still use Darktwiliktri's Text Editing Suite for text editing, however, any method will produce the same results. Here's the basic rundown with the Text Editing Suite. In FE7 all the in-game conversations start at 0x0815, you can just start there. (that's the pointer you'd use for TEX1) The easiest way to insert text is to just go from that pointer onward (0x0816, 0x0817, etc.) and then play your chapter to find out what that text slot actually contains. Then find the text in the alltext file and edit to your heart's content.
When using Xeld's FEditor Adv there's an easier way. In the index selection reel type in 815 and that will land you at the first text slot in the game. The numbers in the index selection are the digits for the offset; text slot 815 will be 0x0815. 450 would be 0x0450. Get the picture?
Alright, this is where we can add depth to our events.
If you'll remember, with the character events there was a slot for conditions. The only condition usable for character events is making the event only happen after another event has occurred.
00XX0003 XX = Event number
Now, that one teeny tiny taste of conditions. It is nothing compared to what will be covered in this chapter.
Alright, our first major concept for this chapter is the condition number. The condition number is the number of the condition. It's the same idea as event numbers. No two conditions should have the same condition number.
Lets start learning conditions by learning a condition. Fantastic idea, no? We'll start with one of my personal favorites, the "if certain character" condition.
IFCA (Condition number) (Character)
Now, lets get an event. To save myself some time I'll take on from my hack, Fire Emblem 4 Advance.
This is when Lex gets his Hero Axe from the lady of the lake (who looks suspiciously similar to Queen Rahna of Silesia but that's another problem for another day).
TEX1 0x0949 REMA ITGV 0x2C 0x22 ENDA
Now, I'm obviously going to add a condition which makes it so this only happens when Lex (0x2C) steps on the tile.
IFCA 0x01 0x2C TEX1 0x0949 REMA ITGV 0x2C 0x22 ENDA
But wait... slight problem. What if someone ELSE steps on the tile? Well, the event will still go off which means the event won't happen for Lex if he steps on the tile after the other unit because the event was set to off mode. Well, first off we need to specify what happens when another character steps on the tile. We use the "ELSE" command for this one. There's nothing fancy attatched to this code. Then under ELSE we say what we want to happen. In my case I want to reset the even number so if a unit other than Lex steps on the tile, the event will still happen for Lex.
I do this with this little baby.
ENUT (EVent #)
Of course, you could always do the opposite and disable an event if something happens.
ENUF (Event #)
And my end result should come out looking like this.
IFCA 0x01 0x2C TEX1 0x0949 REMA ITGV 0x2C 0x22 ENDA ELSE 0x02 ENUT 0x17 ENDA
But wait! It seems I've forgotten something... what could it be? Bah... I just can't... AHA!!! ENIF!!! You must be going "wtf?" but we need to include the something called the ENIF command. ENIF stands for "ENd of IF statement". Basically, when all your possible conditions are done you put an ENIF there and then follow it up with ELSE.
So, the correct code for Lex's Brave Axe is.
IFCA 0x01 Lex TEX1 0x0949 REMA ITGV 0x2C 0x22 ENDA ELSE 0x02 ENIF 0x01 ENUT 0x17 ENDA ENIF 0x02
Now, there are many conditions you could attach to an event.
If certain turn. Like in FE6, to reach a Gaiden chapter you had to complete the chapter before a certain turn.
IFTU (condition number) (turn)
If a character is dead is another popular one. Say I kill off a character that has a line later in the game. Can't have him come back from the dead for his line now can we?
IFCD (condition number) (character to be dead)
If you bring a character into a battle and want to throw them a line make sure you use this one which checks if the unit is fielded or not. (like how Guy complains he's seasick on the Pirate Ship chapter)
IFUF (condition #) (unit)
Another one is having the game check to see if a certain event happened.
IFEV 0xII 0xVV
There's also a way to make an event dependant on a Yes/No choice given to the player. (like choosing to go on a sidequest)
IFYN (condition #)
Now, the actual Yes/No option is created in the text with
And then there's the most dreaded condition of all. The Tutorial Mode condition. Yes, this one four letter command is responsible for all those boring tutorials you have to sit through. That four letter command is...
IFTT (condition number)
And while we're checking modes, here's one that checks if you're in Eliwood's Mode or not. Personally I found if odd that the programmers chose to base mode events off whether it was Eliwood's mode or not since Hector's mode is the one with the bonus content but whatever...
IFEM (condition #)
Congratulations, if you understood all that you have officially risen beyond the rank of chapter making noob! Give yourself a pat on the back and brace yourself for the next chapter.
Alright, we've got most of our stuff down. These are events I've dubbed "In-Chapter Events" because they are best used during a battle. But, you can use them in any scene.
The first one I'll cover is weather. You can change the weather mid-chapter with this baby.
And what kind of tutor would I be without providing you with a list of possible weather effects and the value to imput to get them?
And then there's the ever-so-popular Fog of War.
VCBF (vision distance) //black fog VCWF (vision distance) //white fog
The default vision distance in FE7 is __. If you want to disable Fog of War at a later time then just enter the code again and have your value as 0x00.
Now, for what is probably the most important one, the command to end the chapter and move unto the next.
MNCH (chapter number of next chapter)
You can change the AI of a unit in the middle of a chapter with
CHAI (character) $(AI Code)The AI commands are located in the unit making chapter.
More Scenic Events
We covered scenic events in the beginning. However we only scratched the surface. I wanted to ease you into events so I left out the extra stuff for later.
Now, here's a code that I admit I just plain forgot about. It makes the cursor flash on a tile.
Another one that I just plain forgot about is the ability to make a unit reappear after disappearing.
So, now that we've gotten past all the things I forgot about. The first topic I'd like to cover in this chapter is music. There's more than just loading music you know.
First there are sound effects which are loaded with
SOUN (sound effect)
And then there's volume control codes.
MUSI //makes music more silent MUNO //makes music normal after MUSI
They have no parameters.
Now, the next topic is move events. We already covered the basic move event but there are quite a few variations.
The first variation is move to a character.
MOVE (character) [1,2]
At the end of a MOVE code you can also add the speed the character is moving at.
MOVE 0x03 [1,2] 0x01
And then there's the ever so popular fight sequence.
FIGH (attacker) (defender) (pointer to fight) $00000000
The fight code works like this.
CODE $XX000000 Normal attack command. XX = Damage CODE $XX000001 Critical command. XX = Damage CODE $XX000002 Attack but miss. XX = Damage CODE $XX000040 Attack that poisons. XX = Damage CODE $XX008000 Instant kill (damage does not matter). XX = Damage CODE $00800000 End the battle sequence. NOTE: These commands were created for the attacking character by default. To make a defending character attack replace the second pair of numbers with 08. For example instead of $XX000000 for an attack I would use $XX080000 to have the defender attack.
The damage needs to be in hex. As an example.
CODE $20000000 CODE $00800000
The attacker attacks for 32 damage and then the battle ends. Now, you only get one attack per fight sequence. If you want the person attacked to counter you need to create another FIGH event and swap the attacker and defender.
Now, say you want a healing event. Create a FIGH event between two allies and do a normal attack command. For the damage FF = -1, FE = -2 and so on and so forth. This trend goes all the way down to 80 which is -123.
After the fight is finished, you may need to kill the loser right? Well, this little code takes care of that.
KILL (character) //kills a certain character KILL (coordinates) //kills a character on a tile
Now, a fight sequence can occur between any two units, their alliance (Ally, Enemy or Neutral) does not matter.
So there we have it. Now that you've finished this chapter you officially know how to do anything you could ever want to do in a chapter. Give yourself a pat on the back.
FE8 differencesThis tutorial has been dealing with FE7's events. Since FE7 is the most popular game for hacking I figured it would be advantageous to do so. Out of the three games, FE8 is definitely the oddball of the trio.
In FE8, ENDB doesn't exist. Instead you must use
GotoPrepScreenThis ends the event and sends you to the Prep Screen.
In FE8, the commands regarding the cursor are also different.
FlashCursor(X,Y,time)This flashes the cursor on a specific tile.
FlashCursor(character,time)This flashes the cursor on a specific character.
For both commands the recommended time is 60 (the same time it takes for a cursor flash in FE6 or FE7)
FE8 also structures the UNIT command differently.
UNIT (Unit value) (Class) (Leader) (Starting Level) (Coordinates, [XX,YY]) (Flags) (Byte1) (Amount) (Reinforcement pointer) [(Item1),(Item2),(Item3),(Item4)] [(AI byte1)(AI byte2)(AI byte3)(AI byte4)]The difference is the added information for the units. 'Flags' have various uses which are, as of yet, largely unexplored. We do know that 2 makes the last item dropable. 'Byte1' is mysterious also, we do not know its function. Most units, however, simply have 0x00 as 'Byte1.' Now, I'm going to be honest; I couldn't teach you about 'Amount' and 'Reinforcement pointer.' FE8 events are not my forte. I'm looking to add more information on this later, if anyone can help me it would be greatly appreciated. Basically the Reinforcement pointer points to an event which moves the unit after they are loaded. This works similarly to FE7's loading and starting coordinates.
A Reinforcement Pointer event would be structured like this:
REDA [X,Y] (Speed) (Rescuing character) (Delay before executing)Coordinates work as they normally would, the unit will move to those coordinates. 'Delay before executing' can be any numerical value. The higher the number the longer the delay. The rescuing character is the ID of the unit the character would rescue when moving. It can be left as 0x00 if you don't want the unit to rescue anybody when performing this event.
Also regarding units, FE8 has a different way of changing a unit's alliance. Instead of one command we have three.
CUSA (character) //to ally (blue) CUSE (character) //to enemy (red) CUSN (character) //to neutral (green)
FE8's text also works differently. In FE7 you would just use this.
TEX1 (text) REMAHowever, FE8 requires something else to be added.
TEX1 (text) GOTO $9EE310 REMA
One of the biggest differences is how POINs are structured.
POIN TurnBasedEvents POIN CharacterBasedEvents POIN LocationBasedEvents POIN MiscBasedEvents POIN Dunno Dunno Dunno POIN Tutorial POIN Ballisa1 Ballista2 POIN Units1 Units1 POIN $0 $0 $0 $0 $0 $0 POIN BeginningScene EndingScene
FE6 differencesFE6's events are largely similar to FE7's. The biggest difference is the POINs.
POIN TurnBasedEvents POIN CharacterBasedEvents POIN LocationBasedEvents POIN MiscBasedEvents POIN EnemyUnits AllyUnits POIN EndingScene
You'll notice that there is no pointed to an opening event. Opening events are always handled as a turn event occurring before the Player's Phase of Turn 1. For example:
TURN 0x0 Opening_event [1,0] 0x0This is the Opening event of FE6's Chapter 1.
The Final BattleWith the knowledge of making events obtained, there remains one final challenge. Luckily, like Idoun in FE6, the final challenge is relatively easy. If, however, you are using this code:
org 0xC9C9C8+(4*0x??) //FE7 org 0xB363C+(4*0x??) //FE8
you don't need to read the rest of this chapter! Instead, just use the two lists I included with spoilers, pick a slot, then assemble the events. However, if for some reason you don't want to do that, here's how one would do it manually. You will probably want to read this so you can point to maps (since we don't have a super easy way to do that yet).
Since we already know how to insert maps and events we'll need to get the offsets where they were written. Make sure that you keep track of where a piece of data ends so that you don't accidentally overwrite it later on down the road. As an example my events are written at 0xD80000 and my map is at 0xDA0000. Now, this is the part that requires us to open up a Hex Editor. Now, the event pointer table (a table which pointes to all the events/maps/tilesets in the ROM) is where we need to go. That table starts at offset 00C9C9CC so use the Goto function of your hex editor and type in that offset. Now, what you'll see if a bunch of numbers, these numbers are pointers which point to various things in the game.
Nintenlord made excellent documentation of the C9C9CC table.
What his list references as 0x__ is the number on the pointer. Each pointer is ended by 08. So, what he calls 0x01 is 4C C7 34 08, all you have to do is count pointers to end up in the right spot.
For FE8 the table starts at B363C.
Now, pointers are written in little endian. For those of you who aren't vocabulary savvy (like myself) it basically means that the bytes are reversed. So, my offset for my events is written at 00D80000. In little endian the offset would be 00 00 D8 08. However there's something wrong with that pointer. Every pointer MUST end with a 08. The only exception to this rule is when you expand your ROM past 00FFFFFF in which case you must use 09 to end your offsets. If you do not use 08 or 09 when necessary nothing will work!
So, by counting offsets I've discovered that 20 07 CA 08 is the pointer to the prologue's events in the original game. So, by replacing that with 00 00 D8 08 I successfully point to my new events. The same method applies for maps. Now, when your map is inserted open up the Chapter Data Editor in Nightmare. Go to the correct chapter and alter the Tileset and Tile Palette to get the map looking like it should and your chapter is completely done.
And now, load up your ROM and enjoy the hard work that went into making your custom chapter. You've earned it. Congratulations for completing this tutorial! Now you know how to do anything you could ever possibly want to in a custom chapter so get out there and start making your hacks and showing off your skills! Feedback on this tutorial is greatly appreciated. Were there things that I wasn't clear on? Are there chapters which could be been improved? And if so how? Feedback helps me make the tutorial better for future readers so they won't have to go through the confusion you did and less confusion = more learning. Please PM/IM (my addresses are on my profile page) me your feedback as this topic will be locked.
ConclusionCongratulations, reader, for completing this tutorial. You now know how to do most anything you could ever want in a custom chapter. So get out there and start making your hacks and showing off your skills! Feedback on this tutorial is greatly appreciated. Were there things that I wasn't clear on? Are there chapters which could be been improved? And if so, how? Feedback helps me make the tutorial better for future readers so they won't have to go through the confusion you did, less confusion = more learning. Please post your feedback here.
Edited by General Archibald, 02 July 2010 - 10:25 PM.