diff --git a/Data/Scripts/002_Save data/005_Game_SaveConversions.rb b/Data/Scripts/002_Save data/005_Game_SaveConversions.rb index 10fa0e720..e2a26324d 100644 --- a/Data/Scripts/002_Save data/005_Game_SaveConversions.rb +++ b/Data/Scripts/002_Save data/005_Game_SaveConversions.rb @@ -161,3 +161,11 @@ SaveData.register_conversion(:v20_follower_data) do global.dependentEvents = nil 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 diff --git a/Data/Scripts/004_Game classes/009_Game_Player.rb b/Data/Scripts/004_Game classes/009_Game_Player.rb index 82fa35883..91c659523 100644 --- a/Data/Scripts/004_Game classes/009_Game_Player.rb +++ b/Data/Scripts/004_Game classes/009_Game_Player.rb @@ -48,31 +48,31 @@ class Game_Player < Game_Character end 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 case type when :fishing - new_charset = pbGetPlayerCharset(meta, 6) + new_charset = pbGetPlayerCharset(meta.fish_charset) when :surf_fishing - new_charset = pbGetPlayerCharset(meta, 7) + new_charset = pbGetPlayerCharset(meta.surf_fish_charset) when :diving, :diving_fast, :diving_jumping, :diving_stopped self.move_speed = 3 - new_charset = pbGetPlayerCharset(meta, 5) + new_charset = pbGetPlayerCharset(meta.dive_charset) when :surfing, :surfing_fast, :surfing_jumping, :surfing_stopped 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 self.move_speed = (type == :cycling_jumping) ? 3 : 5 - new_charset = pbGetPlayerCharset(meta, 2) + new_charset = pbGetPlayerCharset(meta.cycle_charset) when :running self.move_speed = 4 - new_charset = pbGetPlayerCharset(meta, 4) + new_charset = pbGetPlayerCharset(meta.run_charset) when :ice_sliding self.move_speed = 4 - new_charset = pbGetPlayerCharset(meta, 1) + new_charset = pbGetPlayerCharset(meta.walk_charset) else # :walking, :jumping, :walking_stopped self.move_speed = 3 - new_charset = pbGetPlayerCharset(meta, 1) + new_charset = pbGetPlayerCharset(meta.walk_charset) end @character_name = new_charset if new_charset 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 outfit = (trainer) ? trainer.outfit : 0 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[2] == outfit end - $game_player.charsetData = [$Trainer.character_ID,charset,outfit] if $game_player - ret = meta[charset] - ret = meta[1] if nil_or_empty?(ret) + $game_player.charsetData = [trainer.character_ID, charset,outfit] if $game_player + ret = charset if pbResolveBitmap("Graphics/Characters/"+ret+"_"+outfit.to_s) ret = ret+"_"+outfit.to_s end diff --git a/Data/Scripts/010_Data/001_GameData.rb b/Data/Scripts/010_Data/001_GameData.rb index 3d75e2633..63d4e4662 100644 --- a/Data/Scripts/010_Data/001_GameData.rb +++ b/Data/Scripts/010_Data/001_GameData.rb @@ -235,6 +235,7 @@ module GameData TrainerType.load Trainer.load Metadata.load + PlayerMetadata.load MapMetadata.load end end diff --git a/Data/Scripts/010_Data/002_PBS data/014_Metadata.rb b/Data/Scripts/010_Data/002_PBS data/014_Metadata.rb index e4d426366..c9dc67d7f 100644 --- a/Data/Scripts/010_Data/002_PBS data/014_Metadata.rb +++ b/Data/Scripts/010_Data/002_PBS data/014_Metadata.rb @@ -9,14 +9,6 @@ module GameData attr_reader :wild_capture_ME attr_reader :surf_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_FILENAME = "metadata.dat" @@ -29,15 +21,7 @@ module GameData "TrainerVictoryME" => [5, "s"], "WildCaptureME" => [6, "s"], "SurfBGM" => [7, "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] + "BicycleBGM" => [8, "s"] } extend ClassMethodsIDNumbers @@ -52,15 +36,7 @@ module GameData ["TrainerVictoryME", MEProperty, _INTL("Default ME played after winning a Trainer battle.")], ["WildCaptureME", MEProperty, _INTL("Default ME played after catching a Pokémon.")], ["SurfBGM", BGMProperty, _INTL("BGM played while surfing.")], - ["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.")] + ["BicycleBGM", BGMProperty, _INTL("BGM played while on a bicycle.")] ] end @@ -68,20 +44,6 @@ module GameData return DATA[0] 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) @id = hash[:id] @home = hash[:home] @@ -92,14 +54,6 @@ module GameData @wild_capture_ME = hash[:wild_capture_ME] @surf_BGM = hash[:surf_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 def property_from_string(str) @@ -112,14 +66,6 @@ module GameData when "WildCaptureME" then return @wild_capture_ME when "SurfBGM" then return @surf_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 return nil end diff --git a/Data/Scripts/010_Data/002_PBS data/015_PlayerMetadata.rb b/Data/Scripts/010_Data/002_PBS data/015_PlayerMetadata.rb new file mode 100644 index 000000000..f2defa03e --- /dev/null +++ b/Data/Scripts/010_Data/002_PBS data/015_PlayerMetadata.rb @@ -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 diff --git a/Data/Scripts/010_Data/002_PBS data/015_MapMetadata.rb b/Data/Scripts/010_Data/002_PBS data/016_MapMetadata.rb similarity index 100% rename from Data/Scripts/010_Data/002_PBS data/015_MapMetadata.rb rename to Data/Scripts/010_Data/002_PBS data/016_MapMetadata.rb diff --git a/Data/Scripts/015_Trainers and player/004_Player.rb b/Data/Scripts/015_Trainers and player/004_Player.rb index 0d06af339..e3cf8b5d0 100644 --- a/Data/Scripts/015_Trainers and player/004_Player.rb +++ b/Data/Scripts/015_Trainers and player/004_Player.rb @@ -33,7 +33,7 @@ class Player < Trainer def trainer_type 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 return @trainer_type end @@ -90,7 +90,7 @@ class Player < Trainer def initialize(name, trainer_type) super - @character_ID = -1 + @character_ID = 0 @outfit = 0 @badges = [false] * 8 @money = Settings::INITIAL_MONEY diff --git a/Data/Scripts/016_UI/013_UI_Load.rb b/Data/Scripts/016_UI/013_UI_Load.rb index e0a6657c6..d9a31617e 100644 --- a/Data/Scripts/016_UI/013_UI_Load.rb +++ b/Data/Scripts/016_UI/013_UI_Load.rb @@ -163,9 +163,9 @@ class PokemonLoad_Scene def pbSetParty(trainer) return if !trainer || !trainer.party - meta = GameData::Metadata.get_player(trainer.character_ID) + meta = GameData::PlayerMetadata.get(trainer.character_ID) if meta - filename = pbGetPlayerCharset(meta,1,trainer,true) + filename = pbGetPlayerCharset(meta.walk_charset, trainer, true) @sprites["player"] = TrainerWalkingCharSprite.new(filename,@viewport) charwidth = @sprites["player"].bitmap.width charheight = @sprites["player"].bitmap.height diff --git a/Data/Scripts/016_UI/024_UI_TextEntry.rb b/Data/Scripts/016_UI/024_UI_TextEntry.rb index 73ce37c6e..666dd3a00 100644 --- a/Data/Scripts/016_UI/024_UI_TextEntry.rb +++ b/Data/Scripts/016_UI/024_UI_TextEntry.rb @@ -120,13 +120,13 @@ class PokemonEntryScene addBackgroundPlane(@sprites,"background","Naming/bg_2",@viewport) case subject when 1 # Player - meta=GameData::Metadata.get_player($Trainer.character_ID) + meta = GameData::PlayerMetadata.get($Trainer.character_ID) if meta @sprites["shadow"]=IconSprite.new(0,0,@viewport) @sprites["shadow"].setBitmap("Graphics/Pictures/Naming/icon_shadow") @sprites["shadow"].x=33*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) charwidth=@sprites["subject"].bitmap.width charheight=@sprites["subject"].bitmap.height @@ -405,13 +405,13 @@ class PokemonEntryScene2 @sprites["bg"].setBitmap("Graphics/Pictures/Naming/bg") case subject when 1 # Player - meta = GameData::Metadata.get_player($Trainer.character_ID) + meta = GameData::PlayerMetadata.get($Trainer.character_ID) if meta @sprites["shadow"] = IconSprite.new(0, 0, @viewport) @sprites["shadow"].setBitmap("Graphics/Pictures/Naming/icon_shadow") @sprites["shadow"].x = 66 @sprites["shadow"].y = 64 - filename = pbGetPlayerCharset(meta, 1, nil, true) + filename = pbGetPlayerCharset(meta.walk_charset, nil, true) @sprites["subject"] = TrainerWalkingCharSprite.new(filename, @viewport) charwidth = @sprites["subject"].bitmap.width charheight = @sprites["subject"].bitmap.height diff --git a/Data/Scripts/019_Utilities/001_Utilities.rb b/Data/Scripts/019_Utilities/001_Utilities.rb index 7cd784be4..48e27f5ad 100644 --- a/Data/Scripts/019_Utilities/001_Utilities.rb +++ b/Data/Scripts/019_Utilities/001_Utilities.rb @@ -209,10 +209,10 @@ end # Unused def pbGetPlayerGraphic id = $Trainer.character_ID - return "" if id < 0 || id >= 8 - meta = GameData::Metadata.get_player(id) + return "" if id < 1 + meta = GameData::PlayerMetadata.get(id) return "" if !meta - return GameData::TrainerType.player_front_sprite_filename(meta[0]) + return GameData::TrainerType.player_front_sprite_filename(meta.trainer_type) end def pbGetTrainerTypeGender(trainer_type) @@ -220,21 +220,21 @@ def pbGetTrainerTypeGender(trainer_type) end def pbChangePlayer(id) - return false if id < 0 || id >= 8 - meta = GameData::Metadata.get_player(id) + return false if id < 1 + meta = GameData::PlayerMetadata.get(id) return false if !meta $Trainer.character_ID = id - $Trainer.trainer_type = meta[0] - $game_player.character_name = meta[1] + $Trainer.trainer_type = meta.trainer_type + $game_player.character_name = meta.walk_charset end def pbTrainerName(name = nil, outfit = 0) - pbChangePlayer(0) if $Trainer.character_ID < 0 + pbChangePlayer(1) if $Trainer.character_ID < 1 if name.nil? name = pbEnterPlayerName(_INTL("Your name?"), 0, Settings::MAX_PLAYER_NAME_SIZE) if name.nil? || name.empty? - player_metadata = GameData::Metadata.get_player($Trainer.character_ID) - trainer_type = (player_metadata) ? player_metadata[0] : nil + player_metadata = GameData::PlayerMetadata.get($Trainer.character_ID) + trainer_type = (player_metadata) ? player_metadata.trainer_type : nil gender = pbGetTrainerTypeGender(trainer_type) name = pbSuggestTrainerName(gender) end diff --git a/Data/Scripts/020_Debug/001_Editor screens/001_EditorScreens.rb b/Data/Scripts/020_Debug/001_Editor screens/001_EditorScreens.rb index 4a424deb3..19095ba70 100644 --- a/Data/Scripts/020_Debug/001_Editor screens/001_EditorScreens.rb +++ b/Data/Scripts/020_Debug/001_Editor screens/001_EditorScreens.rb @@ -710,86 +710,143 @@ end #=============================================================================== # Metadata editor #=============================================================================== -def pbMetadataScreen(map_id = 0) +def pbMetadataScreen + sel_player = -1 loop do - map_id = pbListScreen(_INTL("SET METADATA"), MapLister.new(map_id, true)) - break if map_id < 0 - pbEditMetadata(map_id) + sel_player = pbListScreen(_INTL("SET METADATA"), MetadataLister.new(sel_player, true)) + break if sel_player == -1 + 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 -def pbEditMetadata(map_id = 0) +def pbEditMetadata + data = [] + metadata = GameData::Metadata.get + properties = GameData::Metadata.editor_properties + properties.each do |property| + data.push(metadata.property_from_string(property[0])) + end + if pbPropertyList(_INTL("Global Metadata"), data, properties, true) + # Construct metadata hash + metadata_hash = { + :id => 0, + :home => data[0], + :wild_battle_BGM => data[1], + :trainer_battle_BGM => data[2], + :wild_victory_ME => data[3], + :trainer_victory_ME => data[4], + :wild_capture_ME => data[5], + :surf_BGM => data[6], + :bicycle_BGM => data[7] + } + # Add metadata's data to records + GameData::Metadata.register(metadata_hash) + GameData::Metadata.save + Compiler.write_metadata + 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 = [] - if map_id == 0 # Global metadata - map_name = _INTL("Global Metadata") - metadata = GameData::Metadata.get - 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 + 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) - if map_id == 0 # Global metadata - # Construct metadata hash - metadata_hash = { - :id => map_id, - :home => data[0], - :wild_battle_BGM => data[1], - :trainer_battle_BGM => data[2], - :wild_victory_ME => data[3], - :trainer_victory_ME => data[4], - :wild_capture_ME => data[5], - :surf_BGM => data[6], - :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 - GameData::Metadata.register(metadata_hash) - GameData::Metadata.save - else # Map metadata - # Construct metadata hash - metadata_hash = { - :id => map_id, - :outdoor_map => data[0], - :announce_location => data[1], - :can_bicycle => data[2], - :always_bicycle => data[3], - :teleport_destination => data[4], - :weather => data[5], - :town_map_position => data[6], - :dive_map_id => data[7], - :dark_map => data[8], - :safari_map => data[9], - :snap_edges => data[10], - :random_dungeon => data[11], - :battle_background => data[12], - :wild_battle_BGM => data[13], - :trainer_battle_BGM => data[14], - :wild_victory_ME => data[15], - :trainer_victory_ME => data[16], - :wild_capture_ME => data[17], - :town_map_size => data[18], - :battle_environment => data[19], - :flags => data[20] - } - # Add metadata's data to records - GameData::MapMetadata.register(metadata_hash) - GameData::MapMetadata.save - end - Compiler.write_metadata + # Construct map metadata hash + metadata_hash = { + :id => map_id, + :outdoor_map => data[0], + :announce_location => data[1], + :can_bicycle => data[2], + :always_bicycle => data[3], + :teleport_destination => data[4], + :weather => data[5], + :town_map_position => data[6], + :dive_map_id => data[7], + :dark_map => data[8], + :safari_map => data[9], + :snap_edges => data[10], + :random_dungeon => data[11], + :battle_background => data[12], + :wild_battle_BGM => data[13], + :trainer_battle_BGM => data[14], + :wild_victory_ME => data[15], + :trainer_victory_ME => data[16], + :wild_capture_ME => data[17], + :town_map_size => data[18], + :battle_environment => data[19], + :flags => data[20] + } + # Add map metadata's data to records + GameData::MapMetadata.register(metadata_hash) + GameData::MapMetadata.save + Compiler.write_map_metadata end end diff --git a/Data/Scripts/020_Debug/001_Editor screens/003_EditorScreens_MapConnections.rb b/Data/Scripts/020_Debug/001_Editor screens/003_EditorScreens_MapConnections.rb index 4846ab0d0..91765b23a 100644 --- a/Data/Scripts/020_Debug/001_Editor screens/003_EditorScreens_MapConnections.rb +++ b/Data/Scripts/020_Debug/001_Editor screens/003_EditorScreens_MapConnections.rb @@ -219,7 +219,7 @@ class MapScreenScene end 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 # Returns the maps within _keys_ that are directly connected to this map, _map_. @@ -385,7 +385,7 @@ class MapScreenScene end def onDoubleClick(map_id) - pbEditMetadata(map_id) if map_id > 0 + pbEditMapMetadata(map_id) if map_id > 0 end def onClick(mapid,x,y) diff --git a/Data/Scripts/020_Debug/002_Editor_DataTypes.rb b/Data/Scripts/020_Debug/002_Editor_DataTypes.rb index a3d7c459c..3bdf65707 100644 --- a/Data/Scripts/020_Debug/002_Editor_DataTypes.rb +++ b/Data/Scripts/020_Debug/002_Editor_DataTypes.rb @@ -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 def self.set(settingname,oldsetting) oldsetting = [0,""] if !oldsetting diff --git a/Data/Scripts/020_Debug/003_Debug menus/002_Debug_MenuCommands.rb b/Data/Scripts/020_Debug/003_Debug menus/002_Debug_MenuCommands.rb index d508ae77b..7048fa9bc 100644 --- a/Data/Scripts/020_Debug/003_Debug menus/002_Debug_MenuCommands.rb +++ b/Data/Scripts/020_Debug/003_Debug menus/002_Debug_MenuCommands.rb @@ -808,24 +808,22 @@ DebugMenuCommands.register("setplayer", { "name" => _INTL("Set Player Character"), "description" => _INTL("Edit the player's character, as defined in \"metadata.txt\"."), "effect" => proc { - limit = 0 - for i in 0...8 - meta = GameData::Metadata.get_player(i) - next if meta - limit = i + index = 0 + cmds = [] + ids = [] + GameData::PlayerMetadata.each do |player| + 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 end - if limit <= 1 - pbMessage(_INTL("There is only one player defined.")) - else - 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.")) - end + cmd = pbShowCommands(nil, cmds, -1, index) + if cmd >= 0 && cmd != index + pbChangePlayer(ids[cmd]) + pbMessage(_INTL("The player character was changed.")) end } }) @@ -887,10 +885,20 @@ DebugMenuCommands.register("editorsmenu", { DebugMenuCommands.register("setmetadata", { "parent" => "editorsmenu", "name" => _INTL("Edit Metadata"), - "description" => _INTL("Edit global and map metadata."), + "description" => _INTL("Edit global metadata and player character metadata."), "always_show" => true, "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", "items.txt", "map_connections.txt", + "map_metadata.txt", "metadata.txt", "moves.txt", "phone.txt", @@ -1135,18 +1144,19 @@ DebugMenuCommands.register("createpbs", { when 4 then Compiler.write_encounters when 5 then Compiler.write_items when 6 then Compiler.write_connections - when 7 then Compiler.write_metadata - when 8 then Compiler.write_moves - when 9 then Compiler.write_phone - when 10 then Compiler.write_pokemon - when 11 then Compiler.write_pokemon_forms - when 12 then Compiler.write_regional_dexes - when 13 then Compiler.write_ribbons - when 14 then Compiler.write_shadow_movesets - when 15 then Compiler.write_town_map - when 16 then Compiler.write_trainer_types - when 17 then Compiler.write_trainers - when 18 then Compiler.write_types + when 7 then Compiler.write_map_metadata + when 8 then Compiler.write_metadata + when 9 then Compiler.write_moves + when 10 then Compiler.write_phone + when 11 then Compiler.write_pokemon + when 12 then Compiler.write_pokemon_forms + when 13 then Compiler.write_regional_dexes + when 14 then Compiler.write_ribbons + when 15 then Compiler.write_shadow_movesets + when 16 then Compiler.write_town_map + when 17 then Compiler.write_trainer_types + when 18 then Compiler.write_trainers + when 19 then Compiler.write_types else break end pbMessage(_INTL("File written.")) diff --git a/Data/Scripts/020_Debug/003_Editor_Listers.rb b/Data/Scripts/020_Debug/003_Editor_Listers.rb index 3bfb79e1d..7b530e4f7 100644 --- a/Data/Scripts/020_Debug/003_Editor_Listers.rb +++ b/Data/Scripts/020_Debug/003_Editor_Listers.rb @@ -254,6 +254,51 @@ class MusicFileLister 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 + #=============================================================================== # #=============================================================================== diff --git a/Data/Scripts/021_Compiler/001_Compiler.rb b/Data/Scripts/021_Compiler/001_Compiler.rb index f72288f0b..59a845849 100644 --- a/Data/Scripts/021_Compiler/001_Compiler.rb +++ b/Data/Scripts/021_Compiler/001_Compiler.rb @@ -102,6 +102,7 @@ module Compiler line = line[3,line.length-3] end if !line[/^\#/] && !line[/^\s*$/] + line = prepline(line) if line[/^\s*\[\s*(.*)\s*\]\s*$/] # Of the format: [something] yield lastsection,sectionname if havesection sectionname = $~[1] @@ -134,7 +135,7 @@ module Compiler } end - # Used for metadata.txt + # Used for metadata.txt and map_metadata.txt def pbEachFileSectionNumbered(f) pbEachFileSectionEx(f) { |section,name| yield section,name.to_i if block_given? && name[/^\d+$/] @@ -547,11 +548,11 @@ module Compiler def pbWriteCsvRecord(record,file,schema) rec = (record.is_a?(Array)) ? record.flatten : [record] start = (schema[1][0, 1] == "*") ? 1 : 0 - index = 0 + index = -1 begin for i in start...schema[1].length index += 1 - file.write(",") if index > 1 + file.write(",") if index > 0 value = rec[index] if value.nil? # do nothing @@ -613,7 +614,7 @@ module Compiler file.write(value.inspect) end end - break if start > 0 && index >= rec.length + break if start > 0 && index >= rec.length - 1 end while start > 0 return record end @@ -739,6 +740,8 @@ module Compiler compile_trainer_lists # Depends on TrainerType yield(_INTL("Compiling metadata")) compile_metadata # Depends on TrainerType + yield(_INTL("Compiling map metadata")) + compile_map_metadata # No dependencies yield(_INTL("Compiling animations")) compile_animations yield("") @@ -766,6 +769,7 @@ module Compiler "metadata.dat", "moves.dat", "phone.dat", + "player_metadata.dat", "regional_dexes.dat", "ribbons.dat", "shadow_movesets.dat", diff --git a/Data/Scripts/021_Compiler/002_Compiler_CompilePBS.rb b/Data/Scripts/021_Compiler/002_Compiler_CompilePBS.rb index 5e9224936..e0803c277 100644 --- a/Data/Scripts/021_Compiler/002_Compiler_CompilePBS.rb +++ b/Data/Scripts/021_Compiler/002_Compiler_CompilePBS.rb @@ -1397,22 +1397,22 @@ module Compiler #============================================================================= def compile_metadata(path = "PBS/metadata.txt") GameData::Metadata::DATA.clear - GameData::MapMetadata::DATA.clear + GameData::PlayerMetadata::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). - pbEachFileSectionNumbered(f) { |contents, map_id| - schema = (map_id == 0) ? GameData::Metadata::SCHEMA : GameData::MapMetadata::SCHEMA + pbEachFileSectionNumbered(f) { |contents, section_id| + schema = (section_id == 0) ? GameData::Metadata::SCHEMA : GameData::PlayerMetadata::SCHEMA # 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 + FileLineData.setSection(section_id, key, contents[key]) # For error reporting # Skip empty properties, or raise an error if a required property is # empty 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) end next @@ -1422,10 +1422,10 @@ module Compiler value = nil if value.is_a?(Array) && value.length == 0 contents[key] = value end - if map_id == 0 # Global metadata + if section_id == 0 # Metadata # Construct metadata hash metadata_hash = { - :id => map_id, + :id => section_id, :home => contents["Home"], :wild_battle_BGM => contents["WildBattleBGM"], :trainer_battle_BGM => contents["TrainerBattleBGM"], @@ -1433,51 +1433,90 @@ module Compiler :trainer_victory_ME => contents["TrainerVictoryME"], :wild_capture_ME => contents["WildCaptureME"], :surf_BGM => contents["SurfBGM"], - :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"] + :bicycle_BGM => contents["BicycleBGM"] } # Add metadata's data to records GameData::Metadata.register(metadata_hash) - else # Map metadata + else # Player metadata # Construct metadata hash metadata_hash = { - :id => map_id, - :outdoor_map => contents["Outdoor"], - :announce_location => contents["ShowArea"], - :can_bicycle => contents["Bicycle"], - :always_bicycle => contents["BicycleAlways"], - :teleport_destination => contents["HealingSpot"], - :weather => contents["Weather"], - :town_map_position => contents["MapPosition"], - :dive_map_id => contents["DiveMap"], - :dark_map => contents["DarkMap"], - :safari_map => contents["SafariMap"], - :snap_edges => contents["SnapEdges"], - :random_dungeon => contents["Dungeon"], - :battle_background => contents["BattleBack"], - :wild_battle_BGM => contents["WildBattleBGM"], - :trainer_battle_BGM => contents["TrainerBattleBGM"], - :wild_victory_ME => contents["WildVictoryME"], - :trainer_victory_ME => contents["TrainerVictoryME"], - :wild_capture_ME => contents["WildCaptureME"], - :town_map_size => contents["MapSize"], - :battle_environment => contents["Environment"], - :flags => contents["Flags"] + :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::MapMetadata.register(metadata_hash) + 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 = { + :id => map_id, + :outdoor_map => contents["Outdoor"], + :announce_location => contents["ShowArea"], + :can_bicycle => contents["Bicycle"], + :always_bicycle => contents["BicycleAlways"], + :teleport_destination => contents["HealingSpot"], + :weather => contents["Weather"], + :town_map_position => contents["MapPosition"], + :dive_map_id => contents["DiveMap"], + :dark_map => contents["DarkMap"], + :safari_map => contents["SafariMap"], + :snap_edges => contents["SnapEdges"], + :random_dungeon => contents["Dungeon"], + :battle_background => contents["BattleBack"], + :wild_battle_BGM => contents["WildBattleBGM"], + :trainer_battle_BGM => contents["TrainerBattleBGM"], + :wild_victory_ME => contents["WildVictoryME"], + :trainer_victory_ME => contents["TrainerVictoryME"], + :wild_capture_ME => contents["WildCaptureME"], + :town_map_size => contents["MapSize"], + :battle_environment => contents["Environment"], + :flags => contents["Flags"] + } + # Add map metadata's data to records + GameData::MapMetadata.register(metadata_hash) + } + } + # Save all data GameData::MapMetadata.save Graphics.update end diff --git a/Data/Scripts/021_Compiler/003_Compiler_WritePBS.rb b/Data/Scripts/021_Compiler/003_Compiler_WritePBS.rb index 3e99f987d..9081df675 100644 --- a/Data/Scripts/021_Compiler/003_Compiler_WritePBS.rb +++ b/Data/Scripts/021_Compiler/003_Compiler_WritePBS.rb @@ -738,32 +738,57 @@ module Compiler def write_metadata File.open("PBS/metadata.txt", "wb") { |f| add_PBS_header_to_file(f) - # Write global metadata + # Write metadata f.write("\#-------------------------------\r\n") - f.write("[000]\r\n") + f.write("[0]\r\n") metadata = GameData::Metadata.get 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 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)) pbWriteCsvRecord(record, f, schema[key]) f.write("\r\n") end - # Write map metadata - map_infos = pbLoadMapInfos - schema = GameData::MapMetadata::SCHEMA - keys = schema.keys.sort {|a, b| schema[a][0] <=> schema[b][0] } + # 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 + schema = GameData::MapMetadata::SCHEMA + 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| f.write("\#-------------------------------\r\n") - 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)) + 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)) end for key in keys 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)) pbWriteCsvRecord(record, f, schema[key]) f.write("\r\n") @@ -795,5 +820,6 @@ module Compiler write_trainers write_trainer_lists write_metadata + write_map_metadata end end diff --git a/PBS/map_metadata.txt b/PBS/map_metadata.txt new file mode 100644 index 000000000..c633335a8 --- /dev/null +++ b/PBS/map_metadata.txt @@ -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 diff --git a/PBS/metadata.txt b/PBS/metadata.txt index 3511023bb..544383ff6 100644 --- a/PBS/metadata.txt +++ b/PBS/metadata.txt @@ -1,6 +1,6 @@ # See the documentation on the wiki to learn how to edit this file. #------------------------------- -[000] +[0] Home = 3,7,5,8 WildBattleBGM = Battle wild.mid TrainerBattleBGM = Battle trainer.mid @@ -8,399 +8,19 @@ WildVictoryME = Battle victory wild.ogg TrainerVictoryME = Battle victory trainer.ogg SurfBGM = Surfing.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] -# 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 +[1] +TrainerType = POKEMONTRAINER_Red +WalkCharset = trainer_POKEMONTRAINER_Red +RunCharset = boy_run +CycleCharset = boy_bike +SurfCharset = boy_surf +FishCharset = boy_fish_offset +#------------------------------- +[2] +TrainerType = POKEMONTRAINER_Leaf +WalkCharset = trainer_POKEMONTRAINER_Leaf +RunCharset = girl_run +CycleCharset = girl_bike +SurfCharset = girl_surf +FishCharset = girl_fish_offset