ff3:ff3us:tutorial:events:background

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
ff3:ff3us:tutorial:events:background [2018/05/06 17:56]
lockirby2
ff3:ff3us:tutorial:events:background [2019/02/12 10:44] (current)
Line 28: Line 28:
 Before we begin anything else, let's talk about the number one thing that trips up the unaware.  A header is a chunk of $200 bytes that appears at the beginning of some SNES ROMs.  The keyword here is //some//; if you download a random FF6 ROM (whether it's version 1.0 or 1.1), it may or may not have a header.  You need to determine if the ROM is headered or not before you begin.  Open the ROM in HxD.  The ROM should look similar to one of {{ :ff3:ff3us:tutorial:events:unheadered_-vs._headered.png?linkonly |these images}}. Before we begin anything else, let's talk about the number one thing that trips up the unaware.  A header is a chunk of $200 bytes that appears at the beginning of some SNES ROMs.  The keyword here is //some//; if you download a random FF6 ROM (whether it's version 1.0 or 1.1), it may or may not have a header.  You need to determine if the ROM is headered or not before you begin.  Open the ROM in HxD.  The ROM should look similar to one of {{ :ff3:ff3us:tutorial:events:unheadered_-vs._headered.png?linkonly |these images}}.
  
-As you can see, the first $200 bytes of the ROM on the right are all zeros; this unnecessary data is the header.  Functionally, the two ROMs are identical.  The only reason why the header matters (for our purposes) is that it pushes all the data forward by $200 bytes.  This means that the game's data won't be where you expect it to be.  This problem could technically be remedied with some simple math, but it's easier to just use a ROM without a header.  You should either continue searching for ROMs until you find one without a header or remove the header by <doing X, I forget the best way to do this>.  As an aside, I also recommend using version 1.0 for hacking.+As you can see, the first $200 bytes of the ROM on the right are all zeros; this unnecessary data is the header.  Functionally, the two ROMs are identical.  The only reason why the header matters (for our purposes) is that it pushes all the data forward by $200 bytes.  This means that the game's data won't be where you expect it to be.  This problem could technically be remedied with some simple math, but it's easier to just use a ROM without a header.  You should either continue searching for ROMs until you find one without a header or remove the header (see the [[:hacking_faq|FAQ]]).  As an aside, I also recommend using version 1.0 for hacking.
  
 ==== Addresses ==== ==== Addresses ====
 If you open up the Event Script, you'll probably notice some values at the left side, such as CA/0000.  These are addresses.  Addresses are a way to uniquely identify any particular byte in the ROM.  Every byte in the ROM has its own address.  If we have looked in the event dump and found an event that we want to edit, we can use the address to find that event in the ROM data as well.  Take a look at CA/0010.  We see that the byte at CA/0010 is 4B.  4B happens to be the command that displays some dialogue.  The event dump also tells us that the dialogue that would be displayed is "Found <N> GP!" So this event is called by the game whenever you receive GP from a chest!  To be specific, this part of the event only controls the dialogue box, so it doesn't actually give the player any GP. If you open up the Event Script, you'll probably notice some values at the left side, such as CA/0000.  These are addresses.  Addresses are a way to uniquely identify any particular byte in the ROM.  Every byte in the ROM has its own address.  If we have looked in the event dump and found an event that we want to edit, we can use the address to find that event in the ROM data as well.  Take a look at CA/0010.  We see that the byte at CA/0010 is 4B.  4B happens to be the command that displays some dialogue.  The event dump also tells us that the dialogue that would be displayed is "Found <N> GP!" So this event is called by the game whenever you receive GP from a chest!  To be specific, this part of the event only controls the dialogue box, so it doesn't actually give the player any GP.
  
-Let's say that we want to modify this event.  That would be strange, but we'll pretend that's our goal for the sake of the example.  The first step would be to find the event in the game data.  Unfortunately, CA/0010 is not the address we need to search for in HxD.  <I don'know much about Hi-ROM offsets, so it's hard to give an explanation here>  Therefore, we need to search for the address A0010 instead.  You can go to an address in HxD by clicking on Search > Goto, or using the Ctrl-G keyboard shortcut.  Once we have reached A0010, we can see that the byte here is indeed 4B, so we are in the right place:+Let's say that we want to modify this event.  That would be strange, but we'll pretend that's our goal for the sake of the example.  The first step would be to find the event in the game data.  Unfortunately, CA/0010 is not the address we need to search for in HxD; you need to search for A0010 (remove the "C" at the beginning).  I don'have a full understanding of why you need to do this.  You can go to an address in HxD by clicking on Search > Goto, or using the Ctrl-G keyboard shortcut.  Once we have reached A0010, we can see that the byte here is indeed 4B, so we are in the right place:
  
 {{:ff3:ff3us:tutorial:events:address.png|}} {{:ff3:ff3us:tutorial:events:address.png|}}
Line 46: Line 46:
 An event will begin when you talk to an NPC.  You can find out which event will occur when you talk to an NPC by looking it up in FF6LE.  Open up the LE and select a map with some NPCs on it (for example, "Narshe, Outside (WOB)").  You will also need to click the red square at the top of the screen to make NPCs visible.  Now you can select an NPC and view its properties.  In particular, we can see the address of the event that the NPC calls.  Clicking on NPC 0 (the old man to the left of the weapon shop), we can see that the event he calls is at address 2D1EF. An event will begin when you talk to an NPC.  You can find out which event will occur when you talk to an NPC by looking it up in FF6LE.  Open up the LE and select a map with some NPCs on it (for example, "Narshe, Outside (WOB)").  You will also need to click the red square at the top of the screen to make NPCs visible.  Now you can select an NPC and view its properties.  In particular, we can see the address of the event that the NPC calls.  Clicking on NPC 0 (the old man to the left of the weapon shop), we can see that the event he calls is at address 2D1EF.
  
-{{:ff3:ff3us:tutorial:events:old_man_event.png|}}+{{ :ff3:ff3us:tutorial:events:old_man_event.png |}}
  
 Unfortunately, this address is not in the format that we want it to be in.  We need to add $CA0000 to convert the address from the way it appears in the LE to the way it appears in the Event Script.  In case you're wondering about the meaning of the $ sign, it indicates that a number is in hexadecimal (base-16).  You may find the Windows Calculator app (or your favorite alternative) to be handy for calculations like this if you set it to "Programmer" mode.  $2D1EF + $CA0000 = $CCD1EF, so we can find the old man's event at CC/D1EF in the Event Script.  As you may have guessed, this event just displays another dialogue box. Unfortunately, this address is not in the format that we want it to be in.  We need to add $CA0000 to convert the address from the way it appears in the LE to the way it appears in the Event Script.  In case you're wondering about the meaning of the $ sign, it indicates that a number is in hexadecimal (base-16).  You may find the Windows Calculator app (or your favorite alternative) to be handy for calculations like this if you set it to "Programmer" mode.  $2D1EF + $CA0000 = $CCD1EF, so we can find the old man's event at CC/D1EF in the Event Script.  As you may have guessed, this event just displays another dialogue box.
Line 52: Line 52:
 Another way to begin an event is by using an event tile.  In the LE, click the green square at the top to show event tiles.  When the party steps on one of these invisible tiles, an event will begin.  For example, when Terra steps on the green tile that you see on the bridge, it will trigger the cutscene where four guards look at her and shout "She's up there!"  If we click on the event tile, we can see that it calls the event at 2A279 (or CC/A279 in the Event Script). Another way to begin an event is by using an event tile.  In the LE, click the green square at the top to show event tiles.  When the party steps on one of these invisible tiles, an event will begin.  For example, when Terra steps on the green tile that you see on the bridge, it will trigger the cutscene where four guards look at her and shout "She's up there!"  If we click on the event tile, we can see that it calls the event at 2A279 (or CC/A279 in the Event Script).
  
-{{:ff3:ff3us:tutorial:events:bridge_event.png|}}+{{ :ff3:ff3us:tutorial:events:bridge_event.png |}}
  
 Finally, there's the entrance event.  Whenever you enter a map, an event is called to initialize the map.  This is necessary to initialize NPCs that walk on a fixed path, among other things.  Narshe's entrance event is shown to be at 2D0E7, or CC/D0E7.  If you're clever, you might notice that this entrance event affects 9 NPCs and opens the secret cave if the party has discovered it. Finally, there's the entrance event.  Whenever you enter a map, an event is called to initialize the map.  This is necessary to initialize NPCs that walk on a fixed path, among other things.  Narshe's entrance event is shown to be at 2D0E7, or CC/D0E7.  If you're clever, you might notice that this entrance event affects 9 NPCs and opens the secret cave if the party has discovered it.
  
-{{:ff3:ff3us:tutorial:events:entrance_event.png|}}+{{ :ff3:ff3us:tutorial:events:entrance_event.png |}}
  
 ==== Event Commands ==== ==== Event Commands ====
  • ff3/ff3us/tutorial/events/background.1525629387.txt.gz
  • Last modified: 5 years ago
  • (external edit)