I think he's talking about making a map joining all the maps with their child maps. Surprisingly enough, RMXP actually keeps track of this in code you can call.
module RPG
class MapInfo
def initialize
@name = ""
@parent_id = 0
@order = 0
@expanded = false
@scroll_x = 0
@scroll_y = 0
end
attr_accessor :name
attr_accessor :parent_id
attr_accessor :order
attr_accessor :expanded
attr_accessor :scroll_x
attr_accessor :scroll_y
end
end
The variable
parent_id contains an integer value, relating to the id of the map that it joins to. If this is any help.
Loading the MapInfos data can be done like so:
map_info = load_data("Data/MapInfos.rxdata")
which should return an Hash of RPG::MapInfos objects, with the map id as the key. You could then use that, and some looping arrays, to determine what maps are child maps of your current map.
class Game_Map
def child_maps?(id)
map_infos = load_data("Data/MapInfos.rxdata")
maps = []
for key in map_infos.keys
next unless map_infos[key].parent_id == id
maps[key] = map_infos[key].parent_id
end
return maps
end
end
You could then simply add a method to Game_Map:
class Game_Map
def parent_id?(id)
map_infos = load_data("Data/MapInfos.rxdata")
for key in map_infos.keys
return map_infos[key].parent_id if key == id
end
end
end
Or you could do it the easy way, and add this code to the $data_* initialization of Scene_Title:
$data_mapinfo = load_data("Data/MapInfos.rxdata")
And then you can easily just do $data_mapinfo[
MapID].parent_id to return the parent ID.