Connected Maps

Help spread the word!Share on FacebookShare on TumblrTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditFlattr the author

ConnectMaps1

By default, RPG Maker displays one map when you are in the map scene. However, this map can be manipulated at runtime.

This script allows you to connect maps together, providing a seamless transition from one map to another (because there is no actual transition). You can create a map in separate parts and then connect it all together to produce one large map.

The editor has a limitation of 250000 tiles, or a 500×500 map. Using map connections allows you to overcome this limitation in the game.

Download

Script: download here

Usage

To connect maps together, use note-tags in each map to specify which maps should be connected to it:

<connect map: map_id offset_x offset_y>

The map_id is the ID of the map that you want to connect to the current map, and the offset_x and offset_y is the position that the new map will be placed.

x-values shift it horizontally. Positive x-values shift it to the right, negative-x values shift it to the left.
y-values shift it vertically. Positive y-values shift it down, negative y-values shift it up.

Here is an example demonstrating how to connect map 2 to map 1 side-by-side.

connectMaps2

Positioning Modes

This script provides two types of positioning for map connecting. Only one may be used at any time. By default it is “recursive positioning” but you can change this in the configuration.

  1. Absolute Positioning. This mode specifies all offsets to be in absolute coordinates, where the origin is fixed at the upper-left corner of the current map you are editing.connectMaps3
  2. Recursive Positioning. This mode specifies all offsets to be relative to the parent map. The origin is located at the upper left corner of each map.For example, if map 2 connects to map 1, and map 1 connects to map 2, then we can have a looping map. A special “recurse limit” argument is provided in order to tell the map when to stop looping. By default, this is 1.
    <connect map: map_id offset_x offset_y recurse_limit>

    connectMaps4

There are several things to keep in mind about connected maps

  1. They all use the same tileset, so you cannot connect two maps with two different tilesets (you can, but the tileset will automatically change to the current map’s tileset)
  2. You must begin from the top-left and connect maps to the right or bottom. You cannot connect maps to the left or top.
  3. Negative offsets are supported, but they will simply truncate your map if you shift it to the left or top.
  4. Maps with different dimensions will result in empty, impassable black spots. You can decorate it with a parallax image so it isn’t just a black spot, but space doesn’t fill up by itself.
  5. All event ID’s are automatically adjusted, as are event commands. However, script calls are not updated, so if you are using any script calls that deal with events, you may need to re-consider your design.
  6. Any other property that relies on separate instances of the map are also gone (parallax maps, for example\

So unfortunately this is a very simple implementation of joining maps together. A better solution will be needed in order to fully combine maps together with separate tilesets, parallaxes, and so on.

Help spread the word!Share on FacebookShare on TumblrTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditFlattr the author

You may also like...

50 Responses

  1. Blackikun says:

    Hello Hime-san,

    i really hope it´s okay to ask… but is there any chance that you have plans for porting this one to MV?
    I have searching for a long time, but i couldn´t find anything about some kind of plugin. It would really be awesome if you have any plans for a port 🙂

  2. Mireille says:

    For some reason events that transfer the player to another map are not working on the connected maps. They send the player to the correct map but the wrong tile, and sometimes the player’s sprite doesn’t show up. There appears to be no way to calculate (from the coordinates in the command) which wrong tile the event will transfer to, although it is the same every time I test it. All transfer commands from the top-left map work fine, but commands from the other connected maps don’t work, regardless of which map the player is on at game start. I’m also using your area maps add-on but this problem was happening before I added that script.
    Do you have any idea what’s causing this?

    • Hime says:

      Do you mean, transferring to a regular map, or a map that is connected to other maps?

      • Mireille says:

        Transferring TO a regular map, FROM a map that’s connected to other ones.

        • Hime says:

          I created a new project, created two maps, connected them together, created a third map, and then created a transfer event from the connected map to the third map. Transfer occurred as expected.

          So maybe there’s more to it than just a simple transfer. Create a new project reproducing the issue and I can look at it.

          • Mireille says:

            Thanks for looking into it. In trying to recreate the problem I discovered that the cause is adding more scripts. When the project only had the connected maps script, transfers worked fine, but when I added unrelated scripts, the transfers were broken. I tried a number of different scripts and they all caused transfers to break, and I only needed to have one additional script for that to happen. Another one of your scripts is installed in this test project.

            Also, the degree to which the transfer destination was wrong seems to be related to the size of the destination map, which is why that map is so big with so much unused space.
            https://onedrive.live.com/redir?resid=B48A61A4948805BD!2432&authkey=!AOUCqqO-Cy08dUo&ithint=file%2crar

            Let me know if you have problems opening the project. Thanks again!

          • Mireille says:

            Hi again Hime, I found the previous version of this script (April 2 2013) in the Crystal Pokemon Engine pack, and I’ve been playing around with it. Looks like that version handles transfer events perfectly, but of course neither reference events nor the patch you provided work with it.

        • Hime says:

          Script has been updated. This should address the transfer issue.

      • Mireille says:

        Your Reference Events script also appears not to be working on the connected maps, but the events I’m trying to clone are transfer events so I’m not sure XD

          • Mireille says:

            The new version works! Thank you so much for your help!
            Unfortunately it’s causing an error with the patch for reference events whenever the player transfers to a map that is connected and has cloned events on it. The error says “line 22: NoMethodError occurred. undefined method `id=’ for nil:NilClass”

          • Hime says:

            That error suggests that there is no reference event with the ID that is specified in the note-tag. Are you trying to reference events that will be added to the map as a result of map connections?

          • Mireille says:

            No, the cloned events all reference events that are right next to it on the same map (2 or 3 adjacent tiles that all trigger the same event). I tried adding map IDs to the reference note tags and now the connected maps load with no error, but events from one map are offset onto the other (connected) one.

          • Hime says:

            Do you mean that an event on map 2 that references another event on map 2, will reference the wrong event when map 2 is connected to map 1?

  3. Rémi Ferment says:

    Hi, I’ve a problem with this script, when I connect two map and I test my game, I’ve a screen error who say : “Script ‘Connected Map line 171: NameError occurred.”, Help me please !

  4. Conner says:

    I would like to use this script in my commericial game. As long as credit is given, is this fine? It’s just gonna be like a 5 dollar game on steam when Im done 😛

  5. Sales_Kital says:

    A friend told me that a fully evented 500×500 map would cause massive ammounts of lag. I was wondering if this script works as a “chunk loading” type thing similar to minecraft or fallout where only the maps directly around the player are loaded.

    Like, if someone made a 500×500 with this system and maps that were 25×25 each or so, would the 500×500 made with this script have less lag than the 500×500 made without it?

    • Hime says:

      No, this script simply takes a bunch of maps and joins them together to form a larger map. The final result for the engine is the same as having a 500×500 map in your editor.

  6. JBCaptain says:

    This isn’t working for me, it shows this message:
    “Script ‘Connected maps’ line 198: NameError occurred.
    undefined method ‘setup’ for class ‘Game_Map’

  7. Doesnt’ seem like this works with Sapphire Action System, any way you know of to make it work?

  8. Master Daisy says:

    well, i just started using this script, ( i didn’t read the whole Usage) but after connecting two maps,

    first of all ( i am using different tilesets for each map) so when i connect Map 1 (tilesets ID 10) with map 2 ( tilesets ID 12)

    the Tilesets in map 2 dont show up….

    which mean its only using the tilesest from map 1….. ( but it’s working if both map have the same tilesets)

    is there any way to connect them with different tilesets ?

    Thanks

  9. Tsukihime says:

    Replace “snowyplace” with the numerical ID of the map. For the offsets, you just pick numbers, or say “w” or “h”.

    <2 0 h>
    

    Will place map 2 under the current map.

    • Pizzahut92 says:

      Alright, that seems to have worked. I’ve gotten it to where I can put the note tag for “snowyplace” to allow a connected map, but I can’t figure out how to have “DesertPart1” have snowy place connected above it. I tried putting a 50 instead of a 0 but that didn’t do anything.

  10. Tsukihime says:

    Omit the < characters > otherwise the blog eats them up. Or use the appropriate escaped forms if you know them (ampersand lt;)

  11. Pizzahut92 says:

    The formatting didn’t show up in the email notification, and I can’t see the comments past the last one I put, but what I put into the map properties notes for “DesertPart1” was:

    |

  12. Pizzahut92 says:

    I’m a bit new to the world of RPG maker scripting, so I was a bit confused on how to implement your script. I don’t know where to place the note-tags. You say to place them in the “map object” but I don’t know where to put it. I tried the map properties, but I’m either putting it in the wrong place or making an error. If you need further explanation, I can easily provide you with such information.

    • Tsukihime says:

      Yes, you would put it in the map properties. What is your note-tag

      • Pizzahut92 says:

        Well, I have a map called “DesertPart1” and another named “snowyplace”. I want “snowyplace” to be above the former, and each map is 50×50, so I believe I put “” I’m pretty sure I’m just misinterpreting your instructions.

  13. FireSpirt says:

    It would be nice if this Script would also support -x and -y or at least load the full Map even if the Chars aren´t on the main Map.

  14. chaos17 says:

    “Any other property that relies on separate instances of the map are also gone (parallax maps, for example)” I am sorry to ask but my english isn’t really good. Does this mean that script won’t work with parallax and overly map ?

  15. I was able to successively modify the script and its add-on to work with negative offsets without a problem. Do you want to see the scripts?

Leave a Reply

Your email address will not be published.

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax