This script allows you to create “overlay maps” on top of each other. In other words, map layers.
Overlay maps allow you to create much more visually attractive maps since
you now have control over different “layers”, though you are unable to walk from one layer to another. For now anyways.
Note that in the demo, the castle maps are set up properly, but the sky island map is not. I have left this as an exercise for you to figure out how to use the script by fixing the specific map to get it to work. Hint: it’s related to note-tags.
- Patch for Khas Awesome Light Effects
In the script editor, place this script below Materials and above Main.
An overlay map is just another map, except it is drawn over your current
map. The overlay map comes with the following properties
- It does not need to use the same tileset as your current map. This means you can merge multiple tilesets together in a single map
- Events on the overlay map are processed in the current map, although you are still not able to reference events from different maps.
- The player is unable to directly interact with the overlay map, or anything on the overlay map.
- The player, however, can indirectly interact with events on the overlay map by setting switches or variables that will trigger the events.
- To transfer between layers, you must use player transfer events
- Map layers can re-use each other, so if one map uses another map as the top layer, then that map can use the previous map as the bottom layer
- You can have an unlimited number of overlay maps.
- Overlay maps that are smaller than the current map will loop. This may be useful for creating patterns
- Each layer has its own screen effects
A single map can contain multiple overlay maps, so you can mix and match layers to create all sorts of maps.
Create your maps as usual, taking into consideration how you want to layer them.
You might separate your maps into “floor” and “ceiling” or “floor, walls, ceiling”, depending on how you like to organize things.
Note that because maps and overlay maps cannot interact with each other, all events on each overlay map are effectively bound to their own overlay map.
There are two types of note-tags: compact, and extended.
The compact note-tag is short and easy to type, but the extended note-tag
is probably better for organization. Note that the compact note-tag is deprecated and will no longer be supported, meaning new options will only be available in the extended note-tag.
To assign overlay maps to a map, tag the map with either
<overlay map: map order ox oy scroll_rate sync zoom>
<overlay map> map: x order: x offset: ox oy scrollrate: x sync: 0/1 zoom: x opacity: x </overlay map>
You can have multiple overlay maps by simply adding more tags. See the reference section for details about the values of each option.
The map is the ID of the map that will be drawn as an overlay.
- The order determines whether it will be drawn above or below the current map.
- If it is negative, then it will be drawn under.
- If it is positive, then it will be drawn over.
- If it is not specified, then it assumes to be over, in the order that the
tags are specified.
ox and oy determine the offset of the origin. By default, the map’s origin
is drawn at (ox = 0, oy = 0), but you can change this if necessary.
The x-value specifies the horizontal offset. Positive values shift it to the
right, while negative values shift it to the left.
The y-value specifies the vertical offset. Positive values shift it down,
while negative values shift it up.
The scroll rate specifies how fast the overlay map scrolls per step taken.
The default scroll rate is 32, which means it will scroll
32 pixels per move, or basically one tile. Higher scroll rates mean the
overlay map will scroll faster for each step you take, while slower scroll
rates results in less scrolling for each step you take.
Sync specifies whether the overlay map is synchronized with the current
map. This means that any screen effects such as shaking or weather will affect
the overlay map as well.
0 = not synchronized
1 = synchronized
The opacity value specifies the opacity of the overlay map.
The zoom value is a special option if you have installed the Overlay Map Zoom script. Refer to that script for more details.