赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 423 |
最后登录 | 2013-6-27 |
在线时间 | 2 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 2 小时
- 注册时间
- 2007-5-3
- 帖子
- 151
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
使用方法: .. 说说主要的.
你可以自定义脚本. (可选)
让我们开始,在第22行 ("ASR = 4"). 这意味着第4个储存槽将被占用.
在第23行 ("ASN = "Autosave.rvdata").这个是自动存储文件的名字(必须为Save开头!).
在第28行("ASN2 = "自动存档"). 将重命名自动存储文件的读取名,用来与其他区分. (看载图)
在第32行和34行 ("AMSG_ON = true" and AMSG = "Auto save done!"). 如果 AMSG_ON 为true 时储存文件信息AMSG 将会被显示.
在第37行 ("SPS = 1"). 控制储存时间,1点等于4秒,20点等于80秒
在第34行 ("IFSW = 1"). 这是控制脚本开关的ID,当开关关闭时,这个脚本将失效!
#~ -----------------------------------------------------------------------------
#~ 自动存储脚本 by Moon V 1.3 汉化by:x387804363(66RPG)/光的圆周率(驿站) | |
#~ -----------------------------------------------------------------------------
#~ RPGMAKERVX.org forum topic: |
#~ http://www.RPGmakervx.net/index.php?showtopic=1842 |
#~ -----------------------------------------------------------------------------
#~ V 1.2
#~ ~Fixed a bug where the game crashes if the script tries to save while
#~ there is a message showing
#~ V 1.3
#~ ~Upgraded time between saves
#~ . Until now it was X*4 and now it is X*5 (you can set up the X below)
#~ ~The script wont save the game if the saving is disabled.
#~ ~A bit upgrade the control switch
#~ . If the control switch is 0 there wont be need of switch.
#~ Customize
module RPG
module AutoSave
#~ ("ASR = 4"). 这意味着第4个储存槽将被占用.
ASR = 4
#~这个是自动存储文件的名字(必须为Save开头!)
ASN = "SaveAuto.rvdata"
#~将重命名自动存储文件的读取名,用来与其他区分,通常名称为文件#{filename}
ASN2 = "Autosave"
#~ 如果 AMSG_ON 为true 时储存文件信息AMSG 将会被显示.
AMSG_ON = true
#~ 信息
AMSG = "储存完成!"
#~ 控制储存时间,1点等于4秒,20点等于80秒
SPS = 1
#~ 这是控制脚本开关的ID,当开关关闭时,这个脚本将失效!
IFSW = 1
end
end
class Scene_Map < Scene_Base
alias autoSave_start start
def start
autoSave_start
@i = 0
end
alias autoSave_update update
def update
autoSave_update
@a = $game_message.visible
@b = $game_switches[RPG::AutoSave::IFSW]
@b = true if RPG::AutoSave::IFSW == 0
@c = $game_system.save_disabled
if @a == false && @b == true && @c == false
@i += 1
if @i > RPG::AutoSave::SPS * 300
@i = 0
file = File.open(RPG::AutoSave::ASN, "wb")
$game_message.texts.push(RPG::AutoSave::AMSG) if RPG::AutoSave::AMSG_ON
write_save_data(file)
file.close
end
end
end
def write_save_data(file)
characters = []
for actor in $game_party.members
characters.push([actor.character_name, actor.character_index])
end
$game_system.save_count += 1
$game_system.version_id = $data_system.version_id
@last_bgm = RPG::BGM::last
@last_bgs = RPG::BGS::last
Marshal.dump(characters, 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
end
class Window_SaveFile < Window_Base
def refresh
self.contents.clear
self.contents.font.color = normal_color
if @file_index + 1 != RPG::AutoSave::ASR
name = Vocab::File + " #{@file_index + 1}"
else
name = RPG::AutoSave::ASN2
end
self.contents.draw_text(4, 0, 200, WLH, name)
@name_width = contents.text_size(name).width
if @file_exist
draw_party_characters(152, 58)
draw_playtime(0, 34, contents.width - 4, 2)
end
end
end
class Scene_File < Scene_Base
def do_save
if @index != RPG::AutoSave::ASR
file = File.open(@savefile_windows[@index].filename, "wb")
else
file = RPG::AutoSave::ASN
end
write_save_data(file)
file.close
return_scene
end
def create_savefile_windows
@savefile_windows = []
for i in 0..3
if i != RPG::AutoSave::ASR - 1
@savefile_windows.push(Window_SaveFile.new(i, make_filename(i)))
else
@savefile_windows.push(Window_SaveFile.new(i, RPG::AutoSave::ASN))
end
end
@item_max = 4
end
end
载图
应该没问题,测试过了
需要注意的是存储文件的名字必须为Save开头,不知道是为什么. |
|