Project1
标题:
如何做删档??
[打印本页]
作者:
xuyangyang
时间:
2011-5-10 19:33
提示:
作者被禁止或删除 内容自动屏蔽
作者:
Zhen~败类
时间:
2011-5-10 23:49
这个脚本可以在玩家存盘后将玩家带回Title画面,当玩家读取进度,游戏进度会自动删除(类似与《暗黑破坏神》和各种网游的存盘方式,防止玩家使用S/L大法)
#==============================================================================
#==============================================================================
class Scene_Save
def on_decision(filename)
$game_system.se_play($data_system.save_se)
file = File.open(filename, "wb")
write_save_data(file)
file.close
$scene = Scene_Title.new
end
end
# ————————————————————————————————————
# ————————————————————————————————————
class Scene_Load
def on_decision(filename)
unless FileTest.exist?(filename)
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.load_se)
file = File.open(filename, "rb")
read_save_data(file)
file.close
File.delete(filename)
$game_system.bgm_play($game_system.playing_bgm)
$game_system.bgs_play($game_system.playing_bgs)
$game_map.update
$scene = Scene_Map.new
end
end
#==============================================================================
复制代码
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1