Current state of affairs

Here is where our romhack currently stands:

  1. Changing Professor Birch’s speech
  2. Changing the Littleroot Town map
  3. Adding an interaction event in Littleroot Town
  4. Changing the starter Pokémons
  5. Changing the first trainer’s team
  6. Modifying the first wild Pokémons

Goal

The goal for this step is to modify the starting town’s map, and add an object we will later be able to interact with. This object will most likely be a signpost, or npc, or one of both.

To make these changes, we are going to use Porymap, available here.

Using Porymap

Once you’ve compiled and executed the Porymap binary and opened the relevant project, our romhack in this case, you should an interface that is reminiscent of the typical RPG Maker interface.

The leftmost panel should be a list of folders named gMapGroup0 through gMapGroup33 at the time of writing. Here is what each map group contains:

  • gMapGroup0: all of the “outside” maps - town layouts and routes
  • gMapGroup1 to gMapGroup16: all of the “indoor” maps for the towns, with some exceptions like the inside of the moving truck found during the introduction in Littleroot Town
  • gMapGroup17 to gMapGroup23 and gMapGroup27 to gMapGroup33: all of the “indoor” maps for all of the routes
  • gMapGroup24 to gMapGroup26: all of the remaining “indoor” maps - Battle Frontier, caves, the inside of the moving truck, ships, etc…

Take a moment to unroll of the folders and take a look at all of the different maps you can edit. Once you’re done, open gMapGroup0 and select [0.09] LittlerootTown.

You should now see the town map in the center of your screen, and the map’s tiles on the right. The rest of the interface is intuitive enough and I will let you refer to the official documentation to see exactly what everything does.

Making our first map change

Littleroot Town currently looks like this:

Littleroot Town’s original map

Let’s add a puddle, and a signpost in the center and save our changes:

Littleroot Town with a puddle

Congratulations, you’ve just edited your first map! However, as you might realise, if you compile the rom and play it, the player goes right through the signpost.

We now have to add collisions. To do so, select the Collision tab on the right, and make it so the player cannot walk through the signpost. The map’s collision look like this:

Littleroot Town’s updated collisions

Save the map, compile the game, and you will see that the player cannot walk through the signpost anymore:

Congratulations once again, you’ve successfully edited a map and adjusted the collisions!

Interacting with the signpost

Switch to the events tab in the central panel, select the dropdown menu on the right, next to New Object and choose New Sign. A new sign event should appear in the top left corner (0,0) of the map. Select the pointer and move the event to the signpost in the middle of the puddle.

Littleroot Town events

Name the script LittlerootTown_EventScript_PuddleSign and click the Open Map Scripts button. If nothing happens, open the data/maps/LittlerootTown/scripts.inc file with the text editor of your choice.

Add this code at the end of the file:

LittlerootTown_EventScript_PuddleSign::
	msgbox LittlerootTown_Text_PuddleSign, MSGBOX_SIGN
	end

LittlerootTown_Text_PuddleSign:
	.string "Welcome to the world famous Littleroot\n"
	.string "Town puddle$"

As you can imagine, this code creates a procedure called LittlerootTown_EventScript_PuddleSign which creates a message box containing the text after the LittlerootTown_Text_PuddleSign label. Save the file, recompile the game, and you should now be able to interact with the signpost:

Good job, you’ve now added your first interactive event to game and made a more complete romhack!

That’s it for now, next time we will edit the game’s starter pokémons.