Split metadata.txt into metadata.txt and map_metadata.txt, fixed bug when writing certain PBS files

This commit is contained in:
Maruno17
2021-10-09 23:34:45 +01:00
parent 166a289a60
commit a090f50bc5
20 changed files with 818 additions and 666 deletions

View File

@@ -161,3 +161,11 @@ SaveData.register_conversion(:v20_follower_data) do
global.dependentEvents = nil global.dependentEvents = nil
end end
end end
SaveData.register_conversion(:v20_increment_player_character_id) do
essentials_version 19.1
display_title 'Incrementing player character ID'
to_value :player do |player|
player.character_ID += 1
end
end

View File

@@ -48,31 +48,31 @@ class Game_Player < Game_Character
end end
def set_movement_type(type) def set_movement_type(type)
meta = GameData::Metadata.get_player($Trainer&.character_ID || 0) meta = GameData::PlayerMetadata.get($Trainer&.character_ID || 1)
new_charset = nil new_charset = nil
case type case type
when :fishing when :fishing
new_charset = pbGetPlayerCharset(meta, 6) new_charset = pbGetPlayerCharset(meta.fish_charset)
when :surf_fishing when :surf_fishing
new_charset = pbGetPlayerCharset(meta, 7) new_charset = pbGetPlayerCharset(meta.surf_fish_charset)
when :diving, :diving_fast, :diving_jumping, :diving_stopped when :diving, :diving_fast, :diving_jumping, :diving_stopped
self.move_speed = 3 self.move_speed = 3
new_charset = pbGetPlayerCharset(meta, 5) new_charset = pbGetPlayerCharset(meta.dive_charset)
when :surfing, :surfing_fast, :surfing_jumping, :surfing_stopped when :surfing, :surfing_fast, :surfing_jumping, :surfing_stopped
self.move_speed = (type == :surfing_jumping) ? 3 : 4 self.move_speed = (type == :surfing_jumping) ? 3 : 4
new_charset = pbGetPlayerCharset(meta, 3) new_charset = pbGetPlayerCharset(meta.surf_charset)
when :cycling, :cycling_fast, :cycling_jumping, :cycling_stopped when :cycling, :cycling_fast, :cycling_jumping, :cycling_stopped
self.move_speed = (type == :cycling_jumping) ? 3 : 5 self.move_speed = (type == :cycling_jumping) ? 3 : 5
new_charset = pbGetPlayerCharset(meta, 2) new_charset = pbGetPlayerCharset(meta.cycle_charset)
when :running when :running
self.move_speed = 4 self.move_speed = 4
new_charset = pbGetPlayerCharset(meta, 4) new_charset = pbGetPlayerCharset(meta.run_charset)
when :ice_sliding when :ice_sliding
self.move_speed = 4 self.move_speed = 4
new_charset = pbGetPlayerCharset(meta, 1) new_charset = pbGetPlayerCharset(meta.walk_charset)
else # :walking, :jumping, :walking_stopped else # :walking, :jumping, :walking_stopped
self.move_speed = 3 self.move_speed = 3
new_charset = pbGetPlayerCharset(meta, 1) new_charset = pbGetPlayerCharset(meta.walk_charset)
end end
@character_name = new_charset if new_charset @character_name = new_charset if new_charset
end end
@@ -490,17 +490,16 @@ end
#=============================================================================== #===============================================================================
# #
#=============================================================================== #===============================================================================
def pbGetPlayerCharset(meta,charset,trainer=nil,force=false) def pbGetPlayerCharset(charset, trainer = nil, force = false)
trainer = $Trainer if !trainer trainer = $Trainer if !trainer
outfit = (trainer) ? trainer.outfit : 0 outfit = (trainer) ? trainer.outfit : 0
if $game_player && $game_player.charsetData && !force if $game_player && $game_player.charsetData && !force
return nil if $game_player.charsetData[0] == $Trainer.character_ID && return nil if $game_player.charsetData[0] == trainer.character_ID &&
$game_player.charsetData[1] == charset && $game_player.charsetData[1] == charset &&
$game_player.charsetData[2] == outfit $game_player.charsetData[2] == outfit
end end
$game_player.charsetData = [$Trainer.character_ID,charset,outfit] if $game_player $game_player.charsetData = [trainer.character_ID, charset,outfit] if $game_player
ret = meta[charset] ret = charset
ret = meta[1] if nil_or_empty?(ret)
if pbResolveBitmap("Graphics/Characters/"+ret+"_"+outfit.to_s) if pbResolveBitmap("Graphics/Characters/"+ret+"_"+outfit.to_s)
ret = ret+"_"+outfit.to_s ret = ret+"_"+outfit.to_s
end end

View File

@@ -235,6 +235,7 @@ module GameData
TrainerType.load TrainerType.load
Trainer.load Trainer.load
Metadata.load Metadata.load
PlayerMetadata.load
MapMetadata.load MapMetadata.load
end end
end end

View File

@@ -9,14 +9,6 @@ module GameData
attr_reader :wild_capture_ME attr_reader :wild_capture_ME
attr_reader :surf_BGM attr_reader :surf_BGM
attr_reader :bicycle_BGM attr_reader :bicycle_BGM
attr_reader :player_A
attr_reader :player_B
attr_reader :player_C
attr_reader :player_D
attr_reader :player_E
attr_reader :player_F
attr_reader :player_G
attr_reader :player_H
DATA = {} DATA = {}
DATA_FILENAME = "metadata.dat" DATA_FILENAME = "metadata.dat"
@@ -29,15 +21,7 @@ module GameData
"TrainerVictoryME" => [5, "s"], "TrainerVictoryME" => [5, "s"],
"WildCaptureME" => [6, "s"], "WildCaptureME" => [6, "s"],
"SurfBGM" => [7, "s"], "SurfBGM" => [7, "s"],
"BicycleBGM" => [8, "s"], "BicycleBGM" => [8, "s"]
"PlayerA" => [9, "esssssss", :TrainerType],
"PlayerB" => [10, "esssssss", :TrainerType],
"PlayerC" => [11, "esssssss", :TrainerType],
"PlayerD" => [12, "esssssss", :TrainerType],
"PlayerE" => [13, "esssssss", :TrainerType],
"PlayerF" => [14, "esssssss", :TrainerType],
"PlayerG" => [15, "esssssss", :TrainerType],
"PlayerH" => [16, "esssssss", :TrainerType]
} }
extend ClassMethodsIDNumbers extend ClassMethodsIDNumbers
@@ -52,15 +36,7 @@ module GameData
["TrainerVictoryME", MEProperty, _INTL("Default ME played after winning a Trainer battle.")], ["TrainerVictoryME", MEProperty, _INTL("Default ME played after winning a Trainer battle.")],
["WildCaptureME", MEProperty, _INTL("Default ME played after catching a Pokémon.")], ["WildCaptureME", MEProperty, _INTL("Default ME played after catching a Pokémon.")],
["SurfBGM", BGMProperty, _INTL("BGM played while surfing.")], ["SurfBGM", BGMProperty, _INTL("BGM played while surfing.")],
["BicycleBGM", BGMProperty, _INTL("BGM played while on a bicycle.")], ["BicycleBGM", BGMProperty, _INTL("BGM played while on a bicycle.")]
["PlayerA", PlayerProperty, _INTL("Specifies player A.")],
["PlayerB", PlayerProperty, _INTL("Specifies player B.")],
["PlayerC", PlayerProperty, _INTL("Specifies player C.")],
["PlayerD", PlayerProperty, _INTL("Specifies player D.")],
["PlayerE", PlayerProperty, _INTL("Specifies player E.")],
["PlayerF", PlayerProperty, _INTL("Specifies player F.")],
["PlayerG", PlayerProperty, _INTL("Specifies player G.")],
["PlayerH", PlayerProperty, _INTL("Specifies player H.")]
] ]
end end
@@ -68,20 +44,6 @@ module GameData
return DATA[0] return DATA[0]
end end
def self.get_player(id)
case id
when 0 then return self.get.player_A
when 1 then return self.get.player_B
when 2 then return self.get.player_C
when 3 then return self.get.player_D
when 4 then return self.get.player_E
when 5 then return self.get.player_F
when 6 then return self.get.player_G
when 7 then return self.get.player_H
end
return nil
end
def initialize(hash) def initialize(hash)
@id = hash[:id] @id = hash[:id]
@home = hash[:home] @home = hash[:home]
@@ -92,14 +54,6 @@ module GameData
@wild_capture_ME = hash[:wild_capture_ME] @wild_capture_ME = hash[:wild_capture_ME]
@surf_BGM = hash[:surf_BGM] @surf_BGM = hash[:surf_BGM]
@bicycle_BGM = hash[:bicycle_BGM] @bicycle_BGM = hash[:bicycle_BGM]
@player_A = hash[:player_A]
@player_B = hash[:player_B]
@player_C = hash[:player_C]
@player_D = hash[:player_D]
@player_E = hash[:player_E]
@player_F = hash[:player_F]
@player_G = hash[:player_G]
@player_H = hash[:player_H]
end end
def property_from_string(str) def property_from_string(str)
@@ -112,14 +66,6 @@ module GameData
when "WildCaptureME" then return @wild_capture_ME when "WildCaptureME" then return @wild_capture_ME
when "SurfBGM" then return @surf_BGM when "SurfBGM" then return @surf_BGM
when "BicycleBGM" then return @bicycle_BGM when "BicycleBGM" then return @bicycle_BGM
when "PlayerA" then return @player_A
when "PlayerB" then return @player_B
when "PlayerC" then return @player_C
when "PlayerD" then return @player_D
when "PlayerE" then return @player_E
when "PlayerF" then return @player_F
when "PlayerG" then return @player_G
when "PlayerH" then return @player_H
end end
return nil return nil
end end

View File

@@ -0,0 +1,95 @@
module GameData
class PlayerMetadata
attr_reader :id
attr_reader :trainer_type
attr_reader :walk_charset
DATA = {}
DATA_FILENAME = "player_metadata.dat"
SCHEMA = {
"TrainerType" => [1, "e", :TrainerType],
"WalkCharset" => [2, "s"],
"RunCharset" => [3, "s"],
"CycleCharset" => [4, "s"],
"SurfCharset" => [5, "s"],
"DiveCharset" => [6, "s"],
"FishCharset" => [7, "s"],
"SurfFishCharset" => [8, "s"]
}
extend ClassMethodsIDNumbers
include InstanceMethods
def self.editor_properties
return [
["TrainerType", TrainerTypeProperty, _INTL("Trainer type of this player.")],
["WalkCharset", CharacterProperty, _INTL("Charset used while the player is still or walking.")],
["RunCharset", CharacterProperty, _INTL("Charset used while the player is running. Uses WalkCharset if undefined.")],
["CycleCharset", CharacterProperty, _INTL("Charset used while the player is cycling. Uses RunCharset if undefined.")],
["SurfCharset", CharacterProperty, _INTL("Charset used while the player is surfing. Uses CycleCharset if undefined.")],
["DiveCharset", CharacterProperty, _INTL("Charset used while the player is diving. Uses SurfCharset if undefined.")],
["FishCharset", CharacterProperty, _INTL("Charset used while the player is fishing. Uses WalkCharset if undefined.")],
["SurfFishCharset", CharacterProperty, _INTL("Charset used while the player is fishing while surfing. Uses FishCharset if undefined.")]
]
end
# @param player_id [Integer]
# @return [self, nil]
def self.get(player_id = 1)
validate player_id => Integer
return self::DATA[player_id] if self::DATA.has_key?(player_id)
return self::DATA[1]
end
def initialize(hash)
@id = hash[:id]
@trainer_type = hash[:trainer_type]
@walk_charset = hash[:walk_charset]
@run_charset = hash[:run_charset]
@cycle_charset = hash[:cycle_charset]
@surf_charset = hash[:surf_charset]
@dive_charset = hash[:dive_charset]
@fish_charset = hash[:fish_charset]
@surf_fish_charset = hash[:surf_fish_charset]
end
def run_charset
return @run_charset || @walk_charset
end
def cycle_charset
return @cycle_charset || run_charset
end
def surf_charset
return @surf_charset || cycle_charset
end
def dive_charset
return @dive_charset || surf_charset
end
def fish_charset
return @fish_charset || @walk_charset
end
def surf_fish_charset
return @surf_fish_charset || fish_charset
end
def property_from_string(str)
case str
when "TrainerType" then return @trainer_type
when "WalkCharset" then return @walk_charset
when "RunCharset" then return @run_charset
when "CycleCharset" then return @cycle_charset
when "SurfCharset" then return @surf_charset
when "DiveCharset" then return @dive_charset
when "FishCharset" then return @fish_charset
when "SurfFishCharset" then return @surf_fish_charset
end
return nil
end
end
end

View File

@@ -33,7 +33,7 @@ class Player < Trainer
def trainer_type def trainer_type
if @trainer_type.is_a?(Integer) if @trainer_type.is_a?(Integer)
@trainer_type = GameData::Metadata.get_player(@character_ID || 0)[0] @trainer_type = GameData::PlayerMetadata.get(@character_ID || 1).trainer_type
end end
return @trainer_type return @trainer_type
end end
@@ -90,7 +90,7 @@ class Player < Trainer
def initialize(name, trainer_type) def initialize(name, trainer_type)
super super
@character_ID = -1 @character_ID = 0
@outfit = 0 @outfit = 0
@badges = [false] * 8 @badges = [false] * 8
@money = Settings::INITIAL_MONEY @money = Settings::INITIAL_MONEY

View File

@@ -163,9 +163,9 @@ class PokemonLoad_Scene
def pbSetParty(trainer) def pbSetParty(trainer)
return if !trainer || !trainer.party return if !trainer || !trainer.party
meta = GameData::Metadata.get_player(trainer.character_ID) meta = GameData::PlayerMetadata.get(trainer.character_ID)
if meta if meta
filename = pbGetPlayerCharset(meta,1,trainer,true) filename = pbGetPlayerCharset(meta.walk_charset, trainer, true)
@sprites["player"] = TrainerWalkingCharSprite.new(filename,@viewport) @sprites["player"] = TrainerWalkingCharSprite.new(filename,@viewport)
charwidth = @sprites["player"].bitmap.width charwidth = @sprites["player"].bitmap.width
charheight = @sprites["player"].bitmap.height charheight = @sprites["player"].bitmap.height

View File

@@ -120,13 +120,13 @@ class PokemonEntryScene
addBackgroundPlane(@sprites,"background","Naming/bg_2",@viewport) addBackgroundPlane(@sprites,"background","Naming/bg_2",@viewport)
case subject case subject
when 1 # Player when 1 # Player
meta=GameData::Metadata.get_player($Trainer.character_ID) meta = GameData::PlayerMetadata.get($Trainer.character_ID)
if meta if meta
@sprites["shadow"]=IconSprite.new(0,0,@viewport) @sprites["shadow"]=IconSprite.new(0,0,@viewport)
@sprites["shadow"].setBitmap("Graphics/Pictures/Naming/icon_shadow") @sprites["shadow"].setBitmap("Graphics/Pictures/Naming/icon_shadow")
@sprites["shadow"].x=33*2 @sprites["shadow"].x=33*2
@sprites["shadow"].y=32*2 @sprites["shadow"].y=32*2
filename=pbGetPlayerCharset(meta,1,nil,true) filename = pbGetPlayerCharset(meta.walk_charset, nil, true)
@sprites["subject"]=TrainerWalkingCharSprite.new(filename,@viewport) @sprites["subject"]=TrainerWalkingCharSprite.new(filename,@viewport)
charwidth=@sprites["subject"].bitmap.width charwidth=@sprites["subject"].bitmap.width
charheight=@sprites["subject"].bitmap.height charheight=@sprites["subject"].bitmap.height
@@ -405,13 +405,13 @@ class PokemonEntryScene2
@sprites["bg"].setBitmap("Graphics/Pictures/Naming/bg") @sprites["bg"].setBitmap("Graphics/Pictures/Naming/bg")
case subject case subject
when 1 # Player when 1 # Player
meta = GameData::Metadata.get_player($Trainer.character_ID) meta = GameData::PlayerMetadata.get($Trainer.character_ID)
if meta if meta
@sprites["shadow"] = IconSprite.new(0, 0, @viewport) @sprites["shadow"] = IconSprite.new(0, 0, @viewport)
@sprites["shadow"].setBitmap("Graphics/Pictures/Naming/icon_shadow") @sprites["shadow"].setBitmap("Graphics/Pictures/Naming/icon_shadow")
@sprites["shadow"].x = 66 @sprites["shadow"].x = 66
@sprites["shadow"].y = 64 @sprites["shadow"].y = 64
filename = pbGetPlayerCharset(meta, 1, nil, true) filename = pbGetPlayerCharset(meta.walk_charset, nil, true)
@sprites["subject"] = TrainerWalkingCharSprite.new(filename, @viewport) @sprites["subject"] = TrainerWalkingCharSprite.new(filename, @viewport)
charwidth = @sprites["subject"].bitmap.width charwidth = @sprites["subject"].bitmap.width
charheight = @sprites["subject"].bitmap.height charheight = @sprites["subject"].bitmap.height

View File

@@ -209,10 +209,10 @@ end
# Unused # Unused
def pbGetPlayerGraphic def pbGetPlayerGraphic
id = $Trainer.character_ID id = $Trainer.character_ID
return "" if id < 0 || id >= 8 return "" if id < 1
meta = GameData::Metadata.get_player(id) meta = GameData::PlayerMetadata.get(id)
return "" if !meta return "" if !meta
return GameData::TrainerType.player_front_sprite_filename(meta[0]) return GameData::TrainerType.player_front_sprite_filename(meta.trainer_type)
end end
def pbGetTrainerTypeGender(trainer_type) def pbGetTrainerTypeGender(trainer_type)
@@ -220,21 +220,21 @@ def pbGetTrainerTypeGender(trainer_type)
end end
def pbChangePlayer(id) def pbChangePlayer(id)
return false if id < 0 || id >= 8 return false if id < 1
meta = GameData::Metadata.get_player(id) meta = GameData::PlayerMetadata.get(id)
return false if !meta return false if !meta
$Trainer.character_ID = id $Trainer.character_ID = id
$Trainer.trainer_type = meta[0] $Trainer.trainer_type = meta.trainer_type
$game_player.character_name = meta[1] $game_player.character_name = meta.walk_charset
end end
def pbTrainerName(name = nil, outfit = 0) def pbTrainerName(name = nil, outfit = 0)
pbChangePlayer(0) if $Trainer.character_ID < 0 pbChangePlayer(1) if $Trainer.character_ID < 1
if name.nil? if name.nil?
name = pbEnterPlayerName(_INTL("Your name?"), 0, Settings::MAX_PLAYER_NAME_SIZE) name = pbEnterPlayerName(_INTL("Your name?"), 0, Settings::MAX_PLAYER_NAME_SIZE)
if name.nil? || name.empty? if name.nil? || name.empty?
player_metadata = GameData::Metadata.get_player($Trainer.character_ID) player_metadata = GameData::PlayerMetadata.get($Trainer.character_ID)
trainer_type = (player_metadata) ? player_metadata[0] : nil trainer_type = (player_metadata) ? player_metadata.trainer_type : nil
gender = pbGetTrainerTypeGender(trainer_type) gender = pbGetTrainerTypeGender(trainer_type)
name = pbSuggestTrainerName(gender) name = pbSuggestTrainerName(gender)
end end

View File

@@ -710,35 +710,33 @@ end
#=============================================================================== #===============================================================================
# Metadata editor # Metadata editor
#=============================================================================== #===============================================================================
def pbMetadataScreen(map_id = 0) def pbMetadataScreen
sel_player = -1
loop do loop do
map_id = pbListScreen(_INTL("SET METADATA"), MapLister.new(map_id, true)) sel_player = pbListScreen(_INTL("SET METADATA"), MetadataLister.new(sel_player, true))
break if map_id < 0 break if sel_player == -1
pbEditMetadata(map_id) case sel_player
when -2 # Add new player
pbEditPlayerMetadata(-1)
when 0 # Edit global metadata
pbEditMetadata
else # Edit player character
pbEditPlayerMetadata(sel_player) if sel_player >= 1
end
end end
end end
def pbEditMetadata(map_id = 0) def pbEditMetadata
mapinfos = pbLoadMapInfos
data = [] data = []
if map_id == 0 # Global metadata
map_name = _INTL("Global Metadata")
metadata = GameData::Metadata.get metadata = GameData::Metadata.get
properties = GameData::Metadata.editor_properties properties = GameData::Metadata.editor_properties
else # Map metadata
map_name = mapinfos[map_id].name
metadata = GameData::MapMetadata.try_get(map_id)
metadata = GameData::Metadata.new({}) if !metadata
properties = GameData::MapMetadata.editor_properties
end
properties.each do |property| properties.each do |property|
data.push(metadata.property_from_string(property[0])) data.push(metadata.property_from_string(property[0]))
end end
if pbPropertyList(map_name, data, properties, true) if pbPropertyList(_INTL("Global Metadata"), data, properties, true)
if map_id == 0 # Global metadata
# Construct metadata hash # Construct metadata hash
metadata_hash = { metadata_hash = {
:id => map_id, :id => 0,
:home => data[0], :home => data[0],
:wild_battle_BGM => data[1], :wild_battle_BGM => data[1],
:trainer_battle_BGM => data[2], :trainer_battle_BGM => data[2],
@@ -746,21 +744,81 @@ def pbEditMetadata(map_id = 0)
:trainer_victory_ME => data[4], :trainer_victory_ME => data[4],
:wild_capture_ME => data[5], :wild_capture_ME => data[5],
:surf_BGM => data[6], :surf_BGM => data[6],
:bicycle_BGM => data[7], :bicycle_BGM => data[7]
:player_A => data[8],
:player_B => data[9],
:player_C => data[10],
:player_D => data[11],
:player_E => data[12],
:player_F => data[13],
:player_G => data[14],
:player_H => data[15]
} }
# Add metadata's data to records # Add metadata's data to records
GameData::Metadata.register(metadata_hash) GameData::Metadata.register(metadata_hash)
GameData::Metadata.save GameData::Metadata.save
else # Map metadata Compiler.write_metadata
# Construct metadata hash end
end
def pbEditPlayerMetadata(player_id = 1)
metadata = nil
if player_id < 1
# Adding new player character; get lowest unused player character ID
ids = GameData::PlayerMetadata.keys
1.upto(ids.max + 1) do |i|
next if ids.include?(i)
player_id = i
break
end
metadata = GameData::PlayerMetadata.new({:id => player_id})
elsif !GameData::PlayerMetadata.exists?(player_id)
pbMessage(_INTL("Metadata for player character {1} was not found.", player_id))
return
end
data = []
metadata = GameData::PlayerMetadata.try_get(player_id) if metadata.nil?
properties = GameData::PlayerMetadata.editor_properties
properties.each do |property|
data.push(metadata.property_from_string(property[0]))
end
if pbPropertyList(_INTL("Player {1}", metadata.id), data, properties, true)
# Construct player metadata hash
metadata_hash = {
:id => player_id,
:trainer_type => data[0],
:walk_charset => data[1],
:run_charset => data[2],
:cycle_charset => data[3],
:surf_charset => data[4],
:dive_charset => data[5],
:fish_charset => data[6],
:surf_fish_charset => data[7],
}
# Add player metadata's data to records
GameData::PlayerMetadata.register(metadata_hash)
GameData::PlayerMetadata.save
Compiler.write_metadata
end
end
#===============================================================================
# Map metadata editor
#===============================================================================
def pbMapMetadataScreen(map_id = 0)
loop do
map_id = pbListScreen(_INTL("SET METADATA"), MapLister.new(map_id))
break if map_id < 0
(map_id == 0) ? pbEditMetadata : pbEditMetadata(map_id)
end
end
def pbEditMapMetadata(map_id)
mapinfos = pbLoadMapInfos
data = []
map_name = mapinfos[map_id].name
metadata = GameData::MapMetadata.try_get(map_id)
metadata = GameData::MapMetadata.new({:id => map_id}) if !metadata
properties = GameData::MapMetadata.editor_properties
properties.each do |property|
data.push(metadata.property_from_string(property[0]))
end
if pbPropertyList(map_name, data, properties, true)
# Construct map metadata hash
metadata_hash = { metadata_hash = {
:id => map_id, :id => map_id,
:outdoor_map => data[0], :outdoor_map => data[0],
@@ -785,11 +843,10 @@ def pbEditMetadata(map_id = 0)
:battle_environment => data[19], :battle_environment => data[19],
:flags => data[20] :flags => data[20]
} }
# Add metadata's data to records # Add map metadata's data to records
GameData::MapMetadata.register(metadata_hash) GameData::MapMetadata.register(metadata_hash)
GameData::MapMetadata.save GameData::MapMetadata.save
end Compiler.write_map_metadata
Compiler.write_metadata
end end
end end

View File

@@ -219,7 +219,7 @@ class MapScreenScene
end end
def removeOldConnections(ret, mapid) def removeOldConnections(ret, mapid)
ret.delete_if { |conn| conn[0] == mapid || conn[3] == mapid} ret.delete_if { |conn| conn[0] == mapid || conn[3] == mapid }
end end
# Returns the maps within _keys_ that are directly connected to this map, _map_. # Returns the maps within _keys_ that are directly connected to this map, _map_.
@@ -385,7 +385,7 @@ class MapScreenScene
end end
def onDoubleClick(map_id) def onDoubleClick(map_id)
pbEditMetadata(map_id) if map_id > 0 pbEditMapMetadata(map_id) if map_id > 0
end end
def onClick(mapid,x,y) def onClick(mapid,x,y)

View File

@@ -663,30 +663,6 @@ end
module PlayerProperty
def self.set(settingname,oldsetting)
oldsetting = [nil,"xxx","xxx","xxx","xxx","xxx","xxx","xxx"] if !oldsetting
properties = [
[_INTL("Trainer Type"), TrainerTypeProperty, _INTL("Trainer type of this player.")],
[_INTL("Walking"), CharacterProperty, _INTL("Walking character sprite.")],
[_INTL("Cycling"), CharacterProperty, _INTL("Cycling character sprite.")],
[_INTL("Surfing"), CharacterProperty, _INTL("Surfing character sprite.")],
[_INTL("Running"), CharacterProperty, _INTL("Running character sprite.")],
[_INTL("Diving"), CharacterProperty, _INTL("Diving character sprite.")],
[_INTL("Fishing"), CharacterProperty, _INTL("Fishing character sprite.")],
[_INTL("Surf-Fishing"), CharacterProperty, _INTL("Fishing while surfing character sprite.")]
]
pbPropertyList(settingname,oldsetting,properties,false)
return oldsetting
end
def self.format(value)
return value.inspect
end
end
module MapSizeProperty module MapSizeProperty
def self.set(settingname,oldsetting) def self.set(settingname,oldsetting)
oldsetting = [0,""] if !oldsetting oldsetting = [0,""] if !oldsetting

View File

@@ -808,25 +808,23 @@ DebugMenuCommands.register("setplayer", {
"name" => _INTL("Set Player Character"), "name" => _INTL("Set Player Character"),
"description" => _INTL("Edit the player's character, as defined in \"metadata.txt\"."), "description" => _INTL("Edit the player's character, as defined in \"metadata.txt\"."),
"effect" => proc { "effect" => proc {
limit = 0 index = 0
for i in 0...8 cmds = []
meta = GameData::Metadata.get_player(i) ids = []
next if meta GameData::PlayerMetadata.each do |player|
limit = i index = cmds.length if player.id == $Trainer.character_ID
cmds.push(player.id.to_s)
ids.push(player.id)
end
if cmds.length == 1
pbMessage(_INTL("There is only one player character defined."))
break break
end end
if limit <= 1 cmd = pbShowCommands(nil, cmds, -1, index)
pbMessage(_INTL("There is only one player defined.")) if cmd >= 0 && cmd != index
else pbChangePlayer(ids[cmd])
params = ChooseNumberParams.new
params.setRange(0, limit - 1)
params.setDefaultValue($Trainer.character_ID)
newid = pbMessageChooseNumber(_INTL("Choose the new player character."), params)
if newid != $Trainer.character_ID
pbChangePlayer(newid)
pbMessage(_INTL("The player character was changed.")) pbMessage(_INTL("The player character was changed."))
end end
end
} }
}) })
@@ -887,10 +885,20 @@ DebugMenuCommands.register("editorsmenu", {
DebugMenuCommands.register("setmetadata", { DebugMenuCommands.register("setmetadata", {
"parent" => "editorsmenu", "parent" => "editorsmenu",
"name" => _INTL("Edit Metadata"), "name" => _INTL("Edit Metadata"),
"description" => _INTL("Edit global and map metadata."), "description" => _INTL("Edit global metadata and player character metadata."),
"always_show" => true, "always_show" => true,
"effect" => proc { "effect" => proc {
pbMetadataScreen(pbDefaultMap) pbMetadataScreen
}
})
DebugMenuCommands.register("setmapmetadata", {
"parent" => "editorsmenu",
"name" => _INTL("Edit Map Metadata"),
"description" => _INTL("Edit map metadata."),
"always_show" => true,
"effect" => proc {
pbMapMetadataScreen(pbDefaultMap)
} }
}) })
@@ -1112,6 +1120,7 @@ DebugMenuCommands.register("createpbs", {
"encounters.txt", "encounters.txt",
"items.txt", "items.txt",
"map_connections.txt", "map_connections.txt",
"map_metadata.txt",
"metadata.txt", "metadata.txt",
"moves.txt", "moves.txt",
"phone.txt", "phone.txt",
@@ -1135,18 +1144,19 @@ DebugMenuCommands.register("createpbs", {
when 4 then Compiler.write_encounters when 4 then Compiler.write_encounters
when 5 then Compiler.write_items when 5 then Compiler.write_items
when 6 then Compiler.write_connections when 6 then Compiler.write_connections
when 7 then Compiler.write_metadata when 7 then Compiler.write_map_metadata
when 8 then Compiler.write_moves when 8 then Compiler.write_metadata
when 9 then Compiler.write_phone when 9 then Compiler.write_moves
when 10 then Compiler.write_pokemon when 10 then Compiler.write_phone
when 11 then Compiler.write_pokemon_forms when 11 then Compiler.write_pokemon
when 12 then Compiler.write_regional_dexes when 12 then Compiler.write_pokemon_forms
when 13 then Compiler.write_ribbons when 13 then Compiler.write_regional_dexes
when 14 then Compiler.write_shadow_movesets when 14 then Compiler.write_ribbons
when 15 then Compiler.write_town_map when 15 then Compiler.write_shadow_movesets
when 16 then Compiler.write_trainer_types when 16 then Compiler.write_town_map
when 17 then Compiler.write_trainers when 17 then Compiler.write_trainer_types
when 18 then Compiler.write_types when 18 then Compiler.write_trainers
when 19 then Compiler.write_types
else break else break
end end
pbMessage(_INTL("File written.")) pbMessage(_INTL("File written."))

View File

@@ -254,6 +254,51 @@ class MusicFileLister
end end
end end
#===============================================================================
#
#===============================================================================
class MetadataLister
def initialize(sel_player_id = -1, new_player = false)
@index = 0
@commands = []
@player_ids = []
GameData::PlayerMetadata.each do |player|
echoln player
@index = @commands.length + 1 if sel_player_id > 0 && player.id == sel_player_id
@player_ids.push(player.id)
end
@new_player = new_player
end
def dispose; end
def setViewport(viewport); end
def startIndex
return @index
end
def commands
@commands.clear
@commands.push(_INTL("[GLOBAL METADATA]"))
@player_ids.each { |id| @commands.push(_INTL("Player {1}", id)) }
@commands.push(_INTL("[ADD NEW PLAYER]")) if @new_player
return @commands
end
# Cancel: -1
# New player: -2
# Global metadata: 0
# Player character: 1+ (the player ID itself)
def value(index)
return index if index < 1
return -2 if @new_player && index == @commands.length - 1
return @player_ids[index - 1]
end
def refresh(index); end
end
#=============================================================================== #===============================================================================
# #
#=============================================================================== #===============================================================================

View File

@@ -102,6 +102,7 @@ module Compiler
line = line[3,line.length-3] line = line[3,line.length-3]
end end
if !line[/^\#/] && !line[/^\s*$/] if !line[/^\#/] && !line[/^\s*$/]
line = prepline(line)
if line[/^\s*\[\s*(.*)\s*\]\s*$/] # Of the format: [something] if line[/^\s*\[\s*(.*)\s*\]\s*$/] # Of the format: [something]
yield lastsection,sectionname if havesection yield lastsection,sectionname if havesection
sectionname = $~[1] sectionname = $~[1]
@@ -134,7 +135,7 @@ module Compiler
} }
end end
# Used for metadata.txt # Used for metadata.txt and map_metadata.txt
def pbEachFileSectionNumbered(f) def pbEachFileSectionNumbered(f)
pbEachFileSectionEx(f) { |section,name| pbEachFileSectionEx(f) { |section,name|
yield section,name.to_i if block_given? && name[/^\d+$/] yield section,name.to_i if block_given? && name[/^\d+$/]
@@ -547,11 +548,11 @@ module Compiler
def pbWriteCsvRecord(record,file,schema) def pbWriteCsvRecord(record,file,schema)
rec = (record.is_a?(Array)) ? record.flatten : [record] rec = (record.is_a?(Array)) ? record.flatten : [record]
start = (schema[1][0, 1] == "*") ? 1 : 0 start = (schema[1][0, 1] == "*") ? 1 : 0
index = 0 index = -1
begin begin
for i in start...schema[1].length for i in start...schema[1].length
index += 1 index += 1
file.write(",") if index > 1 file.write(",") if index > 0
value = rec[index] value = rec[index]
if value.nil? if value.nil?
# do nothing # do nothing
@@ -613,7 +614,7 @@ module Compiler
file.write(value.inspect) file.write(value.inspect)
end end
end end
break if start > 0 && index >= rec.length break if start > 0 && index >= rec.length - 1
end while start > 0 end while start > 0
return record return record
end end
@@ -739,6 +740,8 @@ module Compiler
compile_trainer_lists # Depends on TrainerType compile_trainer_lists # Depends on TrainerType
yield(_INTL("Compiling metadata")) yield(_INTL("Compiling metadata"))
compile_metadata # Depends on TrainerType compile_metadata # Depends on TrainerType
yield(_INTL("Compiling map metadata"))
compile_map_metadata # No dependencies
yield(_INTL("Compiling animations")) yield(_INTL("Compiling animations"))
compile_animations compile_animations
yield("") yield("")
@@ -766,6 +769,7 @@ module Compiler
"metadata.dat", "metadata.dat",
"moves.dat", "moves.dat",
"phone.dat", "phone.dat",
"player_metadata.dat",
"regional_dexes.dat", "regional_dexes.dat",
"ribbons.dat", "ribbons.dat",
"shadow_movesets.dat", "shadow_movesets.dat",

View File

@@ -1397,22 +1397,22 @@ module Compiler
#============================================================================= #=============================================================================
def compile_metadata(path = "PBS/metadata.txt") def compile_metadata(path = "PBS/metadata.txt")
GameData::Metadata::DATA.clear GameData::Metadata::DATA.clear
GameData::MapMetadata::DATA.clear GameData::PlayerMetadata::DATA.clear
# Read from PBS file # Read from PBS file
File.open(path, "rb") { |f| File.open(path, "rb") { |f|
FileLineData.file = path # For error reporting FileLineData.file = path # For error reporting
# Read a whole section's lines at once, then run through this code. # Read a whole section's lines at once, then run through this code.
# contents is a hash containing all the XXX=YYY lines in that section, where # contents is a hash containing all the XXX=YYY lines in that section, where
# the keys are the XXX and the values are the YYY (as unprocessed strings). # the keys are the XXX and the values are the YYY (as unprocessed strings).
pbEachFileSectionNumbered(f) { |contents, map_id| pbEachFileSectionNumbered(f) { |contents, section_id|
schema = (map_id == 0) ? GameData::Metadata::SCHEMA : GameData::MapMetadata::SCHEMA schema = (section_id == 0) ? GameData::Metadata::SCHEMA : GameData::PlayerMetadata::SCHEMA
# Go through schema hash of compilable data and compile this section # Go through schema hash of compilable data and compile this section
for key in schema.keys for key in schema.keys
FileLineData.setSection(map_id, key, contents[key]) # For error reporting FileLineData.setSection(section_id, key, contents[key]) # For error reporting
# Skip empty properties, or raise an error if a required property is # Skip empty properties, or raise an error if a required property is
# empty # empty
if contents[key].nil? if contents[key].nil?
if map_id == 0 && ["Home", "PlayerA"].include?(key) if section_id == 0 && ["Home"].include?(key)
raise _INTL("The entry {1} is required in {2} section 0.", key, path) raise _INTL("The entry {1} is required in {2} section 0.", key, path)
end end
next next
@@ -1422,10 +1422,10 @@ module Compiler
value = nil if value.is_a?(Array) && value.length == 0 value = nil if value.is_a?(Array) && value.length == 0
contents[key] = value contents[key] = value
end end
if map_id == 0 # Global metadata if section_id == 0 # Metadata
# Construct metadata hash # Construct metadata hash
metadata_hash = { metadata_hash = {
:id => map_id, :id => section_id,
:home => contents["Home"], :home => contents["Home"],
:wild_battle_BGM => contents["WildBattleBGM"], :wild_battle_BGM => contents["WildBattleBGM"],
:trainer_battle_BGM => contents["TrainerBattleBGM"], :trainer_battle_BGM => contents["TrainerBattleBGM"],
@@ -1433,20 +1433,61 @@ module Compiler
:trainer_victory_ME => contents["TrainerVictoryME"], :trainer_victory_ME => contents["TrainerVictoryME"],
:wild_capture_ME => contents["WildCaptureME"], :wild_capture_ME => contents["WildCaptureME"],
:surf_BGM => contents["SurfBGM"], :surf_BGM => contents["SurfBGM"],
:bicycle_BGM => contents["BicycleBGM"], :bicycle_BGM => contents["BicycleBGM"]
:player_A => contents["PlayerA"],
:player_B => contents["PlayerB"],
:player_C => contents["PlayerC"],
:player_D => contents["PlayerD"],
:player_E => contents["PlayerE"],
:player_F => contents["PlayerF"],
:player_G => contents["PlayerG"],
:player_H => contents["PlayerH"]
} }
# Add metadata's data to records # Add metadata's data to records
GameData::Metadata.register(metadata_hash) GameData::Metadata.register(metadata_hash)
else # Map metadata else # Player metadata
# Construct metadata hash # Construct metadata hash
metadata_hash = {
:id => section_id,
:trainer_type => contents["TrainerType"],
:walk_charset => contents["WalkCharset"],
:run_charset => contents["RunCharset"],
:cycle_charset => contents["CycleCharset"],
:surf_charset => contents["SurfCharset"],
:dive_charset => contents["DiveCharset"],
:fish_charset => contents["FishCharset"],
:surf_fish_charset => contents["SurfFishCharset"]
}
# Add metadata's data to records
GameData::PlayerMetadata.register(metadata_hash)
end
}
}
if !GameData::PlayerMetadata.exists?(1)
raise _INTL("Metadata for player character 1 in {1} is not defined but should be.", path)
end
# Save all data
GameData::Metadata.save
GameData::PlayerMetadata.save
Graphics.update
end
#=============================================================================
# Compile map metadata
#=============================================================================
def compile_map_metadata(path = "PBS/map_metadata.txt")
GameData::MapMetadata::DATA.clear
# Read from PBS file
File.open(path, "rb") { |f|
FileLineData.file = path # For error reporting
# Read a whole section's lines at once, then run through this code.
# contents is a hash containing all the XXX=YYY lines in that section, where
# the keys are the XXX and the values are the YYY (as unprocessed strings).
schema = GameData::MapMetadata::SCHEMA
pbEachFileSectionNumbered(f) { |contents, map_id|
# Go through schema hash of compilable data and compile this section
for key in schema.keys
FileLineData.setSection(map_id, key, contents[key]) # For error reporting
# Skip empty properties
next if contents[key].nil?
# Compile value for key
value = pbGetCsvRecord(contents[key], key, schema[key])
value = nil if value.is_a?(Array) && value.length == 0
contents[key] = value
end
# Construct map metadata hash
metadata_hash = { metadata_hash = {
:id => map_id, :id => map_id,
:outdoor_map => contents["Outdoor"], :outdoor_map => contents["Outdoor"],
@@ -1471,13 +1512,11 @@ module Compiler
:battle_environment => contents["Environment"], :battle_environment => contents["Environment"],
:flags => contents["Flags"] :flags => contents["Flags"]
} }
# Add metadata's data to records # Add map metadata's data to records
GameData::MapMetadata.register(metadata_hash) GameData::MapMetadata.register(metadata_hash)
end
} }
} }
# Save all data # Save all data
GameData::Metadata.save
GameData::MapMetadata.save GameData::MapMetadata.save
Graphics.update Graphics.update
end end

View File

@@ -738,32 +738,57 @@ module Compiler
def write_metadata def write_metadata
File.open("PBS/metadata.txt", "wb") { |f| File.open("PBS/metadata.txt", "wb") { |f|
add_PBS_header_to_file(f) add_PBS_header_to_file(f)
# Write global metadata # Write metadata
f.write("\#-------------------------------\r\n") f.write("\#-------------------------------\r\n")
f.write("[000]\r\n") f.write("[0]\r\n")
metadata = GameData::Metadata.get metadata = GameData::Metadata.get
schema = GameData::Metadata::SCHEMA schema = GameData::Metadata::SCHEMA
keys = schema.keys.sort {|a, b| schema[a][0] <=> schema[b][0] } keys = schema.keys.sort { |a, b| schema[a][0] <=> schema[b][0] }
for key in keys for key in keys
record = metadata.property_from_string(key) record = metadata.property_from_string(key)
next if record.nil? next if record.nil? || (record.is_a?(Array) && record.empty?)
f.write(sprintf("%s = ", key)) f.write(sprintf("%s = ", key))
pbWriteCsvRecord(record, f, schema[key]) pbWriteCsvRecord(record, f, schema[key])
f.write("\r\n") f.write("\r\n")
end end
# Write map metadata # Write player metadata
schema = GameData::PlayerMetadata::SCHEMA
keys = schema.keys.sort { |a, b| schema[a][0] <=> schema[b][0] }
GameData::PlayerMetadata.each do |player_data|
f.write("\#-------------------------------\r\n")
f.write(sprintf("[%d]\r\n", player_data.id))
for key in keys
record = player_data.property_from_string(key)
next if record.nil? || (record.is_a?(Array) && record.empty?)
f.write(sprintf("%s = ", key))
pbWriteCsvRecord(record, f, schema[key])
f.write("\r\n")
end
end
}
Graphics.update
end
#=============================================================================
# Save map metadata data to PBS file
#=============================================================================
def write_map_metadata
map_infos = pbLoadMapInfos map_infos = pbLoadMapInfos
schema = GameData::MapMetadata::SCHEMA schema = GameData::MapMetadata::SCHEMA
keys = schema.keys.sort {|a, b| schema[a][0] <=> schema[b][0] } keys = schema.keys.sort { |a, b| schema[a][0] <=> schema[b][0] }
File.open("PBS/map_metadata.txt", "wb") { |f|
add_PBS_header_to_file(f)
GameData::MapMetadata.each do |map_data| GameData::MapMetadata.each do |map_data|
f.write("\#-------------------------------\r\n") f.write("\#-------------------------------\r\n")
map_name = (map_infos && map_infos[map_data.id]) ? map_infos[map_data.id].name : nil
if map_name
f.write(sprintf("[%03d] # %s\r\n", map_data.id, map_name))
else
f.write(sprintf("[%03d]\r\n", map_data.id)) f.write(sprintf("[%03d]\r\n", map_data.id))
if map_infos && map_infos[map_data.id]
f.write(sprintf("# %s\r\n", map_infos[map_data.id].name))
end end
for key in keys for key in keys
record = map_data.property_from_string(key) record = map_data.property_from_string(key)
next if record.nil? next if record.nil? || (record.is_a?(Array) && record.empty?)
f.write(sprintf("%s = ", key)) f.write(sprintf("%s = ", key))
pbWriteCsvRecord(record, f, schema[key]) pbWriteCsvRecord(record, f, schema[key])
f.write("\r\n") f.write("\r\n")
@@ -795,5 +820,6 @@ module Compiler
write_trainers write_trainers
write_trainer_lists write_trainer_lists
write_metadata write_metadata
write_map_metadata
end end
end end

326
PBS/map_metadata.txt Normal file
View File

@@ -0,0 +1,326 @@
# See the documentation on the wiki to learn how to edit this file.
#-------------------------------
[001] # Intro
#-------------------------------
[002] # Lappet Town
Outdoor = true
ShowArea = true
MapPosition = 0,13,12
BattleBack = field
#-------------------------------
[003] # \PN's house
HealingSpot = 2,8,8
MapPosition = 0,13,12
#-------------------------------
[004] # Pokémon Lab
ShowArea = false
MapPosition = 0,13,12
#-------------------------------
[005] # Route 1
Outdoor = true
ShowArea = true
MapPosition = 0,13,11
BattleBack = field
#-------------------------------
[006] # Kurt's house
MapPosition = 0,13,11
#-------------------------------
[007] # Cedolan City
Outdoor = true
ShowArea = true
MapPosition = 0,13,10
MapSize = 2,11
#-------------------------------
[008] # Daisy's house
MapPosition = 0,13,12
#-------------------------------
[009] # Cedolan City Poké Center
HealingSpot = 8,17,11
MapPosition = 0,14,10
#-------------------------------
[010] # Cedolan Gym
MapPosition = 0,13,10
BattleBack = indoor3
Environment = Rock
Flags = DisableBoxLink
#-------------------------------
[011] # Pokémon Institute
MapPosition = 0,14,10
#-------------------------------
[012] # Cedolan City Condo
MapPosition = 0,14,10
#-------------------------------
[013] # Game Corner
MapPosition = 0,14,10
#-------------------------------
[014] # Cedolan Dept. 1F
MapPosition = 0,13,10
#-------------------------------
[015] # Cedolan Dept. 2F
MapPosition = 0,13,10
#-------------------------------
[016] # Cedolan Dept. 3F
MapPosition = 0,13,10
#-------------------------------
[017] # Cedolan Dept. 4F
MapPosition = 0,13,10
#-------------------------------
[018] # Cedolan Dept. 5F
MapPosition = 0,13,10
#-------------------------------
[019] # Cedolan Dept. Rooftop
MapPosition = 0,13,10
#-------------------------------
[020] # Cedolan Dept. Elevator
MapPosition = 0,13,10
#-------------------------------
[021] # Route 2
Outdoor = true
ShowArea = true
Weather = Rain,100
MapPosition = 0,14,8
BattleBack = field
MapSize = 1,11
#-------------------------------
[023] # Lerucean Town
Outdoor = true
ShowArea = true
MapPosition = 0,15,8
#-------------------------------
[024] # Lerucean Town Poké Center
HealingSpot = 23,11,15
MapPosition = 0,15,8
#-------------------------------
[025] # Lerucean Town Mart
MapPosition = 0,15,8
#-------------------------------
[026] # Pokémon Fan Club
MapPosition = 0,15,8
#-------------------------------
[027] # Pokémon Day Care
MapPosition = 0,15,8
#-------------------------------
[028] # Natural Park
Outdoor = true
ShowArea = true
MapPosition = 0,16,8
BattleBack = field
Flags = MossRock
#-------------------------------
[029] # Natural Park Entrance
Bicycle = true
MapPosition = 0,16,8
#-------------------------------
[030] # Natural Park Pavillion
MapPosition = 0,16,8
#-------------------------------
[031] # Route 3
Outdoor = true
ShowArea = true
MapPosition = 0,14,6
BattleBack = field
MapSize = 2,1101
#-------------------------------
[034] # Ice Cave
Bicycle = true
MapPosition = 0,15,6
BattleBack = cave1
Environment = Cave
Flags = IceRock
#-------------------------------
[035] # Ingido Plateau
Outdoor = true
ShowArea = true
MapPosition = 0,13,6
#-------------------------------
[036] # Pokémon League
HealingSpot = 35,17,7
MapPosition = 0,13,6
#-------------------------------
[037] # Pokémon League
MapPosition = 0,13,6
BattleBack = elite1
Flags = DisableBoxLink
#-------------------------------
[038] # Hall of Fame
MapPosition = 0,13,6
Flags = DisableBoxLink
#-------------------------------
[039] # Route 4
Outdoor = true
ShowArea = true
MapPosition = 0,11,6
BattleBack = field
MapSize = 2,11
#-------------------------------
[040] # Route 4
Outdoor = true
ShowArea = true
BicycleAlways = true
MapPosition = 0,11,6
#-------------------------------
[041] # Route 5
Outdoor = true
ShowArea = true
BicycleAlways = true
MapPosition = 0,11,7
MapSize = 1,111
#-------------------------------
[044] # Route 6
Outdoor = true
ShowArea = true
MapPosition = 0,11,10
BattleBack = field
MapSize = 2,11
#-------------------------------
[045] # Route 6
Outdoor = true
ShowArea = true
BicycleAlways = true
MapPosition = 0,11,10
#-------------------------------
[046] # Cycling Road gate
Bicycle = true
MapPosition = 0,12,6
#-------------------------------
[047] # Route 7
Outdoor = true
ShowArea = true
Weather = Rain,0
MapPosition = 0,15,10
BattleBack = rocky
MapSize = 2,11
Environment = Rock
#-------------------------------
[049] # Rock Cave
Bicycle = true
MapPosition = 0,16,10
BattleBack = cave1
Environment = Cave
Flags = Magnetic
#-------------------------------
[050] # Rock Cave
Bicycle = true
MapPosition = 0,16,10
DarkMap = true
BattleBack = cave3
Environment = Cave
Flags = Magnetic
#-------------------------------
[051] # Dungeon
Bicycle = true
MapPosition = 0,16,10
Dungeon = true
BattleBack = cave2
Environment = Cave
Flags = Magnetic
#-------------------------------
[052] # Battle Frontier
Outdoor = true
ShowArea = true
MapPosition = 0,17,10
#-------------------------------
[053] # Battle Frontier Poké Center
HealingSpot = 52,17,14
MapPosition = 0,17,10
#-------------------------------
[054] # Battle Frontier Mart
MapPosition = 0,17,10
#-------------------------------
[055] # Battle Tower
HealingSpot = 52,30,10
MapPosition = 0,17,10
#-------------------------------
[056] # Battle Tower arena
MapPosition = 0,17,10
BattleBack = indoor1
Flags = DisableBoxLink
#-------------------------------
[057] # Stadium Cup lobby
MapPosition = 0,17,10
#-------------------------------
[058] # Battle Palace
MapPosition = 0,17,10
#-------------------------------
[059] # Battle Palace arena
MapPosition = 0,17,10
BattleBack = indoor1
Flags = DisableBoxLink
#-------------------------------
[060] # Battle Arena
MapPosition = 0,17,10
#-------------------------------
[061] # Battle Arena arena
MapPosition = 0,17,10
BattleBack = indoor1
Flags = DisableBoxLink
#-------------------------------
[062] # Battle Factory
MapPosition = 0,17,10
#-------------------------------
[063] # Battle Factory intro corridor
MapPosition = 0,17,10
Flags = DisableBoxLink
#-------------------------------
[064] # Battle Factory arena
MapPosition = 0,17,10
BattleBack = indoor1
Flags = DisableBoxLink
#-------------------------------
[065] # Battle Factory corridor
MapPosition = 0,17,10
Flags = DisableBoxLink
#-------------------------------
[066] # Safari Zone
Outdoor = true
ShowArea = true
MapPosition = 0,12,12
BattleBack = field
#-------------------------------
[067] # Safari Zone gate
MapPosition = 0,12,12
#-------------------------------
[068] # Safari Zone
Outdoor = true
ShowArea = true
MapPosition = 0,12,12
SafariMap = true
BattleBack = forest
Environment = Forest
#-------------------------------
[069] # Route 8
Outdoor = true
ShowArea = true
MapPosition = 0,13,13
DiveMap = 70
BattleBack = field
#-------------------------------
[070] # Underwater
MapPosition = 0,13,13
BattleBack = underwater
Environment = Underwater
#-------------------------------
[071] # Harbor
MapPosition = 0,13,13
#-------------------------------
[072] # Berth Island
Outdoor = true
ShowArea = true
Weather = Storm,50
MapPosition = 0,18,17
BattleBack = field
#-------------------------------
[073] # Faraday Island
Outdoor = true
ShowArea = true
MapPosition = 0,22,16
BattleBack = field
#-------------------------------
[074] # Cycling Road gate
Bicycle = true
MapPosition = 0,12,10
#-------------------------------
[075] # Tiall Region
Outdoor = true
MapPosition = 1,13,16
BattleBack = city

View File

@@ -1,6 +1,6 @@
# See the documentation on the wiki to learn how to edit this file. # See the documentation on the wiki to learn how to edit this file.
#------------------------------- #-------------------------------
[000] [0]
Home = 3,7,5,8 Home = 3,7,5,8
WildBattleBGM = Battle wild.mid WildBattleBGM = Battle wild.mid
TrainerBattleBGM = Battle trainer.mid TrainerBattleBGM = Battle trainer.mid
@@ -8,399 +8,19 @@ WildVictoryME = Battle victory wild.ogg
TrainerVictoryME = Battle victory trainer.ogg TrainerVictoryME = Battle victory trainer.ogg
SurfBGM = Surfing.mid SurfBGM = Surfing.mid
BicycleBGM = Bicycle.mid BicycleBGM = Bicycle.mid
PlayerA = POKEMONTRAINER_Red,trainer_POKEMONTRAINER_Red,boy_bike,boy_surf,boy_run,boy_surf,boy_fish_offset,boy_fish_offset
PlayerB = POKEMONTRAINER_Leaf,trainer_POKEMONTRAINER_Leaf,girl_bike,girl_surf,girl_run,girl_surf,girl_fish_offset,girl_fish_offset
#------------------------------- #-------------------------------
[001] [1]
# Intro TrainerType = POKEMONTRAINER_Red
#------------------------------- WalkCharset = trainer_POKEMONTRAINER_Red
[002] RunCharset = boy_run
# Lappet Town CycleCharset = boy_bike
Outdoor = true SurfCharset = boy_surf
ShowArea = true FishCharset = boy_fish_offset
MapPosition = 0,13,12 #-------------------------------
BattleBack = field [2]
#------------------------------- TrainerType = POKEMONTRAINER_Leaf
[003] WalkCharset = trainer_POKEMONTRAINER_Leaf
# \PN's house RunCharset = girl_run
HealingSpot = 2,8,8 CycleCharset = girl_bike
MapPosition = 0,13,12 SurfCharset = girl_surf
#------------------------------- FishCharset = girl_fish_offset
[004]
# Pokémon Lab
ShowArea = false
MapPosition = 0,13,12
#-------------------------------
[005]
# Route 1
Outdoor = true
ShowArea = true
MapPosition = 0,13,11
BattleBack = field
#-------------------------------
[006]
# Kurt's house
MapPosition = 0,13,11
#-------------------------------
[007]
# Cedolan City
Outdoor = true
ShowArea = true
MapPosition = 0,13,10
MapSize = 2,11
#-------------------------------
[008]
# Daisy's house
MapPosition = 0,13,12
#-------------------------------
[009]
# Cedolan City Poké Center
HealingSpot = 8,17,11
MapPosition = 0,14,10
#-------------------------------
[010]
# Cedolan Gym
MapPosition = 0,13,10
BattleBack = indoor3
Environment = Rock
Flags = DisableBoxLink
#-------------------------------
[011]
# Pokémon Institute
MapPosition = 0,14,10
#-------------------------------
[012]
# Cedolan City Condo
MapPosition = 0,14,10
#-------------------------------
[013]
# Game Corner
MapPosition = 0,14,10
#-------------------------------
[014]
# Cedolan Dept. 1F
MapPosition = 0,13,10
#-------------------------------
[015]
# Cedolan Dept. 2F
MapPosition = 0,13,10
#-------------------------------
[016]
# Cedolan Dept. 3F
MapPosition = 0,13,10
#-------------------------------
[017]
# Cedolan Dept. 4F
MapPosition = 0,13,10
#-------------------------------
[018]
# Cedolan Dept. 5F
MapPosition = 0,13,10
#-------------------------------
[019]
# Cedolan Dept. Rooftop
MapPosition = 0,13,10
#-------------------------------
[020]
# Cedolan Dept. Elevator
MapPosition = 0,13,10
#-------------------------------
[021]
# Route 2
Outdoor = true
ShowArea = true
Weather = Rain,100
MapPosition = 0,14,8
BattleBack = field
MapSize = 1,11
#-------------------------------
[023]
# Lerucean Town
Outdoor = true
ShowArea = true
MapPosition = 0,15,8
#-------------------------------
[024]
# Lerucean Town Poké Center
HealingSpot = 23,11,15
MapPosition = 0,15,8
#-------------------------------
[025]
# Lerucean Town Mart
MapPosition = 0,15,8
#-------------------------------
[026]
# Pokémon Fan Club
MapPosition = 0,15,8
#-------------------------------
[027]
# Pokémon Day Care
MapPosition = 0,15,8
#-------------------------------
[028]
# Natural Park
Outdoor = true
ShowArea = true
MapPosition = 0,16,8
BattleBack = field
Flags = MossRock
#-------------------------------
[029]
# Natural Park Entrance
Bicycle = true
MapPosition = 0,16,8
#-------------------------------
[030]
# Natural Park Pavillion
MapPosition = 0,16,8
#-------------------------------
[031]
# Route 3
Outdoor = true
ShowArea = true
MapPosition = 0,14,6
BattleBack = field
MapSize = 2,1101
#-------------------------------
[034]
# Ice Cave
Bicycle = true
MapPosition = 0,15,6
BattleBack = cave1
Environment = Cave
Flags = IceRock
#-------------------------------
[035]
# Ingido Plateau
Outdoor = true
ShowArea = true
MapPosition = 0,13,6
#-------------------------------
[036]
# Pokémon League
HealingSpot = 35,17,7
MapPosition = 0,13,6
#-------------------------------
[037]
# Pokémon League
MapPosition = 0,13,6
BattleBack = elite1
Flags = DisableBoxLink
#-------------------------------
[038]
# Hall of Fame
MapPosition = 0,13,6
Flags = DisableBoxLink
#-------------------------------
[039]
# Route 4
Outdoor = true
ShowArea = true
MapPosition = 0,11,6
BattleBack = field
MapSize = 2,11
#-------------------------------
[040]
# Route 4
Outdoor = true
ShowArea = true
BicycleAlways = true
MapPosition = 0,11,6
#-------------------------------
[041]
# Route 5
Outdoor = true
ShowArea = true
BicycleAlways = true
MapPosition = 0,11,7
MapSize = 1,111
#-------------------------------
[044]
# Route 6
Outdoor = true
ShowArea = true
MapPosition = 0,11,10
BattleBack = field
MapSize = 2,11
#-------------------------------
[045]
# Route 6
Outdoor = true
ShowArea = true
BicycleAlways = true
MapPosition = 0,11,10
#-------------------------------
[046]
# Cycling Road gate
Bicycle = true
MapPosition = 0,12,6
#-------------------------------
[047]
# Route 7
Outdoor = true
ShowArea = true
Weather = Rain,0
MapPosition = 0,15,10
BattleBack = rocky
MapSize = 2,11
Environment = Rock
#-------------------------------
[049]
# Rock Cave
Bicycle = true
MapPosition = 0,16,10
BattleBack = cave1
Environment = Cave
Flags = Magnetic
#-------------------------------
[050]
# Rock Cave
Bicycle = true
MapPosition = 0,16,10
DarkMap = true
BattleBack = cave3
Environment = Cave
Flags = Magnetic
#-------------------------------
[051]
# Dungeon
Bicycle = true
MapPosition = 0,16,10
Dungeon = true
BattleBack = cave2
Environment = Cave
Flags = Magnetic
#-------------------------------
[052]
# Battle Frontier
Outdoor = true
ShowArea = true
MapPosition = 0,17,10
#-------------------------------
[053]
# Battle Frontier Poké Center
HealingSpot = 52,17,14
MapPosition = 0,17,10
#-------------------------------
[054]
# Battle Frontier Mart
MapPosition = 0,17,10
#-------------------------------
[055]
# Battle Tower
HealingSpot = 52,30,10
MapPosition = 0,17,10
#-------------------------------
[056]
# Battle Tower arena
MapPosition = 0,17,10
BattleBack = indoor1
Flags = DisableBoxLink
#-------------------------------
[057]
# Stadium Cup lobby
MapPosition = 0,17,10
#-------------------------------
[058]
# Battle Palace
MapPosition = 0,17,10
#-------------------------------
[059]
# Battle Palace arena
MapPosition = 0,17,10
BattleBack = indoor1
Flags = DisableBoxLink
#-------------------------------
[060]
# Battle Arena
MapPosition = 0,17,10
#-------------------------------
[061]
# Battle Arena arena
MapPosition = 0,17,10
BattleBack = indoor1
Flags = DisableBoxLink
#-------------------------------
[062]
# Battle Factory
MapPosition = 0,17,10
#-------------------------------
[063]
# Battle Factory intro corridor
MapPosition = 0,17,10
Flags = DisableBoxLink
#-------------------------------
[064]
# Battle Factory arena
MapPosition = 0,17,10
BattleBack = indoor1
Flags = DisableBoxLink
#-------------------------------
[065]
# Battle Factory corridor
MapPosition = 0,17,10
Flags = DisableBoxLink
#-------------------------------
[066]
# Safari Zone
Outdoor = true
ShowArea = true
MapPosition = 0,12,12
BattleBack = field
#-------------------------------
[067]
# Safari Zone gate
MapPosition = 0,12,12
#-------------------------------
[068]
# Safari Zone
Outdoor = true
ShowArea = true
MapPosition = 0,12,12
SafariMap = true
BattleBack = forest
Environment = Forest
#-------------------------------
[069]
# Route 8
Outdoor = true
ShowArea = true
MapPosition = 0,13,13
DiveMap = 70
BattleBack = field
#-------------------------------
[070]
# Underwater
MapPosition = 0,13,13
BattleBack = underwater
Environment = Underwater
#-------------------------------
[071]
# Harbor
MapPosition = 0,13,13
#-------------------------------
[072]
# Berth Island
Outdoor = true
ShowArea = true
Weather = Storm,50
MapPosition = 0,18,17
BattleBack = field
#-------------------------------
[073]
# Faraday Island
Outdoor = true
ShowArea = true
MapPosition = 0,22,16
BattleBack = field
#-------------------------------
[074]
# Cycling Road gate
Bicycle = true
MapPosition = 0,12,10
#-------------------------------
[075]
# Tiall Region
Outdoor = true
MapPosition = 1,13,16
BattleBack = city