And So It Begins...
by Blue Antoid

The year is 199X.
Onett, a small town in Eagleland
Ness's house

Soundlessly, it begins... then, the meteor falling from the sky, and the crash...

Huh? You know what? I don't want that in my hack. Not a bit. I'll bet more than a few of you have shared that sentiment at one time or another. ...but, such a thing like changing the beginning of the game isn't possible - is it? Oh yeah, it's possible. More so than you think, actually! There are lots of misconceptions and misunderstandings we've cleared up about the game's introduction in recent days. Now, I pass these discoveries on to you.

- All I want to do is change the text...

Okay, easy enough. To do this, you'll need a text editor and a table file to work with. Both are available on the PK Hack downloads page. There are two things we'll have to edit, so let's get to work!

* Another text system! -_-;
If you've ever worked with the main EB text system, you know about control codes - the letter and number combinations that float around the text, doing stuff. They can be a major hurdle for prospective hackers to face, simply because of how many there are. Well, guess what? In order to hack this text, you'll have to learn a COMPLETELY NEW text format! :D :D X| No worries, though, it's much easier than it might seem at first glance. First off, there are a handful of control codes you will find useful. Insert them into your text to achieve the following effects...

•[01 XX]: Move the text over a distance noted by XX.
•[02 XX]: Move the text down a distance noted by XX.
•[08 XX]: Print a main character name. Values are 01 - 04.
•[09]: Drop down one line.

See? Simple enough. So, let's write a quick sentence. Say, instead of "The year is 199X", we want "Bob likes tacos!" to appear in the lower right-hand corner. Hop in your hex editor and go to 0x210D86. This will take us to the very beginning of the line we want to edit.

[02 0C 01 32]The year is 199X[09 00 02]

So, to start, we have [02 0C], moving the text start point down the screen. Increase the XX value (0x0C) by 0x01, and it'll move down one line. A value of 0x00 will be at the top, and 0x18 will be at the bottom. 0x0C is dead-center. However, if you input a number that's too big, the text will wrap back around to the top.

Next up is the [01 32]. The values here are a bit more ambiguous. What you want to use for this depends partially on where you want your text to be aligned, and how long it is. It'll take a good bit of trial and error on your part to get it just how you want it. 0x60 will start your text about halfway across the screen, though. So, let's change the formatting bytes to get our text to the bottom-right. [18 01 7B] should do the trick... Then, simply rewrite the text with "Bob likes tacos!" (*Gasp* That takes up the same amount of space as the original text! How convenient! ^_^) Save those changes and check it out!

Congratulations, you've just finished hacking the text of one of the flyover arcs! :D But don't get too excited, there's a lot more that you can do than just this...

* But what if my text is longer or shorter than this?
This is something we just had to live with for a long time... but now you don't have to! :D So, how do you do this wondrous task of making text blocks bigger and better? Easy. Step 1 - write your blocks! For good measure, let's insert a couple more...

[02 18 01 7B]Bob likes tacos![09 00] <-- We have this already.
[02 02 01 00]No, I mean it. He's obsessed with 'em.[09 00]
[02 19 01 00]This isn't Bob's house.[09 00]

Obviously things are going to be a bit interesting now... heck, it even hangs over into the Winters flyover text. Hope you weren't planning to use that. :P Now, let's find out the addresses where each text block begins. Assuming you started at 0x210D86, the addresses should be:

#1 - 0x210D86
#2 - 0x210D9C
#3 - 0x210DC9

All right, so now we know where they are. So what, you might ask? Well, we're getting there. Hop over to 0x4A0A4. This block of code stores the addresses of these flyover text things. So, how do we change 'em? Easy! First, convert the adresses we have into SNES format! Open up a scientific calculator (you have one with Windows :P) and add 0xBFFE00 to all of the addresses. Then insert them into the ROM in reverse byte order.

#1 - 0x210D86 + 0xBFFE00 = 0xE10B86 = 86 0B E1 00
#2 - 0x210D9C + 0xBFFE00 = 0xE10B9C = 9C 0B E1 00
#3 - 0x210DC9 + 0xBFFE00 = 0xE10BC9 = C9 0B E1 00

The first two should look familiar - they're what's already there! That makes sense, though, considering the first block was the same size as the original (thus its starting point and the starting point of the next one remain the same). So, change the third pointer to our address, and voilá! Save your changes and enjoy the show.

- Going above and beyond...

Editing the text is great, but what if you didn't want to be in Onett at ALL in the beginning of the game? Or what if you wanted to do something completely different? Well, let's take a look and cover some of the more useful things you can do.

* The State of the Beginning Game
When the game starts, there are a few conditions that may affect how you construct your new intro sequence - some more important than others.

1) No event flags are set. Also, there is no way to set them prior to the beginning of the game - so, there's no way to immediately start with Onett in a state of daylight.
2) No people or items are present. Anywhere. At all. Only object-type TPT entries remain. This was one of the mysterious things that confused us for some time. However, we have isolated the toggling on of the other entries to one of the movement arcs in the flyover. (More on that later.)
3) Ness is the only member of your party.
4) Starting equipment and other stats are dependent upon a data table in the game.
5)

* Changing Starting Coordinates
To do this takes a tiny bit of work, but nothing you can't handle. For a start, we'll need to know where you want to begin the game. Specifically, we'll need the coordinates. Open up your map editor and use the seek function in the door destination editor to find out where you're going. Let's say, just for yuks, our coordinates are x:346 y:401. Now, take note - the coordinates the seek function gives are in an 8-pixels-per-unit format. However, starting coordinates are stored in 1-pixel-per-unit format! :o Easy enough, just go ahead and multiply your values by 8 each (and convert them to hex, of course).

X:346 * 8 = 2768 = 0xAD0 = D0 0A
Y:401 * 8 = 3208 = 0xC88 = 88 0C

Now that we have the coordinates, we can insert them into the game. The coordinates are stored at 0x2009A - first the Y coordinate, and then the X coordinate. Do not edit the A2 or A9 bytes, as these are part of the code that makes the game work... [A2 88 0C A9 D0 0A] is what you should come up with. Now, don't start anything yet! The game isn't going to like being somewhere else when it tries to sweep across Onett. Let's move on to some stuff that's a little more advanced.

* Reconstructing the Flyover itself
The flyover is a block of code chock full of movement craziness that we don't understand.