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

Project1

 找回密码
 注册会员
搜索
查看: 2658|回复: 1

[已经解决] XP关于“截图存档”和“标题菜单美化”的冲突问题

[复制链接]

Lv1.梦旅人

梦石
0
星屑
74
在线时间
1313 小时
注册时间
2011-4-28
帖子
1310

短篇八橙光组亚军贵宾

 楼主| 发表于 2013-2-2 12:23:09 | 显示全部楼层 |阅读模式

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

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

x
本帖最后由 hys111111 于 2013-2-2 12:42 编辑

大概是因为“截图存档”强行把存档位置改成了Save文件夹。
而“标题菜单美化”完全没动默认,所以导致“截图存档脚本”的存档不被“标题菜单”认可。
所以存的档在标题界面全部不能读取(读取是灰色)。
………………………………………………
能不能修改“截图存档”存档路径   就让“截图存档”的存档保存在XP原本默认的根目录??
………………………………………………
  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,转载和使用请保留此信息
  3. #===============================================================================

  4. BBS_66RPG_DIR = "Save/"  # 储存文件夹名,请制作游戏时自行建立此文件夹

  5. # 若想使用自定义背景图,脚本62行的井号去掉,并放置一张相应图形。

  6. # 在你的Scene_Title中找到这一段(如果使用其他插件脚本,在插件中找):
  7. #    for i in 0..3
  8. #      if FileTest.exist?("Save#{i+1}.rxdata")
  9. # 请自行把0..3改为0..最大进度号,比如0..9
  10. # "Save#{i+1}.rxdata" 改为"Save/Save#{i}.rxdata"

  11. # 增加进度的方法:138,258行,继续添加。你也可以改“进度X”为“回忆X”或者“红/绿/蓝笔记本”

  12. #===============================================================================
  13. module Screen  
  14.   @screen = Win32API.new 'screenshot', 'Screenshot', %w(l l l l p l l), ''
  15.   @readini = Win32API.new 'kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l'
  16.   @findwindow = Win32API.new 'user32', 'FindWindowA', %w(p p), 'l'
  17.   module_function
  18.   #-----------------------------------------------------------------------------
  19.   # here comes the stuff...
  20.   # i add here the stuff for automatic change of the number for the screenshot
  21.   # so it wont overrite the old one...
  22.   # if you want to change so stuff change them in this line below
  23.   # or you can change them in your command line... like
  24.   # Screen::shot("screenshot", 2)
  25.   # this change the name and the type of the screenshot
  26.   # (0 = bmp, 1 = jpg and 2 = png)
  27.   # ----------------------------------------------------------------------------
  28.   def shot(file = "shot", typ = 1)
  29.     # to add the right extension...
  30.     if typ == 0
  31.       typname = ".bmp"
  32.     elsif typ == 1
  33.       typname = ".jpg"
  34.     elsif typ == 2
  35.       typname = ".png"
  36.     end   
  37.     file_index = 0   
  38.     dir = "Save/"   
  39.     # make the filename....
  40.     file_name = dir + file.to_s + typname.to_s   
  41.     # make the screenshot.... Attention dont change anything from here on....
  42.     @screen.call(0,0,640,480,file_name,handel,typ)
  43.   end
  44.   # find the game window...
  45.   def handel
  46.     game_name = "\0" * 256
  47.     @readini.call('Game','Title','',game_name,255,".\\Game.ini")
  48.     game_name.delete!("\0")
  49.     return @findwindow.call('RGSS Player',game_name)
  50.   end
  51. end

  52. class Window_File < Window_Base
  53.   attr_accessor :index
  54.   def initialize(index = 0)
  55.     @backsp = Sprite.new
  56.     #@backsp.bitmap = Bitmap.new("Graphics/Pictures/存盘背景.jpg")
  57.     @backsp.z = 99
  58.     super(160,0,480,480)
  59.     #这行可以不用
  60.     self.contents = Bitmap.new(width - 32, height - 32)
  61.     @index = index
  62.     #这里我要说明一句,之所以用sprite是为了放缩图片
  63.     [url=home.php?mod=space&uid=114926]@sprite[/url] = Sprite.new
  64.     @sprite.visible = false
  65.     @sprite.z = 100
  66.     @sp_ch = []
  67.     @sp_ch[0] = Sprite.new
  68.     refresh
  69.   end
  70.   def refresh
  71.     self.contents.clear
  72.     for i in @sp_ch
  73.       i.visible = false
  74.     end
  75.     @sprite.visible = false
  76.     if FileTest.exist?(BBS_66RPG_DIR+"Save#{@index}.rxdata")
  77.       @sprite.visible = true
  78.       if FileTest.exist?(BBS_66RPG_DIR+"Save#{@index}.jpg")
  79.         @sprite.bitmap = Bitmap.new(BBS_66RPG_DIR+"Save#{@index}.jpg")
  80.       else
  81.         self.contents.draw_text(32,64,400,32,"截图似乎有点问题……您搞什么了您?")
  82.       end
  83.       @sprite.x = 176
  84.       @sprite.y = 16
  85.       @sprite.zoom_x = 0.7
  86.       @sprite.zoom_y = 0.7
  87.       file = File.open(BBS_66RPG_DIR+"Save#{@index}.rxdata", "r")
  88.       @time_stamp = file.mtime
  89.       @characters = Marshal.load(file)
  90.       @frame_count = Marshal.load(file)
  91.       @game_system = Marshal.load(file)
  92.       @game_switches = Marshal.load(file)
  93.       @game_variables = Marshal.load(file)
  94.       @total_sec = @frame_count / Graphics.frame_rate
  95.       file.close
  96.       for i in [email protected]
  97.         @sp_ch[i] = Sprite.new
  98.         @sp_ch[i].visible = true
  99.         @sp_ch[i].bitmap = RPG::Cache.battler(@characters[i][3], @characters[i][4])
  100.         @sp_ch[i].x = 180 + i*100      
  101.         @sp_ch[i].y = 460 - @sp_ch[i].bitmap.height
  102.         @sp_ch[i].z = 101
  103.       end
  104.       # 描绘游戏时间
  105.       hour = @total_sec / 60 / 60
  106.       min = @total_sec / 60 % 60
  107.       sec = @total_sec % 60
  108.       time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
  109.       self.contents.font.color = normal_color
  110.       self.contents.draw_text(4, 390, 420, 32, time_string, 2)
  111.       # 描绘时间标记
  112.       self.contents.font.color = normal_color
  113.       time_string = @time_stamp.strftime("%Y/%m/%d %H:%M")
  114.       self.contents.draw_text(4, 420, 420, 32, time_string, 2)
  115.     else
  116.       self.contents.draw_text(32,32,420,32,"这个相册里没有照片")
  117.     end
  118.   end
  119.   def dispose
  120.     super
  121.     @sprite.dispose
  122.     @backsp.dispose
  123.     for i in @sp_ch
  124.       i.dispose
  125.     end
  126.   end
  127. end


  128. class Scene_Save
  129.   def main
  130.     @command_window = Window_Command.new(160,["相册一","相册二","相册三","相册四","相册五","相册六"])
  131.     @command_window.y = 96
  132.     @command_window.index = $game_temp.last_file_index
  133.     @content_window = Window_File.new($game_temp.last_file_index)
  134.     # 执行过渡
  135.     Graphics.transition
  136.     # 主循环
  137.     loop do
  138.       # 刷新游戏画面
  139.       Graphics.update
  140.       # 刷新输入信息
  141.       Input.update
  142.       # 刷新画面
  143.       update
  144.       # 如果画面被切换的话就中断循环
  145.       if $scene != self
  146.         break
  147.       end
  148.     end
  149.     # 准备过渡
  150.     Graphics.freeze
  151.     @command_window.dispose
  152.     @content_window.dispose
  153.   end
  154.   def update
  155.     @command_window.update   
  156.     if @command_window.index != @content_window.index
  157.       @content_window.index = @command_window.index
  158.       @content_window.refresh
  159.     end   
  160.     #——————下面这一部分是原装脚本——————#
  161.     if Input.trigger?(Input::B)  
  162.       $game_system.se_play($data_system.cancel_se)
  163.       if $game_temp.save_calling
  164.         $game_temp.save_calling = false
  165.         $scene = Scene_Map.new
  166.         return
  167.       end
  168.       $scene = Scene_Menu.new(4)
  169.     end   
  170.     #———————————————————————#   
  171.     if Input.trigger?(Input::C)
  172.       # 演奏存档 SE
  173.       $game_system.se_play($data_system.save_se)
  174.       # 写入存档数据
  175.       file = File.open(BBS_66RPG_DIR+"Save#{@command_window.index}.rxdata", "wb")
  176.       write_save_data(file)
  177.       if FileTest.exist?(BBS_66RPG_DIR+"shot.jpg")
  178.         File.rename(BBS_66RPG_DIR+"shot.jpg", BBS_66RPG_DIR+"Save#{@command_window.index}.jpg")
  179.       end
  180.       file.close
  181.       $game_temp.last_file_index = @command_window.index
  182.       # 如果被事件调用
  183.       if $game_temp.save_calling
  184.         # 清除存档调用标志
  185.         $game_temp.save_calling = false
  186.         # 切换到地图画面
  187.         $scene = Scene_Map.new
  188.         return
  189.       end
  190.       # 切换到菜单画面
  191.       $scene = Scene_Map.new
  192.     end
  193.     #———————————————————————#
  194.   end
  195.   #--------------------------------------------------------------------------
  196.   # ● 写入存档数据
  197.   #     file : 写入用文件对像 (已经打开)
  198.   #--------------------------------------------------------------------------
  199.   def write_save_data(file)
  200.     # 生成描绘存档文件用的角色图形
  201.     characters = []
  202.     for i in 0...$game_party.actors.size
  203.       actor = $game_party.actors[i]
  204.       characters.push([actor.character_name, actor.character_hue, actor.id, actor.battler_name, actor.battler_hue])
  205.     end
  206.     # 写入描绘存档文件用的角色数据
  207.     Marshal.dump(characters, file)
  208.     # 写入测量游戏时间用画面计数
  209.     Marshal.dump(Graphics.frame_count, file)
  210.     # 增加 1 次存档次数
  211.     $game_system.save_count += 1
  212.     # 保存魔法编号
  213.     # (将编辑器保存的值以随机值替换)
  214.     $game_system.magic_number = $data_system.magic_number
  215.     # 写入各种游戏对像
  216.     Marshal.dump($game_system, file)
  217.     Marshal.dump($game_switches, file)
  218.     Marshal.dump($game_variables, file)
  219.     Marshal.dump($game_self_switches, file)
  220.     Marshal.dump($game_screen, file)
  221.     Marshal.dump($game_actors, file)
  222.     Marshal.dump($game_party, file)
  223.     Marshal.dump($game_troop, file)
  224.     Marshal.dump($game_map, file)
  225.     Marshal.dump($game_player, file)
  226.   end
  227. end


  228. class Scene_Load
  229.   def initialize
  230.     # 再生成临时对像
  231.     $game_temp = Game_Temp.new
  232.     # 选择存档时间最新的文件
  233.     $game_temp.last_file_index = 0
  234.     latest_time = Time.at(0)
  235.     for i in 0..6
  236.       filename = BBS_66RPG_DIR+"Save#{i}.rxdata"
  237.       if FileTest.exist?(filename)
  238.         file = File.open(filename, "r")
  239.         if file.mtime > latest_time
  240.           latest_time = file.mtime
  241.           $game_temp.last_file_index = i
  242.         end
  243.         file.close
  244.       end
  245.     end
  246.   end  
  247.   def main
  248.     @command_window = Window_Command.new(160,["相册一","相册二","相册三","相册四","相册五","相册六"])
  249.     @command_window.y = 96
  250.     @command_window.index = $game_temp.last_file_index
  251.     @content_window = Window_File.new($game_temp.last_file_index)
  252.     # 执行过渡
  253.     Graphics.transition
  254.     # 主循环
  255.     loop do
  256.       # 刷新游戏画面
  257.       Graphics.update
  258.       # 刷新输入信息
  259.       Input.update
  260.       # 刷新画面
  261.       update
  262.       # 如果画面被切换的话就中断循环
  263.       if $scene != self
  264.         break
  265.       end
  266.     end
  267.     # 准备过渡
  268.     Graphics.freeze
  269.     @command_window.dispose
  270.     @content_window.dispose
  271.   end
  272.   def update
  273.     @command_window.update   
  274.     if @command_window.index != @content_window.index
  275.       @content_window.index = @command_window.index
  276.       @content_window.refresh
  277.     end   
  278.     #——————下面这一部分是原装脚本——————#
  279.     if Input.trigger?(Input::B)  
  280.     # 演奏取消 SE
  281.     $game_system.se_play($data_system.cancel_se)
  282.     # 切换到标题画面
  283.     $scene = Scene_Title.new
  284.     end   
  285.     #———————————————————————#   
  286.     if Input.trigger?(Input::C)
  287.       # 文件不存在的情况下
  288.       unless FileTest.exist?(BBS_66RPG_DIR+"Save#{@command_window.index}.rxdata")
  289.         # 演奏冻结 SE
  290.         $game_system.se_play($data_system.buzzer_se)
  291.         return
  292.       end
  293.       # 演奏读档 SE
  294.       $game_system.se_play($data_system.load_se)
  295.       # 写入存档数据
  296.       file = File.open(BBS_66RPG_DIR+"Save#{@command_window.index}.rxdata", "rb")
  297.       read_save_data(file)
  298.       file.close
  299.       # 还原 BGM、BGS
  300.       $game_system.bgm_play($game_system.playing_bgm)
  301.       $game_system.bgs_play($game_system.playing_bgs)
  302.       # 刷新地图 (执行并行事件)
  303.       $game_map.update
  304.       # 切换到地图画面
  305.       $scene = Scene_Map.new
  306.     end
  307.     #———————————————————————#
  308.   end
  309.   #--------------------------------------------------------------------------
  310.   # ● 写入存档数据
  311.   #     file : 写入用文件对像 (已经打开)
  312.   #--------------------------------------------------------------------------
  313.   def read_save_data(file)
  314.     # 读取描绘存档文件用的角色数据
  315.     characters = Marshal.load(file)
  316.     # 读取测量游戏时间用画面计数
  317.     Graphics.frame_count = Marshal.load(file)
  318.     # 读取各种游戏对像
  319.     $game_system        = Marshal.load(file)
  320.     $game_switches      = Marshal.load(file)
  321.     $game_variables     = Marshal.load(file)
  322.     $game_self_switches = Marshal.load(file)
  323.     $game_screen        = Marshal.load(file)
  324.     $game_actors        = Marshal.load(file)
  325.     $game_party         = Marshal.load(file)
  326.     $game_troop         = Marshal.load(file)
  327.     $game_map           = Marshal.load(file)
  328.     $game_player        = Marshal.load(file)
  329.     # 魔法编号与保存时有差异的情况下
  330.     # (加入编辑器的编辑过的数据)
  331.     if $game_system.magic_number != $data_system.magic_number
  332.       # 重新装载地图
  333.       $game_map.setup($game_map.map_id)
  334.       $game_player.center($game_player.x, $game_player.y)
  335.     end
  336.     # 刷新同伴成员
  337.     $game_party.refresh
  338.   end
  339. end

  340. class Scene_Menu
  341.   alias bbs_66rpg_shotsave_main main
  342.   def main
  343.     if @menu_index == 0
  344.       Screen::shot
  345.     end   
  346.     bbs_66rpg_shotsave_main
  347.   end
  348. end

  349. class Interpreter
  350.   #--------------------------------------------------------------------------
  351.   # ● 调用存档画面
  352.   #--------------------------------------------------------------------------
  353.   def command_352
  354.     # 设置战斗中断标志
  355.     $game_temp.battle_abort = true
  356.     # 设置调用存档标志
  357.     $game_temp.save_calling = true
  358.     # 推进索引
  359.     @index += 1
  360.     # 结束
  361.     Screen::shot
  362.     return false
  363.   end
  364. end
复制代码

Lv5.捕梦者 (版主)

梦石
20
星屑
1840
在线时间
6925 小时
注册时间
2012-12-14
帖子
11485

短篇十战斗者组别冠军开拓者贵宾短篇九勇士组亚军

发表于 2013-2-2 12:28:12 | 显示全部楼层
本帖最后由 美丽晨露 于 2013-2-2 12:34 编辑

楼主说的问题是截图存档的存档保存的位置更换对么?
  1. dir = "Save/"
复制代码
更换为
  1. dir = ""
复制代码
  1. #BBS_66RPG_DIR = "Save/"
复制代码
改为
  1. #BBS_66RPG_DIR = ""
复制代码

点评

我已将改好了save1,不用了谢~  发表于 2013-2-2 12:45
对了,还有一个冲突是:“截图存档”是从save0开始的,能否将其改成默认的save1开始存?  发表于 2013-2-2 12:42
嗯,这样就没有冲突了 Thanks~  发表于 2013-2-2 12:35

评分

参与人数 2星屑 +60 梦石 +1 收起 理由
明特·布兰马修 + 60 认可答案
hys111111 + 1 认可答案

查看全部评分

大家好,这里是晨露的说。请多多指教。
刚入门RM软件制作,请大家多多帮助我哦。
落雪君的欢乐像素教程,欢迎查阅。

回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-3-28 23:42

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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