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
Next revision Both sides next revision
ff3:ff3us:tutorial:events:background [2018/05/06 17:56]
lockirby2
ff3:ff3us:tutorial:events:background [2018/05/06 18:25]
lockirby2 Added link to the FAQ to help people remove the header.
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 ====
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.txt
  • Last modified: 5 years ago
  • (external edit)