Maplinks
Version: 1.2.1
Introduction
My maplinks script allows you to effortlessly tile maps together to create regions without any transfer events. The underlying Object_Table class provides a powerful platform for this script. This script can handle any combination of maps you throw at it.
Features
Screenshots
Picture a screen fading from one map to another...
Demo
Not available.
Instructions
To setup my maplinks script you need to edit its initialize method to reflect your project. For reference here's the demo's initialize.
Compatibility
SDK compliant
Does not require the SDK
All edited methods are aliased with alias_method for compatibility and are automatically logged if the SDK is used
Aliases Game_Map(initialize, setup) and Game_Player(check_event_trigger_touch, update)
Credits and Thanks
Wachunga - Activating Maplinks when the player tries to leave the map; a feature of his Maplinks script.
G-man - Requesting the ability to have the player sprite leave the map before transferring.
Regimos - Major Bug Report (Save/Load Error)
Cheatking - Bug Report (Table Axis Error)
Busbuzz - Bug Report
Author's Notes
I've spent quite a while on this script so far and have already rewritten it twice. If you have any errors please post your edited initialize method and a screenshot of the error dialogue box.
Version: 1.2.1
Introduction
My maplinks script allows you to effortlessly tile maps together to create regions without any transfer events. The underlying Object_Table class provides a powerful platform for this script. This script can handle any combination of maps you throw at it.
Features
- Seamlessly tiles multiple maps together into a world map, dungeon, cave etc.
- No need for any transfer events between linked maps
- Can tile differently sized and shaped maps together
- Map dimensions are not restricted to multiples of a number
- Only transfers when you try to leave the map
- Will not transfer if current location or destination is impassable in the direction you are travelling
- You can create multiple maplinks planes using the tables? z-axis
- Optional looping of maplinks planes in each direction
- Dynamically, enable and disable maps as your adventure progresses
- Disable access to maps from certain directions
- Option to have player sprite leave map before transferring
- Easy to setup tables
- New Object_Table class
- Thoroughly tested
- No noticeable impact on frame rate
Screenshots
Picture a screen fading from one map to another...
Demo
Not available.
Instructions
Installation
Spoiler
- Object Table script above main.
- Install Maplinks script above main.
- If not using the SDK; install the Interpreter Script Fix. It's included in the SDK.
To setup my maplinks script you need to edit its initialize method to reflect your project. For reference here's the demo's initialize.
Sample Initialize
Spoiler
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias_method :icarus_maplinks_initialize, :initialize
def initialize
# The Usual
icarus_maplinks_initialize
# Create size array for tables
# You can create multiple maplinked planes using the tables? z-axis
size = [4, 4, 1]
# Create map layout table for maplinks
@maps = Object_Table.new(*size)
@maps[0,0,0], @maps[1,0,0], @maps[2,0,0], @maps[3,0,0] = 1, 2, 3, 4
@maps[0,1,0], @maps[1,1,0], @maps[2,1,0], @maps[3,1,0] = 5, 6, 6, 7
@maps[0,2,0], @maps[1,2,0], @maps[2,2,0], @maps[3,2,0] = 8, 6, 6, 9
@maps[0,3,0], @maps[1,3,0], @maps[2,3,0], @maps[3,3,0] = 10, 10, 10, 10
@maps.negative_read = false
# Create map size arrays
sm, long, large = [20, 15], [80, 15], [40, 30]
# Define the size of each map
@sizes = Object_Table.new(*size)
@sizes[0,0,0], @sizes[1,0,0], @sizes[2,0,0], @sizes[3,0,0] = sm, sm, sm, sm
@sizes[0,1,0], @sizes[1,1,0], @sizes[3,1,0] = sm, large, sm
@sizes[0,2,0], @sizes[3,2,0] = sm, sm
@sizes[0,3,0] = long
# Disable access to curtain maps by direction
# Down = 1, Left = 2, Right = 4, Up = 8, All = 15
# ie. Down + Right = 1 + 4 = 5
@disabled = []
# @disabled[map_id] = value
@disabled[1] = 4
# Enable looped maplinked planes by direction
# Down = 1, Left = 2, Right = 4, Up = 8, All = 15
# ie. Left + Right = 2 + 4 = 6
@looped = []
# @looped[plane z] = value
@looped[0] = 15
# Fade between maps
@fade = true
# Walk off map before transferring
@leave_map = true
end
# * Object Initialization
#--------------------------------------------------------------------------
alias_method :icarus_maplinks_initialize, :initialize
def initialize
# The Usual
icarus_maplinks_initialize
# Create size array for tables
# You can create multiple maplinked planes using the tables? z-axis
size = [4, 4, 1]
# Create map layout table for maplinks
@maps = Object_Table.new(*size)
@maps[0,0,0], @maps[1,0,0], @maps[2,0,0], @maps[3,0,0] = 1, 2, 3, 4
@maps[0,1,0], @maps[1,1,0], @maps[2,1,0], @maps[3,1,0] = 5, 6, 6, 7
@maps[0,2,0], @maps[1,2,0], @maps[2,2,0], @maps[3,2,0] = 8, 6, 6, 9
@maps[0,3,0], @maps[1,3,0], @maps[2,3,0], @maps[3,3,0] = 10, 10, 10, 10
@maps.negative_read = false
# Create map size arrays
sm, long, large = [20, 15], [80, 15], [40, 30]
# Define the size of each map
@sizes = Object_Table.new(*size)
@sizes[0,0,0], @sizes[1,0,0], @sizes[2,0,0], @sizes[3,0,0] = sm, sm, sm, sm
@sizes[0,1,0], @sizes[1,1,0], @sizes[3,1,0] = sm, large, sm
@sizes[0,2,0], @sizes[3,2,0] = sm, sm
@sizes[0,3,0] = long
# Disable access to curtain maps by direction
# Down = 1, Left = 2, Right = 4, Up = 8, All = 15
# ie. Down + Right = 1 + 4 = 5
@disabled = []
# @disabled[map_id] = value
@disabled[1] = 4
# Enable looped maplinked planes by direction
# Down = 1, Left = 2, Right = 4, Up = 8, All = 15
# ie. Left + Right = 2 + 4 = 6
@looped = []
# @looped[plane z] = value
@looped[0] = 15
# Fade between maps
@fade = true
# Walk off map before transferring
@leave_map = true
end
Expand to see the code.
Configuration
Spoiler
Customize table size array. The size array's elements become the x, y, and z coordinate maximums of the tables. Therefore, xmax and ymax should be the gridded size of the largest regional plane. The zmax should be set to the total number of different maplinked regions.
Modify @maps table to reflect the map ids of your linked regions
Record the size of each map in the @sizes table
Optional: Disable access to curtain areas in your region
Optional: Loop curtain maplinked planes
Optional: Change miscellaneous settings
# Create size array for tables [xmax, ymax, zmax]
# You can index multiple maplinks regions on the tables? z-axis
size = [4, 4, 1]
# You can index multiple maplinks regions on the tables? z-axis
size = [4, 4, 1]
Expand to see the code.
Modify @maps table to reflect the map ids of your linked regions
# Create map layout table for maplinks
@maps = Object_Table.new(*size)
@maps[0,0,0], @maps[1,0,0], @maps[2,0,0], @maps[3,0,0] = 1, 2, 3, 4
@maps[0,1,0], @maps[1,1,0], @maps[2,1,0], @maps[3,1,0] = 5, 6, 6, 7
@maps[0,2,0], @maps[1,2,0], @maps[2,2,0], @maps[3,2,0] = 8, 6, 6, 9
@maps[0,3,0], @maps[1,3,0], @maps[2,3,0], @maps[3,3,0] = 10, 10, 10, 10
@maps.negative_read = false
@maps = Object_Table.new(*size)
@maps[0,0,0], @maps[1,0,0], @maps[2,0,0], @maps[3,0,0] = 1, 2, 3, 4
@maps[0,1,0], @maps[1,1,0], @maps[2,1,0], @maps[3,1,0] = 5, 6, 6, 7
@maps[0,2,0], @maps[1,2,0], @maps[2,2,0], @maps[3,2,0] = 8, 6, 6, 9
@maps[0,3,0], @maps[1,3,0], @maps[2,3,0], @maps[3,3,0] = 10, 10, 10, 10
@maps.negative_read = false
Expand to see the code.
Record the size of each map in the @sizes table
# Create map size arrays
sm, long, large = [20, 15], [80, 15], [40, 30]
# Define the size of each map
@sizes = Object_Table.new(*size)
@sizes[0,0,0], @sizes[1,0,0], @sizes[2,0,0], @sizes[3,0,0] = sm, sm, sm, sm
@sizes[0,1,0], @sizes[1,1,0], @sizes[3,1,0] = sm, large, sm
@sizes[0,2,0], @sizes[3,2,0] = sm, sm
@sizes[0,3,0] = long
sm, long, large = [20, 15], [80, 15], [40, 30]
# Define the size of each map
@sizes = Object_Table.new(*size)
@sizes[0,0,0], @sizes[1,0,0], @sizes[2,0,0], @sizes[3,0,0] = sm, sm, sm, sm
@sizes[0,1,0], @sizes[1,1,0], @sizes[3,1,0] = sm, large, sm
@sizes[0,2,0], @sizes[3,2,0] = sm, sm
@sizes[0,3,0] = long
Expand to see the code.
Optional: Disable access to curtain areas in your region
# Disable access to curtain maps by direction
# Down = 1, Left = 2, Right = 4, Up = 8, All = 15
# ie. Down + Right = 1 + 4 = 5
@disabled = []
# @disabled[map_id] = value
@disabled[1] = 4
# Down = 1, Left = 2, Right = 4, Up = 8, All = 15
# ie. Down + Right = 1 + 4 = 5
@disabled = []
# @disabled[map_id] = value
@disabled[1] = 4
Expand to see the code.
Optional: Loop curtain maplinked planes
# Enable looped maplinked planes by direction
# Down = 1, Left = 2, Right = 4, Up = 8, All = 15
# ie. Left + Right = 2 + 4 = 6
@looped = []
# @looped[plane z] = value
@looped[0] = 15
# Down = 1, Left = 2, Right = 4, Up = 8, All = 15
# ie. Left + Right = 2 + 4 = 6
@looped = []
# @looped[plane z] = value
@looped[0] = 15
Expand to see the code.
Optional: Change miscellaneous settings
# Fade between maps
@fade = true
# Walk off map before transferring
@leave_map = true
@fade = true
# Walk off map before transferring
@leave_map = true
Expand to see the code.
Compatibility
SDK compliant
Does not require the SDK
All edited methods are aliased with alias_method for compatibility and are automatically logged if the SDK is used
Aliases Game_Map(initialize, setup) and Game_Player(check_event_trigger_touch, update)
Credits and Thanks
Wachunga - Activating Maplinks when the player tries to leave the map; a feature of his Maplinks script.
G-man - Requesting the ability to have the player sprite leave the map before transferring.
Regimos - Major Bug Report (Save/Load Error)
Cheatking - Bug Report (Table Axis Error)
Busbuzz - Bug Report
Author's Notes
I've spent quite a while on this script so far and have already rewritten it twice. If you have any errors please post your edited initialize method and a screenshot of the error dialogue box.
Version Info
Spoiler
Next Version: 1.3.0
Maps Folio V1.0.0 - Regional maps drawn up from maplinks data (world maps, dungeon maps etc.)
Current Version: 1.2.1 - October 25, 2007
Fixed map id 0 bug
Split Difference and Shift methods by x and y axis for faster processing
Maps Folio V1.0.0 - Regional maps drawn up from maplinks data (world maps, dungeon maps etc.)
Current Version: 1.2.1 - October 25, 2007
Fixed map id 0 bug
Split Difference and Shift methods by x and y axis for faster processing
Version Log
Spoiler
1.2.0 - October 23, 2007
Option to have looped regions where each edge of the region is connected to the opposite side
Option to have certain maps in a region partially disabled; with access on certain sides only
Completely rebuilt Object_Table class
Removed RGSS.Table
1.1.1 - October 3, 2007
Fixes save/load error in RGSS.Table and Object_Table
1.1.0 - September 22, 2007
Added option to have the player leave the map before transferring
Fixed and enhanced RGSS.Table and Object_Table
Replaced @disabled Object_Table with Array
1.0.1 - August 22, 2007
Changes @disabled table handling for multi-grid maps
Object_Table is now initialized with nil
1.0.0 - August 21, 2007
Original Release
Option to have looped regions where each edge of the region is connected to the opposite side
Option to have certain maps in a region partially disabled; with access on certain sides only
Completely rebuilt Object_Table class
Removed RGSS.Table
1.1.1 - October 3, 2007
Fixes save/load error in RGSS.Table and Object_Table
1.1.0 - September 22, 2007
Added option to have the player leave the map before transferring
Fixed and enhanced RGSS.Table and Object_Table
Replaced @disabled Object_Table with Array
1.0.1 - August 22, 2007
Changes @disabled table handling for multi-grid maps
Object_Table is now initialized with nil
1.0.0 - August 21, 2007
Original Release