diff options
author | Rangi <remy.oukaour+rangi42@gmail.com> | 2018-11-10 19:14:49 -0500 |
---|---|---|
committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2018-11-10 19:14:49 -0500 |
commit | 672002fc8fbef458543d47daddef972d098c1a45 (patch) | |
tree | ba85720abaef8168171bae8c87cc1f56e6a9a067 | |
parent | b4c5a0d35cbf433858b3699c65d950cc9626d7fb (diff) |
Map connections
-rw-r--r-- | Add-a-new-map-and-landmark.md | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/Add-a-new-map-and-landmark.md b/Add-a-new-map-and-landmark.md index abf6381..bb24fdf 100644 --- a/Add-a-new-map-and-landmark.md +++ b/Add-a-new-map-and-landmark.md @@ -302,12 +302,12 @@ Edit [data/maps/attributes.asm](../blob/master/data/maps/attributes.asm): ```diff - map_attributes GoldenrodCity, GOLDENROD_CITY, $35, NORTH | SOUTH + map_attributes GoldenrodCity, GOLDENROD_CITY, $35, NORTH | SOUTH | WEST - connection north, Route35, ROUTE_35, 5, 0, 10 - connection south, Route34, ROUTE_34, 5, 0, 10 -+ connection west, GlobalTerminalOutside, GLOBAL_TERMINAL_OUTSIDE, 0, 0, 18 + connection north, Route35, ROUTE_35, 5 + connection south, Route34, ROUTE_34, 5 ++ connection west, GlobalTerminalOutside, GLOBAL_TERMINAL_OUTSIDE, 0 + + map_attributes GlobalTerminalOutside, GLOBAL_TERMINAL_OUTSIDE, $35, EAST -+ connection east, GoldenrodCity, GOLDENROD_CITY, 0, 0, 18 ++ connection east, GoldenrodCity, GOLDENROD_CITY, 0 ... @@ -322,13 +322,11 @@ The **border block** is the block ID that fills the map's surroundings when you The **connections** value is a combination of `NORTH`, `SOUTH`, `WEST`, or `EAST`, or 0 if the map has no connections. Only outdoor maps have connections; they're what let you walk straight from one map to another, without needing to warp via a door or staircase. Whatever connections a map has, it's followed by a `connection` macro for each of them, in north-south-west-east order. -The `connection` macro takes six arguments: the direction, map name, map ID, X/Y offset, distance offset, and strip length. Again, the direction, map name, and map ID are just for identification, but the other three values are more complicated. +The `connection` macro takes four arguments: the direction, map name, map ID, and sideways offset. Again, the direction, map name, and map ID are just for identification. The **sideways offset** is how many blocks to shift the connected map perpendicular to its direction. A north or south connection gets shifted right/east, a west or east connection gets shifted down/south. (So negative offsets will shift left/west or up/north, respectively.) -- **X/Y target offset:** How many blocks to shift a connection perpendicular to its direction. A north or south connection gets shifted right/east, a west or east connection gets shifted down/south. -- **X/Y source offset:** The block data from this offset in the target map is loaded to the X/Y offset of the source map. Same rules as the previous argument apply. -- **strip length:** How many blocks wide the connection is. +If the offset isn't clear, try comparing screenshots of other maps with their own offset values, and base your own connections on similarly aligned ones. 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, so the offset is 0. -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. +(Before November 10, 2018, the `connection` macro took six parameters; instead of a single sideways offset, you had to specify an X/Y offset, distance offset, and strip length, which were confusing and harder to calculate. The current macro definition has legacy support for the old one, since in all of the official maps, sideways offset = distance offset − X/Y offset, with the strip length being completely redundant. I strongly recommend porting the new macro to any old pokecrystal projects.) ## 7. Define any new landmarks |