=begin
#===============================================================================
Title: Map Regions
Author: Hime
Date: Apr 24, 2015
URL: http://himeworks.com/2014/02/17/map-regions/
--------------------------------------------------------------------------------
** Change log
Apr 24, 2015
- BGM does not replay if new region has the same name
Apr 4, 2015
- supports filenames with quotes
Jun 16, 2014
- added support for calling common events on region change
Feb 17, 2014
- initial release
--------------------------------------------------------------------------------
** Terms of Use
* Free to use in non-commercial projects
* Contact me for commercial use
* No real support. The script is provided as-is
* Will do bug fixes, but no compatibility patches
* Features may be requested but no guarantees, especially if it is non-trivial
* Credits to Hime Works in your project
* Preserve this header
--------------------------------------------------------------------------------
** Description
This script allows you to separate your map into separate "map regions".
Each region can be treated as a separate section of the map, with their own
names, music, and battlebacks.
When you move from one region to another, the new region's name will be
used and the new region's music will be played.
--------------------------------------------------------------------------------
** Installation
In the script editor, install this script below Materisls and above Main
--------------------------------------------------------------------------------
** Usage
To create a map region, note-tag the map with
The following options are available. You do not need to include all of them.
name - the name of the region
bback1 - name of the file for the floor battleback
bback2 - name of the file for the wall battleback
bgm - the BGM to play when you move into this region
bgs - the BGS to play when you move into this region
fade - the fade duration for the previous BGM before the next one begins
common_event - ID of the common event to execute
When a region name is specified, the name of the map is changed to the region
name. The map name window will also be shown automatically when you move into
a new region.
To enable region battlebacks, you need to first check the "specify battleback"
box for the map.
You can specify the volume and pitch of the music files if needed.
These are specified as percentages, where 100 means 100% volume/pitch, and
50 means 50% volume/pitch. If your filename has spaces, you can surround the
name with quotes such as this
"my music file"
The fade duration is specified in milliseconds. Therefore, if you want the
music to fade out for a second, you would write 1000.
--------------------------------------------------------------------------------
** Example
Here's map region 10 with the name "Grassland", using Theme1 as the BGM, and a
Storm BGS with a lowered volume:
#===============================================================================
=end
$imported = {} if $imported.nil?
$imported[:TH_MapRegions] = true
#===============================================================================
# ** Configuration
#===============================================================================
module TH
module Map_Regions
Ext_Regex = /