diff options
author | Rangi <remy.oukaour+rangi42@gmail.com> | 2018-05-19 14:00:55 -0400 |
---|---|---|
committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2018-05-19 14:00:55 -0400 |
commit | 151f7a255afb6a02fc223fb3f7793dad3fd8f533 (patch) | |
tree | 4705f1da3ae0a61c7c50df6db9eb4510f441cfe0 | |
parent | a8995cb36010f950a0a5d1bfea79b32d52e688cb (diff) |
Add a new landmark
-rw-r--r-- | Add-a-new-map.md | 61 | ||||
-rw-r--r-- | screenshots/global-terminal.png | bin | 2725 -> 4477 bytes |
2 files changed, 54 insertions, 7 deletions
diff --git a/Add-a-new-map.md b/Add-a-new-map.md index 920ab78..2f44240 100644 --- a/Add-a-new-map.md +++ b/Add-a-new-map.md @@ -12,8 +12,9 @@ This tutorial is for how to add a new map. As an example, we'll add two maps: th - [Outdoor sprite set](#outdoor-sprite-set) 5. [Define its properties](#5-define-its-properties) 6. [Define its attributes](#6-define-its-attributes) -7. [Write its event scripts](#7-write-its-event-scripts) -8. [Include the block and script data](#8-include-the-block-and-script-data) +7. [Define any new landmarks](#7-define-any-new-landmarks) +8. [Write its event scripts](#8-write-its-event-scripts) +9. [Include the block and script data](#9-include-the-block-and-script-data) @@ -265,7 +266,7 @@ Edit [data/maps/maps.asm](../blob/master/data/maps/maps.asm): +MapGroup_GlobalTerminal: + map GlobalTerminalOutside, TILESET_JOHTO_MODERN, ROUTE, GOLDENROD_CITY, MUSIC_GOLDENROD_CITY, FALSE, PALETTE_AUTO, FISHGROUP_SHORE -+ map GlobalTerminal1F, TILESET_RADIO_TOWER, INDOOR, GOLDENROD_CITY, MUSIC_GOLDENROD_CITY, FALSE, PALETTE_DAY, FISHGROUP_SHORE ++ map GlobalTerminal1F, TILESET_RADIO_TOWER, INDOOR, GLOBAL_TERMINAL, MUSIC_GOLDENROD_CITY, FALSE, PALETTE_DAY, FISHGROUP_SHORE ``` The `map` macro defines these different properties: @@ -280,8 +281,8 @@ The `map` macro defines these different properties: - `ENVIRONMENT_5`: Neither outdoors nor indoors. Can't use the Bicycle. - `GATE`: Indoors. Won't show pop-up location name signs. - `DUNGEON`: Indoors. Can't use the Bicycle. Can use Dig or Escape Rope just like `CAVE`. -- **location:** Which landmark corresponds to the map. This affects where you appear on the Town Map and what the pop-up location name sign will say. -- **music:** What music plays on the map. +- **location:** Which landmark corresponds to the map. This affects where you appear on the Town Map and what the pop-up location name sign will say. Note that the `GLOBAL_TERMINAL` landmark hasn't been defined yet; we'll do that later. +- **music:** What music plays on the map. Some music constants can have unusual behavior; see the [hard-coded logic](Hard-coded-logic#some-high-values-for-maps-music-ids-play-incorrectly) page about that. - **phone service flag:** `TRUE` if Pokégear phone service is disabled, otherwise `FALSE`. - **time of day:** Controls the color palette. One of `PALETTE_AUTO`, `PALETTE_MORN`, `PALETTE_DAY`, `PALETTE_NITE`, or `PALETTE_DARK`. `PALETTE_AUTO` is based on the actual time of day. `PALETTE_DARK` requires Flash. - **fishing group:** Controls the group of wild Pokémon available by fishing. Valid fishing groups are defined in [constants/map_data_constants.asm](../blob/master/constants/map_data_constants.asm): @@ -323,7 +324,53 @@ The `connection` macro takes six arguments: the direction, map name, map ID, X/Y Anyway, I can't fully explain how to determine the right values here; try looking at how other maps connect and base your own connections on them. In this case, we made `GLOBAL_TERMINAL_OUTSIDE` the same height as `GOLDENROD_CITY`, 18 blocks, and they'll line up perfectly side by side without any Y offset, so the connection values are easy to set. -## 7. Write its event scripts +## 7. Define any new landmarks + +If you don't need any new landmarks, skip this step. We assigned the `GlobalTerminal1F` map to the new `GLOBAL_TERMINAL` landmark (like how the Radio Tower gets its own landmark), so let's add that next. + +Edit [constants/landmark_constants.asm](../blob/master/constants/landmark_constants.asm): + +```diff + ; Landmarks indexes (see data/maps/landmarks.asm) + const_def + + ; Johto landmarks + const SPECIAL_MAP ; 00 + ... + const RADIO_TOWER ; 11 ++ const GLOBAL_TERMINAL + const ROUTE_35 ; 12 + ... +``` + +The Town Map will cycle through landmarks in their constant order. + +Now edit [data/maps/landmarks.asm](../blob/master/data/maps/landmarks.asm): + +```diff + Landmarks: ; 0x1ca8c3 + ; entries correspond to constants/landmark_constants.asm + landmark 0, 0, SpecialMapName + ... + landmark 58, 108, RadioTowerName ++ landmark 52, 108, GlobalTerminalName + landmark 60, 92, Route35Name + ... + landmark 148, 132, FastShipName + ; 0x1caa43 + + NewBarkTownName: db "NEW BARK¯TOWN@" + ... + SpecialMapName: db "SPECIAL@" ++GlobalTerminalName: db "GLOBAL¯TERMINAL@" +``` + +The two numbers passed to the `landmark` macro are the X and Y coordinates on the Town Map. + +Note the use of "¯" in some landmark names. That character gets treated as a line break in the Town Map, but as a space in pop-up location name signs. + + +## 8. Write its event scripts Create **maps/GlobalTerminalOutside.asm**: @@ -382,7 +429,7 @@ Writing event scripts is beyond the scope of this tutorial, but you can refer to You'll probably want a variety of NPCs in the Global Terminal, some from regions beyond Johto and Kanto, maybe with unique items and Pokémon to trade. It's a tall building, with room for more floors than just the one in this example. Or, of course, design your own map. :P -## 8. Include the block and script data +## 9. Include the block and script data We created some new files in maps/, but they aren't `INCLUDE`d in the project yet. diff --git a/screenshots/global-terminal.png b/screenshots/global-terminal.png Binary files differindex a667141..27f5364 100644 --- a/screenshots/global-terminal.png +++ b/screenshots/global-terminal.png |