• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Research: (Eventual) complete map of the Script area and beyond of Leaf Green.

Nerketur

PokéScripter
104
Posts
13
Years
Changes (As of 4/13//2011)
  • Added an observation and theory, and a note
Well, I haven't updated this in a while, but I wanted to mention an update is coming by the end of this week. School has severely limited my time for this, but now that school is nearing completion, I'm getting more and more free time. While most of it will be for playing Pokémon Black, I will start updating this more regularly, once a month at minimum. I apologize for inactivity. I'm not going to let this die.

I've been thinking a lot about how I should post this, and I decided to just give an outline of what I've found so far, and then give my theories.

As a note, this is all for Leaf Green, English, not sure what version.
What I've found:
The scripts are organized in pretty much a standard way,. all the scripts are organized by where they are in the map for that bank. I haven't found any real correlation between the position of the OW sprite, and the script... but all scripts for a particular map are generally together. All (basic) text is found after all the (basic) scripts.

The spoiler contains an outline of what I've found so far, including offsets at the breaks, and labels of how I think it's organized. (I could have gone deeper, but haven't been able to because of school)

Spoiler:


All of these gave me a general idea of how the data is organized. First of all, for each map, the scripts generally come in the order:

  1. Level script (Should be "map" script, in my opinion)
  2. Person (ANYTHING non-trainer)
  3. Sign/Script (Not sure of the order of these just yet)
  4. Trainer (All trainers)
Those random Pokéballs are found somewhere else, as are all the "special" people (the ones that ask about Gym Leaders, and possibly others) Anything that goes with a certain script is compiled after that script. (See Mt. Moon (1, 3) for an example.)

This gives me a few theories, and a few observations.

Observations (Last Update: 4/13/2011):

  • All Wifi items, scripts, and maps are compiled individually.
  • Strings are compiled separate from game code
  • Shared movements are compiled in a separate location.
  • Wifi portion isn't as "organized" as the rest of the game. The scripts are not quite made in order of map numbers.
  • Seems to have three separate sections: "Main", "Wifi", and "Items"
  • It's almost as if the Wifi portion was compiled in "sections", but these sections are hard to figure out. Wifi is certainly the most convoluted.
  • After playing through and beating Pokémon Black, I'm starting to realize a few things. GameFreak LOVES to re-use code.

Theories (Last Update: 4/13/2011):

  • They added all the random items after making the basic story and main game.
  • Wifi was added at the last minute, whereas, the main game was pre-organized.
    • This makes sense, if you consider the fact it's a remake of the RBY era, just with added stuff
  • The added items (Items after the main scripts, but before the Wifi area) were added also at the last minute.
  • They didn't care for optimization, just ease of coding. Which leads me to believe they, too, used a compiler, but not with "Pokéscript". I believe GameFreak actually had a compiler for all the scripts. One they made themselves, perhaps. I may attempt to make one.
  • I am now CERTAIN they use a compiler. If there is anyone willing to help me create one, please contact me.
 
Last edited:

TheDarkShark

Metal Headed Hacker
56
Posts
13
Years
Seems to be useful. What about giving offsets (where exactly is the Script Area)? I wanna port the offsets to a German Rom, but just by looking on the events tab it is hard to locate the script area. (Sounds odd? I know, but porting offsets is easy when you know how to do it in a hex-editor.)
 

Nerketur

PokéScripter
104
Posts
13
Years
Seems to be useful. What about giving offsets (where exactly is the Script Area)? I wanna port the offsets to a German Rom, but just by looking on the events tab it is hard to locate the script area. (Sounds odd? I know, but porting offsets is easy when you know how to do it in a hex-editor.)

I can only give what I have. I added offsets and new findings in the first post, but I make no guarantee that it is comprehensive and exhaustive. There may be scrips earlier than the first offset I give, and there are certainly offsets after the last one I gave.

As for why there are breaks? Those are areas I'm not sure of, yet. I'm pretty dang sure all of "Pokécenter" is together, though I haven't found every single thing yet. I wanted to post what I had, I'll update again shortly. As for organizing? I'll do that later. For right now, those parts that are convoluted I'm leaving convoluted, until I have a basic map of everything.

Now, a little note for all of you hackers out there. I recall a few things in the script Help thread that came up in the Pokécenter Scripts. "executeram" shows up for Mystery Gift, and that unknown Special 0x187 and 0x188. I'm almost certain that these specials do something special, and give results based on a few things, and I'm sure one of them allows for "loadmessage" and "preparemessage" to work properly. I'm not sure how, though. Also, the "special 0x1F/special 0x199" combo seems to close the connection over Wifi. It happens whenever an error is detected, so that would make sense.
 
Back
Top