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

Project1

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

大问题

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
74
在线时间
117 小时
注册时间
2007-8-5
帖子
479
跳转到指定楼层
1
发表于 2008-7-10 05:01:49 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
怎么让游戏进去就不用存档,然后退出自动存档?

下次点进去就自动读取存档?
此贴于 2008-7-13 12:48:36 被版主darkten提醒,请楼主看到后对本贴做出回应。
版务信息:本贴由楼主自主结贴~
偶是 传说逍遥

Lv1.梦旅人

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-6-20
帖子
87
2
发表于 2008-7-10 23:09:04 | 只看该作者
以下是 灼眼的夏娜 在共享区发的脚本
module Kernel

alias origin_exit exit unless method_defined? :exit

def exit(*args)
   case $scene
   when Scene_Map
     AutoSave.common_save unless $game_system.map_interpreter.running?
   when Scene_Battle
     AutoSave.common_save unless $game_system.battle_interpreter.running?
   else
     if $scene.type != NilClass and $scene.type != Scene_Title
       AutoSave.common_save
     end
   end
   origin_exit(*args)
end

end


module AutoSave

if @scene_proc.nil?
   @last_scene = nil.class
   @scene_proc = proc do |value|
     if value.nil? or value.is_a?(Scene_Title)
       if @last_scene != NilClass and @last_scene != Scene_Title
         AutoSave.common_save
       end
     end
     @last_scene = value.type
   end
   trace_var(:$scene,@scene_proc)
end

module_function

def common_save
   filename = "Save#{$game_temp.last_file_index + 1}.rxdata"
   file = File.open(filename, "wb")
   write_save_data(file)
   file.close
end

def write_save_data(file)
   characters = []
   for i in 0...$game_party.actors.size
     actor = $game_party.actors
     characters.push([actor.character_name, actor.character_hue])
   end
   Marshal.dump(characters, file)
   Marshal.dump(Graphics.frame_count, file)
   $game_system.save_count += 1
   $game_system.magic_number = $data_system.magic_number
   Marshal.dump($game_system, file)
   Marshal.dump($game_switches, file)
   Marshal.dump($game_variables, file)
   Marshal.dump($game_self_switches, file)
   Marshal.dump($game_screen, 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

原址http://rpg.blue/web/htm/news730.htm

系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2025-8-8 16:11

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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