Tela De Título Avançada No RPG Maker XP

29 de julho de 2011

Advanced Title Screen é mais um script de SephirothSpawn para o RPG Maker XP. Este, quando inserido num projeto deste maker, permite sair do esquema tradicional de título, apenas com a figura. Ele permite que você adicione neblina (fog), panorama, clima e até mostrar um mapa. Se você quiser adicionar um mapa, você pode customizar que mapa para mostrar e/ou carregar um arquivo de save recente, e mostrar ao jogador na tela de título. Você deve colar o código abaixo do SDK e em cima do Main. Para customizar seu título, dê uma olhada nas instruções de customização.

#==============================================================================
# ** Advanced Title Screen
#------------------------------------------------------------------------------
# SephirothSpawn
# Version 1
# 2006-09-20
#------------------------------------------------------------------------------
# * Description :
#
#   This script was designed to break away from the tradional picture title
#   screen. It allows you to allow add fogs, panorama and weathers, as well as
#   showing a map. If you do show a map, you can customize which map to show
#   and / or load a recent save file, and show the player on the title screen.
#------------------------------------------------------------------------------
# * Instructions :
#
#   Place The Script Below the SDK and Above Main.
#   To Customize your title, refer to the customization instructions.
#------------------------------------------------------------------------------
# * Customization :
#
#   ** Map Options **
#
#    - Show_Map = true (ON) or false (Off)
#   If true, map will be displayed on title. Make sure you have no
#   background choose in the database or a file with clear spots.
#    - Load_Recent_Save = true (ON) or false (OFF)
#   If true, the data from the last save will be loaded. If no save file
#   is present, it loads defaults from below.
#   (The following will determine map, location and player image on the title
#   screen map.)
#    - Map_ID = 
#    - Player_X = player x position
#    - Player_Y = player y position
#    - Player_Image_Name = character sprite filename or nil
#    - Player_Image_HUe = character sprite hue
#
#
#   ** Panoarama Properties **
#
#    - Show_Panorama = true (ON) or false (OFF)
#    - Panorama_Name = 'Panorama File Name'
#    - Panorama_Hue = 0..360
#    - Panorama_Opacity = 0..255
#    - Panorama_Scroll_Direction = nil or scroll_direction
#
#
#   ** Fog Properties **
#
#    - Show_Fog = true (ON) or false (OFF)
#    - Fog_Name = 'Fog File Name'
#    - Fog_Hue = 0..360
#    - Fog_Opacity = 0..255
#    - Fog_Zoom_X = 0.0..oo
#    - Fog_Zoom_Y = 0.0..oo
#    - Fog_Scroll_Direction = nil or scroll_direction
#
#
#   ** Weather Properties **
#
#    - Show_Weather = true (ON) or false (OFF)
#    - Weather_Type = (0: none, 1: rain, 2: storm; 3: snow)
#    - Weather_Power_S = (0..40)
#    - Weather_Power_F = (0..40)
#
#   ** Scroll Directions **
#   'up', 'down', 'left', 'right', 'up-left', 
#   'up-right', 'down-left', 'down-right'
#==============================================================================

#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log('Advanced Title Screen', 'SephirothSpawn', 1, '2006-08-30')

#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
if SDK.state('Advanced Title Screen')

#==============================================================================
# ** Scene_Title
#==============================================================================

class Scene_Title
  #--------------------------------------------------------------------------
  # * Options
  #
  #  ~ Map Properties
  #    Show_Map = true (ON) or false (OFF)
  #    Load_Recent_Save = true (ON) or false (OFF)
  #    (The Following will be used if no save file is loaded)
  #    Map_ID = map_id
  #    Player_X = player x position
  #    Player_Y = player y position
  #    Player_Image_Name = character sprite filename
  #    Player_Image_Hue = charater sprite hue
  #
  #    (The following will work with or without the map on. You can have
  #    multiple panoramas, fogs and weather patterns with these overlaying
  #    the map based ones)
  #
  #  ~ Panoarama Properties
  #    Show_Panorama = true (ON) or false (OFF)
  #    (The Following will only matter if you show a panorama)
  #    Panorama_Name = 'Panorama File Name'
  #    Panorama_Hue = 0..360
  #    Panorama_Opacity = 0..255
  #    Panorama_Scroll_Direction = nil or scroll_direction
  #
  #  ~ Fog Properties
  #    Show_Fog = true (ON) or false (OFF)
  #    (The Following will only matter if you show a fog)
  #    Fog_Name = 'Fog File Name'
  #    Fog_Hue = 0..360
  #    Fog_Opacity = 0..255
  #    Fog_Zoom_X = 0.0..oo
  #    Fog_Zoom_Y = 0.0..oo
  #    Fog_Scroll_Direction = nil or scroll_direction
  #
  #  ~ Weather Properties
  #    Show_Weather = true (ON) or false (OFF)
  #    (The Following will only matter if you show a weather)
  #    Weather_Type = (0: none, 1: rain, 2: storm; 3: snow)
  #    Weather_Power_S = (0..40)
  #    Weather_Power_F = (0..40)
  #
  #  ~ Scroll Directions:
  #    'up', 'down', 'left', 'right', 'up-left', 
  #    'up-right', 'down-left', 'down-right'
  #--------------------------------------------------------------------------
  Show_Map = true            # true or false
  Load_Recent_Save = true    # true or false
  Map_ID = 1                 # map_id
  Player_X = 12              # map_x
  Player_Y = 10              # map_y
  Player_Image_Name = 0      # nil : No Image, 0 : Default, or character file
  Player_Image_Hue = 0       # 0 to 360
  #--------------------------------------------------------------------------
  Show_Panorama = true                     # true or false
  Panorama_Name = '001-Sky01'              # panorama filename
  Panorama_Hue = 0                         # 0 to 360
  Panorama_Opacity = 255                   # 0 to 255
  Panorama_Scroll_Direction = 'down-right' # scroll direction
  #--------------------------------------------------------------------------
  Show_Fog = true                 # true or false
  Fog_Name = '001-Fog01'          # fog filename
  Fog_Hue = 0                     # 0 to 360
  Fog_Opacity = 100               # 0 to 255
  Fog_Zoom_X = 1                  # Decimal Percent of Zoom
  Fog_Zoom_Y = 1                  # Decimal Percent of Zoom
  Fog_Scroll_Direction = 'right'  # scroll direction
  #--------------------------------------------------------------------------
  Show_Weather = true   # true or false
  Weather_Type = 2      # 0: none, 1: rain, 2: storm; 3: snow
  Weathor_Power_S = 0   # 0 to 40
  Weather_Power_F = 40  # 0 to 40
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias seph_advttlscn_scnttl_mbg    main_background
  alias seph_advttlscn_scnttl_mdis   main_dispose
  alias seph_advttlscn_scnttl_update update
  #--------------------------------------------------------------------------
  # * Background Initialization
  #--------------------------------------------------------------------------
  def main_background
    # Sets Up Map
    if Show_Map
      # If Load Data From File
      if Load_Recent_Save
        # Sets Up Save Times
        file_indexes = []
        save_times = []
        for i in 0..3
          if FileTest.exist?("Save#{i+1}.rxdata")
            file_indexes << i
            save_times << File.ctime("Save#{i+1}.rxdata")
          end
        end
        # If Save File Found
        if file_indexes.size > 0
          file_index = file_indexes[save_times.index(save_times.max)]
        end
      end
      # If File Index Found
      if file_index.nil?
        # Load Blank Data
        command_new_game
        # Make Scene Self
        $scene = self
        # Set up initial map position
        $game_map.setup(Map_ID)
        # Move player to initial position
        $game_player.moveto(Player_X, Player_Y)
        # Refresh player
        $game_player.refresh
        # Set Player Graphic
        if Player_Image_Name.nil?
          $game_player.character_name = ''
        elsif Player_Image_Name != 0
          $game_player.character_name = Player_Image_Name
        end
        unless Player_Image_Hue == 0
          $game_player.character_hue = Player_Image_Hue
        end
        # Run automatic change for BGM and BGS set with map
        $game_map.autoplay
        # Update map (run parallel process event)
        $game_map.update
      else
        # Loads Game Data From File
        load = Scene_Load.new
        # Read save data
        file = File.open(load.make_filename(file_index), "rb")
        load.read_save_data(file)
        file.close
        # Restore BGM and BGS
        $game_system.bgm_play($game_system.playing_bgm)
        $game_system.bgs_play($game_system.playing_bgs)
        # Update map (run parallel process event)
        $game_map.update
      end
      # Sets Up Spriteset Map
      @spriteset = Spriteset_Map.new
    end
    # Original Main Background Initialization
    seph_advttlscn_scnttl_mbg
    # Sets Up Panorama
    if Show_Panorama
      @panorama = Plane.new
      @panorama.bitmap = RPG::Cache.panorama(Panorama_Name, Panorama_Hue)
      @panorama.z -= 1000
      @panorama.opacity = Panorama_Opacity
    end
    # Sets Up Fog
    if Show_Fog
      @fog = Plane.new
      @fog.bitmap = RPG::Cache.fog(Fog_Name, Fog_Hue)
      @fog.zoom_x = Fog_Zoom_X
      @fog.z = 3000
      @fog.zoom_y = Fog_Zoom_Y
      @fog.opacity = Fog_Opacity
    end
    # Sets Up Weather
    if Show_Weather
      # Make weather
      @weather = RPG::Weather.new
      @weather.type = Weather_Type
      @weather.max = Weathor_Power_S
    end
  end
  #--------------------------------------------------------------------------
  # * Main Dispose
  #--------------------------------------------------------------------------
  def main_dispose
    # Original Main Dispose Method
    seph_advttlscn_scnttl_mdis
    # Disposes Panorama, Fog & Weather
    [@panorama, @fog, @weather].each {|x| x.dispose unless x.nil?}
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Original Update Method
    seph_advttlscn_scnttl_update
    # Updates Panorama Scrolling
    unless @panorama.nil?
      if Panorama_Scroll_Direction.upcase.include?('UP')
        @panorama.oy += 4
      end
      if Panorama_Scroll_Direction.upcase.include?('DOWN')
        @panorama.oy -= 4
      end
      if Panorama_Scroll_Direction.upcase.include?('RIGHT')
        @panorama.ox -= 4
      end
      if Panorama_Scroll_Direction.upcase.include?('LEFT')
        @panorama.ox += 4
      end
    end
    # Updates Fog Scrolling
    unless @fog.nil?
      if Fog_Scroll_Direction.upcase.include?('UP')
        @fog.oy += 4
      end
      if Fog_Scroll_Direction.upcase.include?('DOWN')
        @fog.oy -= 4
      end
      if Fog_Scroll_Direction.upcase.include?('RIGHT')
        @fog.ox -= 4
      end
      if Fog_Scroll_Direction.upcase.include?('LEFT')
        @fog.ox += 4
      end
    end
    # Update Weather
    unless @weather.nil?
      @weather.max += 1 if @weather.max < Weather_Power_F
      @weather.update
    end
  end
end

#==============================================================================
# ** Game_Character
#==============================================================================

class Game_Character
  attr_accessor :character_name
  attr_accessor :character_hue
end

#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end

Observação: se você gostou deste post ou ele lhe foi útil de alguma forma, por favor considere apoiar financeiramente a Gaming Room. Fico feliz só de ajudar, mas a contribuição do visitante é muito importante para que este site continua existindo e para que eu possa continuar provendo este tipo de conteúdo e melhorar cada vez mais. Clique aqui e saiba como. Obrigado!

Deixe um comentário

Inscreva-se na nossa newsletter!