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 18:01]
lockirby2 [Starting an event]
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|}}
  • ff3/ff3us/tutorial/events/background.1525629701.txt.gz
  • Last modified: 5 years ago
  • (external edit)