ff3:ff3us:tutorial:events:branch

This is an old revision of the document!


This section contains the most technical aspects of event hacking. So far, the game has executed our event scripts in a straight line. If the beginning of the event was at address CA/2000, the game would execute the byte at CA/2000, then the byte at CA/2001, then the byte at CA/2002, and so on. But sometimes, we may want the event to “jump” or “branch” from CA/2000 to CA/4000 (or some other address). There are several reasons why you may want to do this:

  • To reuse a part of the event script several times. For example, when the party rests at an Inn, the game will always fade out the screen, play the “Nighty Night” song, restore the party's HP, and fade in the screen. It would be wasteful to write “96 F2 30 31 05 09 E0 06 27 FF F0 B8 B2 BD CF 00 FA F3 10 31 82 09 FF 94 B3 03 FE C7 00 FE” inside every cutscene triggered by speaking to a shopkeeper. Instead, the developers placed that lengthy script at CA/00EA, and jumped to this address in the Inn cutscenes.
  • To skip over part of an event. If Cyan is in the party at the Imperial banquet, he will say an extra line of dialogue about General Leo. If he is not in the party, this part of the event must be skipped by the game.
  • To use extra space. If you expand the size of your ROM using FF3usME, you will need to jump to the additional space to use it.
  • To repeat part of an event many times (perhaps an infinite number of times).
  • ff3/ff3us/tutorial/events/branch.1514499061.txt.gz
  • Last modified: 5 years ago
  • (external edit)