赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 12661 |
最后登录 | 2012-2-7 |
在线时间 | 2 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 2 小时
- 注册时间
- 2005-10-25
- 帖子
- 108
|
自动读取进度1中的存档。
- #==============================================================================
- # BY 1012 脚本屋·不上网的猫
- #==============================================================================
- # ■ Scene_Title
- #------------------------------------------------------------------------------
- # 处理标题画面的类。
- #==============================================================================
- class Scene_Title < Scene_Base
- #--------------------------------------------------------------------------
- # ● 判断继续是否有效
- #--------------------------------------------------------------------------
- def check_continue
- @continue_enabled = FileTest.exist?("Save1.rvdata")
- end
- #--------------------------------------------------------------------------
- # ● 指令 : 继续
- #--------------------------------------------------------------------------
- def command_continue
- if @continue_enabled
- Sound.play_decision
- file = File.open("Save1.rvdata", "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
- else
- Sound.play_buzzer
- end
- end
- #--------------------------------------------------------------------------
- # ● 读取存档数据
- # file : 读取文件用对象 (已经打开)
- #--------------------------------------------------------------------------
- def read_save_data(file)
- characters = 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
复制代码 版主对此帖的认可:『热情帮助』,积分『+50』。 系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~ |
|