设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 2816|回复: 2
打印 上一主题 下一主题

[已经过期] 请问如何更改存档目录

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
47 小时
注册时间
2012-12-12
帖子
83
跳转到指定楼层
1
 楼主| 发表于 2013-1-17 21:59:23 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x

想类似于截图存档一样,放在Save文件夹下

这是脚本

#==============================================================================
# ** Scene_File
#------------------------------------------------------------------------------
#  This class performs the save and load screen processing.
#==============================================================================

#==============================================================================
# MOG VX - Scene File V1.0
#==============================================================================
# By Moghunter
# http://www.atelier-rgss.com/
#==============================================================================
# Tela de salvar e carregar animado.
#==============================================================================
# 1 - Crie uma pasta com o nome de Graphics/Mennus e coloque as seguintes
#     imagens dentro desta pasta.
#
# Background.png
# Save_Character_Floor.png
# Save_Layout01.png
# Save_Layout02.png
# Save_Window01.png
# Save_Window02.png
#
# 2 - Será necessário ter a seguinte imagem na pasta Graphics/System
#
# Number_01.png
#
#==============================================================================
module MOG_VX08
  #Quantidade de slots de saves.
  FILES_MAX = 9
end

#==============================================================================
# ** Window_Base
#==============================================================================
class Window_Base < Window
  
  #--------------------------------------------------------------------------
  # ● draw_picture_number(x,y,value,file_name,align, space, frame_max ,frame_index)     
  #--------------------------------------------------------------------------
  # X - Posição na horizontal
  # Y - Posição na vertical
  # VALUE - Valor Numérico
  # FILE_NAME - Nome do arquivo
  # ALIGN - Centralizar 0 - Esquerda 1- Centro 2 - Direita  
  # SPACE - Espaço entre os números.
  # FRAME_MAX - Quantidade de quadros(Linhas) que a imagem vai ter.
  # FRAME_INDEX - Definição do quadro a ser utilizado.
  #--------------------------------------------------------------------------  
  def draw_picture_number(x,y,value, file_name,align = 0, space = 0, frame_max = 1,frame_index = 0)     
     number_image = Cache.system(file_name)
     frame_max = 1 if frame_max < 1
     frame_index = frame_max -1 if frame_index > frame_max -1
     align = 2 if align > 2
     cw = number_image.width / 10
     ch = number_image.height / frame_max
     h = ch * frame_index
     number = value.abs.to_s.split(//)
     case align
        when 0
           plus_x = (-cw + space) * number.size
        when 1
           plus_x = (-cw + space) * number.size
           plus_x /= 2
        when 2  
           plus_x = 0
     end
     for r in 0..number.size - 1      
         number_abs = number[r].to_i
         number_rect = Rect.new(cw * number_abs, h, cw, ch)
         self.contents.blt(plus_x + x + ((cw - space) * r), y , number_image, number_rect)        
     end   
     number_image.dispose  
  end
   
  #--------------------------------------------------------------------------
  # ● Draw Help Layout
  #--------------------------------------------------------------------------
  def draw_face_save(name,x,y,type)
      if type == 0
         image_name = name + "_0"
      elsif type == 1
         image_name = name + "_1"         
      else  
         image_name = name + "_2"
      end
      image = Cache.face(image_name)   
      cw = image.width  
      ch = image.height
      src_rect = Rect.new(0, 0, cw, ch)   
      self.contents.blt(x , y , image, src_rect)  
      image.dispose
  end   
   
  #--------------------------------------------------------------------------
  # draw_parameter_layout
  #--------------------------------------------------------------------------  
  def draw_parameter_layout(x,y)
    image = Cache.menu("Save_Window01")   
    cw = image.width  
    ch = image.height
    src_rect = Rect.new(0, 0, cw, ch)   
    self.contents.blt(x , y , image, src_rect)     
    image.dispose
  end   
  
  #--------------------------------------------------------------------------
  # draw_parameter_layout2
  #--------------------------------------------------------------------------  
  def draw_parameter_layout2(x,y,type)
    if type == 0
       image = Cache.menu("Save_Window02")   
    else   
       image = Cache.menu("Save_Window03")  
    end  
    cw = image.width  
    ch = image.height
    src_rect = Rect.new(0, 0, cw, ch)   
    self.contents.blt(x , y , image, src_rect)     
    image.dispose
  end      
  
  #--------------------------------------------------------------------------
  # draw_character_floor
  #--------------------------------------------------------------------------  
  def draw_character_floor(x,y)
    image = Cache.menu("Save_Character_Floor")   
    cw = image.width  
    ch = image.height
    src_rect = Rect.new(0, 0, cw, ch)   
    self.contents.blt(x , y , image, src_rect)   
    image.dispose
  end
  
end  
   
#==============================================================================
# ** Window_SaveFile
#==============================================================================
class Window_SaveFile < Window_Base
  attr_reader   :filename               
  attr_reader   :file_exist               
  attr_reader   :time_stamp              
  attr_reader   :selected                 
  attr_reader   :file_index
  
  #--------------------------------------------------------------------------
  # initialize
  #--------------------------------------------------------------------------
  def initialize(file_index, filename)
    super(0, 0,720, 140)
    self.opacity = 0
    @file_index = file_index
    @filename = filename
    load_gamedata
    refresh
    @selected = false
  end
  
  #--------------------------------------------------------------------------
  # * load_gamedata
  #--------------------------------------------------------------------------
  def load_gamedata
    @time_stamp = Time.at(0)
    @file_exist = FileTest.exist?(@filename)
    if @file_exist
      file = File.open(@filename, "r")
      @time_stamp = file.mtime
      begin
        @characters     = Marshal.load(file)
        @map_name       = Marshal.load(file)
        @frame_count    = Marshal.load(file)
        @last_bgm       = Marshal.load(file)
        @last_bgs       = Marshal.load(file)
        @game_system    = Marshal.load(file)
        @game_message   = Marshal.load(file)
        @game_switches  = Marshal.load(file)
        @game_variables = Marshal.load(file)
        @total_sec = @frame_count / Graphics.frame_rate
      rescue
        @file_exist = false
      ensure
        file.close
      end
    end
  end
  
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.color = normal_color
    xp = 96
    ex = 60   
    if @file_exist
      draw_parameter_layout2(0,50,0)
      draw_parameter_layout(-10 + xp,0)
      value = @file_index + 1
      draw_picture_number(13 + xp, 32,value, "Number_01",1,0,3,0)
      draw_party_characters(180 + xp, 75,ex)
      draw_playtime(495, 20, contents.width - 4, 2)
      draw_map_location( 400 + xp,64)
      draw_level(185 + xp,85,ex)
      draw_face_save(40 + xp,0)
    else  
      draw_parameter_layout2(0,50,1)
      draw_parameter_layout(-10 + xp,0)
      value = @file_index + 1
      draw_picture_number(13 + xp, 32,value, "Number_01",1,0,3,0)      
       self.contents.draw_text(260, 50, 120, 32, "No Data", 1)
    end
  end
  #--------------------------------------------------------------------------
  # * draw_face
  #--------------------------------------------------------------------------
  def draw_face_save(x,y)
     face_name = @characters[0][3]
     face_index = @characters[0][4]
     draw_face(face_name, face_index , x, y, 96)
  end
  
  #--------------------------------------------------------------------------
  # * draw_level
  #--------------------------------------------------------------------------
  def draw_level(x,y,ex)
    self.contents.font.color = normal_color   
    for i in [email protected]
      level = @characters[2]
      draw_picture_number(x + (ex  * i) , y ,level, "Number_01",1,0,3,1)
    end        
  end
  
  #--------------------------------------------------------------------------
  # * draw_map_location
  #--------------------------------------------------------------------------
  def draw_map_location(x,y)
    self.contents.font.bold = true
    self.contents.font.name = "Georgia"
    self.contents.font.size = 20
    self.contents.font.italic = true
    self.contents.draw_text(x, y, 125, 32, @map_name.to_s, 0)
  end
  #--------------------------------------------------------------------------
  # * draw_party_characters
  #--------------------------------------------------------------------------
  def draw_party_characters(x, y,ex)
    for i in [email protected]
      name = @characters[0]
      index = @characters[1]
      draw_character_floor(- 35 + x + i * ex,y - 20)      
      draw_character(name, index, x + i * ex, y)
    end
  end
  
  #--------------------------------------------------------------------------
  # * draw_playtime
  #--------------------------------------------------------------------------
  def draw_playtime(x, y, width, align)
    hour = @total_sec / 60 / 60
    min = @total_sec / 60 % 60
    sec = @total_sec % 60
    time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
    draw_picture_number(x + 18 * 0, y ,0, "Number_01",0,0,3,0) if hour < 10
    draw_picture_number(x + 18 * 1, y ,hour, "Number_01",0,0,3,0)
    draw_picture_number(x + 18 * 3, y ,0, "Number_01",0,0,3,0) if min < 10
    draw_picture_number(x + 18 * 4, y ,min, "Number_01",0,0,3,0)
    draw_picture_number(x + 18 * 6, y ,0, "Number_01",0,0,3,0) if sec < 10
    draw_picture_number(x + 18 * 7, y ,sec , "Number_01",0,0,3,0)     
  end

  #--------------------------------------------------------------------------
  # * selected
  #--------------------------------------------------------------------------
  def selected=(selected)
    @selected = selected
  end
end

#==============================================================================
# ** Cache
#==============================================================================
module Cache
  #--------------------------------------------------------------------------
  # Menu
  #--------------------------------------------------------------------------  
  def self.menu(filename)
    load_bitmap("Graphics/Menus/", filename)
  end  
end  
#==============================================================================
# ** Game_Map
#==============================================================================
class Game_Map
  attr_reader   :name
  #--------------------------------------------------------------------------
  # * setup
  #--------------------------------------------------------------------------
  alias mog_vx06_setup setup
  def setup(map_id)
      mog_vx06_setup(map_id)
      data = load_data("Data/MapInfos.rvdata")   
      @name = data[@map_id].name
  end
end  

#==============================================================================
# ** Scene_File
#==============================================================================

class Scene_File < Scene_Base
  include MOG_VX08
  #--------------------------------------------------------------------------
  # * initialize
  #--------------------------------------------------------------------------
  def initialize(saving, from_title, from_event)
    @saving = saving
    @from_title = from_title
    @from_event = from_event
    @file_max = FILES_MAX
    @file_max = 1 if FILES_MAX < 1
  end
  
  #--------------------------------------------------------------------------
  # * Start
  #--------------------------------------------------------------------------
  def start
    super
    create_layout
    create_savefile_windows
    if @saving
      @index = $game_temp.last_file_index
    else
      @index = self.latest_file_index
    end        
    @check_prev_index = true
    @savefile_windows[@index].selected = true
  end
  
  #--------------------------------------------------------------------------
  # * Create_background
  #--------------------------------------------------------------------------  
  def create_layout
      @background = Plane.new  
      @background.bitmap = Cache.menu("Background")
      @background.z = 0
      @layout_01 = Sprite.new  
      @layout_01.bitmap = Cache.menu("Save_Layout01")
      @layout_01.z = 1      
      @layout_01.blend_type = 1
      image = Cache.menu("Save_Layout02")
      @bitmap = Bitmap.new(image.width,image.height)
      cw = image.width
      ch = image.height / 2
      if @saving
         h = 0
      else  
         h = ch
      end  
      src_rect = Rect.new(0, h, cw, ch)
      @bitmap.blt(0,0, image, src_rect)     
      @layout_02 = Sprite.new  
      @layout_02.bitmap = @bitmap
      @layout_02.z = 3
      @layout_02.y = 370
  end
  
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  def terminate
      @background.bitmap.dispose
      @background.dispose
      @layout_01.bitmap.dispose   
      @layout_01.dispose      
      @layout_02.bitmap.dispose
      @layout_02.dispose
      @bitmap.dispose
      super
      dispose_item_windows
  end
  
  #--------------------------------------------------------------------------
  # * Return to Original Screen
  #--------------------------------------------------------------------------
  def return_scene
    if @from_title
      $scene = Scene_Title.new
    elsif @from_event
      $scene = Scene_Map.new
    else
      $scene = Scene_Menu.new(4)
    end
  end
  
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    update_menu_background
    update_savefile_windows
    update_savefile_selection
    check_start_index
  end
  
  #--------------------------------------------------------------------------
  # * check_start_index
  #--------------------------------------------------------------------------
  def check_start_index
     return if @check_prev_index == false
      @check_prev_index = false
      check_active_window   
  end  
   
  #--------------------------------------------------------------------------
  # * check_active_window   
  #--------------------------------------------------------------------------
  def check_active_window   
    @index = 0 if @index == nil
    for i in 0...@file_max  
      @pw = @index - 1
      @pw = 0 if @pw > @file_max - 1
      @pw = @file_max- 1 if @pw < 0        
      @aw = @index
      @nw = @index + 1
      @nw = 0 if @nw > @file_max - 1
      @nw = @file_max - 1  if @nw < 0
      case @savefile_windows.file_index
         when @pw,@nw
              @savefile_windows.visible = true
              @savefile_windows.contents_opacity = 100
         when @aw  
              @savefile_windows.visible = true
              @savefile_windows.contents_opacity = 255
         else
              @savefile_windows.visible = false
      end
    end         
  end
   
  #--------------------------------------------------------------------------
  # * Create Save File Window
  #--------------------------------------------------------------------------
  def create_savefile_windows
    @pw_pos = [-160,32]
    @aw_pos = [-96,160]
    @nw_pos = [-32,288]      
    @savefile_windows = []
    for i in 0...@file_max
        @savefile_windows = Window_SaveFile.new(i, make_filename(i))
        @savefile_windows.z = 2
        @savefile_windows.visible = false
        @savefile_windows.x = 400
    end
    check_active_window
    @item_max = @file_max
  end
  
  #--------------------------------------------------------------------------
  # * Dispose of Save File Window
  #--------------------------------------------------------------------------
  def dispose_item_windows
    for window in @savefile_windows
      window.dispose
    end
  end
  
  #--------------------------------------------------------------------------
  # * Update Save File Window
  #--------------------------------------------------------------------------
  def update_savefile_windows
    update_slide_window
    for window in @savefile_windows
      window.update
    end
  end
  
  #--------------------------------------------------------------------------
  # * update_slide_window
  #--------------------------------------------------------------------------  
  def update_slide_window
      @background.ox += 1
      slide_window_x(@pw,@pw_pos[0])
      slide_window_x(@aw,@aw_pos[0])
      slide_window_x(@nw,@nw_pos[0])
      slide_window_y(@pw,@pw_pos[1])
      slide_window_y(@aw,@aw_pos[1])
      slide_window_y(@nw,@nw_pos[1])
  end
   
  #--------------------------------------------------------------------------
  # * slide_window_x
  #--------------------------------------------------------------------------   
  def slide_window_x(i,x_pos)
      if @savefile_windows.x < x_pos
         @savefile_windows.x += 15
         @savefile_windows.x = x_pos if @savefile_windows.x > x_pos
      end  
      if @savefile_windows.x > x_pos
         @savefile_windows.x -= 15
         @savefile_windows.x = x_pos if @savefile_windows.x < x_pos        
       end            
  end   
     
  #--------------------------------------------------------------------------
  # * slide_window_y
  #--------------------------------------------------------------------------   
  def slide_window_y(i,y_pos)
      if @savefile_windows.y < y_pos
         @savefile_windows.y += 15
         @savefile_windows.y = y_pos if @savefile_windows.y > y_pos
      end  
      if @savefile_windows.y > y_pos
         @savefile_windows.y -= 15
         @savefile_windows.y = y_pos if @savefile_windows.y < y_pos        
       end            
  end   
     
  #--------------------------------------------------------------------------
  # * reset_position
  #--------------------------------------------------------------------------     
  def reset_position(diretion)
      check_active_window      
      case diretion
         when 0
            @savefile_windows[@pw].y = -64
            @savefile_windows[@pw].x = 0
         when 1  
            @savefile_windows[@nw].y = 440
            @savefile_windows[@nw].x = 0
      end        
  end
   
  #--------------------------------------------------------------------------
  # * Update Save File Selection
  #--------------------------------------------------------------------------
  def update_savefile_selection
    if Input.trigger?(Input::C)
      determine_savefile
    elsif Input.trigger?(Input::B)
      Sound.play_cancel
      return_scene
    else
      last_index = @index
      if Input.trigger?(Input::DOWN)
        cursor_down(Input.trigger?(Input::DOWN))
        if @file_max > 2
           reset_position(1)
        else
           reset_position(0)
        end  
      end
      if Input.trigger?(Input::UP)
        cursor_up(Input.trigger?(Input::UP))
        reset_position(0)
      end
      if @index != last_index
         Sound.play_cursor
         @savefile_windows[last_index].selected = false
         @savefile_windows[@index].selected = true
      end      
    end
  end
  
  #--------------------------------------------------------------------------
  # * Confirm Save File
  #--------------------------------------------------------------------------
  def determine_savefile
    if @saving
      Sound.play_save
      do_save
    else
      if @savefile_windows[@index].file_exist
        Sound.play_load
        do_load
      else
        Sound.play_buzzer
        return
      end
    end
    $game_temp.last_file_index = @index
  end
  
  #--------------------------------------------------------------------------
  # * Move cursor down
  #--------------------------------------------------------------------------
  def cursor_down(wrap)
    if @index < @item_max - 1 or wrap
      @index = (@index + 1) % @item_max
    end
  end
  
  #--------------------------------------------------------------------------
  # * Move cursor up
  #--------------------------------------------------------------------------
  def cursor_up(wrap)
    if @index > 0 or wrap
      @index = (@index - 1 + @item_max) % @item_max
    end
  end
  
  #--------------------------------------------------------------------------
  # * Create Filename
  #--------------------------------------------------------------------------
  def make_filename(file_index)
    return "Save#{file_index + 1}.rvdata"
  end
  
  #--------------------------------------------------------------------------
  # * Select File With Newest Timestamp
  #--------------------------------------------------------------------------
  def latest_file_index
    index = 0
    latest_time = Time.at(0)
    for i in 0...@file_max
      if @savefile_windows.time_stamp > latest_time
        latest_time = @savefile_windows.time_stamp
        index = i
      end
    end
    return index
  end
  
  #--------------------------------------------------------------------------
  # * Execute Save
  #--------------------------------------------------------------------------
  def do_save
    file = File.open(@savefile_windows[@index].filename, "wb")
    write_save_data(file)
    file.close
    return_scene
  end
  
  #--------------------------------------------------------------------------
  # * Execute Load
  #--------------------------------------------------------------------------
  def do_load
    file = File.open(@savefile_windows[@index].filename, "rb")
    read_save_data(file)
    file.close
    $scene = Scene_Map.new
    RPG::BGM.fade(1500)
    Graphics.fadeout(60)
    Graphics.wait(40)
    @last_bgm.play
    @last_bgs.play
  end
  
  #--------------------------------------------------------------------------
  # * write_save_data
  #--------------------------------------------------------------------------
  def write_save_data(file)
    characters = []
    for actor in $game_party.members
        characters.push([actor.character_name, actor.character_index,
        actor.level,actor.face_name, actor.face_index])
    end
    $game_system.save_count += 1
    $game_system.version_id = $data_system.version_id
    map_name = $game_map.name
    @last_bgm = RPG::BGM::last
    @last_bgs = RPG::BGS::last
    Marshal.dump(characters,           file)
    Marshal.dump(map_name,             file)   
    Marshal.dump(Graphics.frame_count, file)
    Marshal.dump(@last_bgm,            file)
    Marshal.dump(@last_bgs,            file)
    Marshal.dump($game_system,         file)
    Marshal.dump($game_message,        file)
    Marshal.dump($game_switches,       file)
    Marshal.dump($game_variables,      file)
    Marshal.dump($game_self_switches,  file)
    Marshal.dump($game_actors,         file)
    Marshal.dump($game_party,          file)
    Marshal.dump($game_troop,          file)
    Marshal.dump($game_map,            file)
    Marshal.dump($game_player,         file)
  end
  
  #--------------------------------------------------------------------------
  # * read_save_data
  #--------------------------------------------------------------------------
  def read_save_data(file)
    characters           = Marshal.load(file)
    map_name             = Marshal.load(file)
    Graphics.frame_count = Marshal.load(file)
    @last_bgm            = Marshal.load(file)
    @last_bgs            = Marshal.load(file)
    $game_system         = Marshal.load(file)
    $game_message        = Marshal.load(file)
    $game_switches       = Marshal.load(file)
    $game_variables      = Marshal.load(file)
    $game_self_switches  = Marshal.load(file)
    $game_actors         = Marshal.load(file)
    $game_party          = Marshal.load(file)
    $game_troop          = Marshal.load(file)
    $game_map            = Marshal.load(file)
    $game_player         = Marshal.load(file)
    if $game_system.version_id != $data_system.version_id
      $game_map.setup($game_map.map_id)
      $game_player.center($game_player.x, $game_player.y)
    end
  end
  
end

$mog_rgssvx_scene_file = true

Lv4.逐梦者

送快递的水表员

梦石
10
星屑
4807
在线时间
3303 小时
注册时间
2012-6-27
帖子
7160

开拓者贵宾

2
发表于 2013-1-17 22:03:14 | 只看该作者
截图存档?改变目录?
6R就有啊!

http://rpg.blue/forum.php?mod=viewthread&tid=85115

点评

但放这不行,我把那里的拿来加上去没反映,不知道是自己不会还是什么原因。  发表于 2013-1-17 22:25
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
47 小时
注册时间
2012-12-12
帖子
83
3
 楼主| 发表于 2013-1-19 15:41:16 | 只看该作者
怎么都潜水去了呢???
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-6-16 22:19

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表