Project1

标题: 跳过标题的脚本和仿仙三的脚本冲突,帮忙解决!谢谢! [打印本页]

作者: 5dare    时间: 2010-12-15 22:56
标题: 跳过标题的脚本和仿仙三的脚本冲突,帮忙解决!谢谢!
我使用了跳过开头脚本 然后根据柳柳的个性自制菜单而跟着做了一个自制个性标题,还是用了 截图存档和截图读档,但是在储存的时候发生冲突, 截图存档的307行 发生冲突。  解读读档是发生在400行,我把脚本都贴出来了,求求各位高手帮帮忙,解决下冲突!!我用的是仿仙剑3的那个工程做的。
跳过标题的脚本是
  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================


  4. class Scene_Title
  5.   #==============================================================================
  6.   # 脚本作者:朱仔メ龍 QQ:251724722
  7.   # 脚本转载请保留以上信息
  8.   #==============================================================================
  9.   def main
  10.     $data_actors        = load_data("Data/Actors.rxdata")
  11.     $data_classes       = load_data("Data/Classes.rxdata")
  12.     $data_skills        = load_data("Data/Skills.rxdata")
  13.     $data_items         = load_data("Data/Items.rxdata")
  14.     $data_weapons       = load_data("Data/Weapons.rxdata")
  15.     $data_armors        = load_data("Data/Armors.rxdata")
  16.     $data_enemies       = load_data("Data/Enemies.rxdata")
  17.     $data_troops        = load_data("Data/Troops.rxdata")
  18.     $data_states        = load_data("Data/States.rxdata")
  19.     $data_animations    = load_data("Data/Animations.rxdata")
  20.     $data_tilesets      = load_data("Data/Tilesets.rxdata")
  21.     $data_common_events = load_data("Data/CommonEvents.rxdata")
  22.     $data_system        = load_data("Data/System.rxdata")
  23.     $game_system = Game_System.new
  24.     Graphics.frame_count = 0
  25.     $game_temp          = Game_Temp.new
  26.     $game_system        = Game_System.new
  27.     $game_switches      = Game_Switches.new
  28.     $game_variables     = Game_Variables.new
  29.     $game_self_switches = Game_SelfSwitches.new
  30.     $game_screen        = Game_Screen.new
  31.     $game_actors        = Game_Actors.new
  32.     $game_party         = Game_Party.new
  33.     $game_troop         = Game_Troop.new
  34.     $game_map           = Game_Map.new
  35.     $game_player        = Game_Player.new
  36.     $game_party.setup_starting_members
  37.     $game_map.setup($data_system.start_map_id)
  38.     $game_player.moveto($data_system.start_x, $data_system.start_y)
  39.     $game_player.refresh
  40.     $game_map.autoplay
  41.     $game_map.update
  42.     $scene = Scene_Map.new
  43.   end
  44. end


  45. #==============================================================================
  46. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  47. #==============================================================================
复制代码
而截图存档的脚本 是
  1. #===============================================================================

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

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

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

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

  10. # 注意:这个脚本是兼容亿万星辰的“轩辕剑菜单”的版本,不过用在其他场合貌似也不会出错
  11. #   使用时把这个脚本放在“轩辕剑菜单”脚本的下方,也就是更靠近Main的位置
  12. # 兼容处理:叶子
  13. #===============================================================================
  14. module Screen  
  15. @screen = Win32API.new 'screenshot', 'Screenshot', %w(l l l l p l l), ''
  16. @readini = Win32API.new 'kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l'
  17. @findwindow = Win32API.new 'user32', 'FindWindowA', %w(p p), 'l'
  18. module_function
  19. #-----------------------------------------------------------------------------
  20. # here comes the stuff...
  21. # i add here the stuff for automatic change of the number for the screenshot
  22. # so it wont overrite the old one...
  23. # if you want to change so stuff change them in this line below
  24. # or you can change them in your command line... like
  25. # Screen::shot("screenshot", 2)
  26. # this change the name and the type of the screenshot
  27. # (0 = bmp, 1 = jpg and 2 = png)
  28. # ----------------------------------------------------------------------------
  29. def shot(file = "shot", typ = 1)
  30.   # to add the right extension...
  31.   if typ == 0
  32.     typname = ".bmp"
  33.   elsif typ == 1
  34.     typname = ".jpg"
  35.   elsif typ == 2
  36.     typname = ".png"
  37.   end   
  38.   file_index = 0   
  39.   dir = "Save/"   
  40.   # make the filename....
  41.   file_name = dir + file.to_s + typname.to_s   
  42.   if $shot_guodu == 1
  43.     file_name = "Graphics/Pictures/sys_screen.jpg"
  44.     $shot_guodu = 0
  45.   end
  46.   # make the screenshot.... Attention dont change anything from here on....
  47.   @screen.call(160,120,320,240,file_name,handel,typ)
  48. end
  49. # find the game window...
  50. def handel
  51.   game_name = "\0" * 256
  52.   @readini.call('Game','Title','',game_name,255,".\\Game.ini")
  53.   game_name.delete!("\0")
  54.   return @findwindow.call('RGSS Player',game_name)
  55. end
  56. end

  57. class Window_FileCommand < Window_Selectable
  58.   attr_accessor :index
  59. def initialize(index,zzhsavenumber)  
  60.   @zzhsavenumber = zzhsavenumber
  61.     super(-16,-8,640,430)
  62.   self.windowskin = nil
  63.   self.contents = Bitmap.new(640, 480)
  64.   @index = index
  65.   @commands = []   
  66.   for i in 0..35
  67.    @commands.push(i.to_s)
  68.   end
  69.   @[email protected]
  70.   self.opacity = 0
  71. end
  72.   
  73.   def update
  74.    self.top_row=($top_row)
  75.    self.contents.clear
  76.    self_update
  77.    if self.active and @item_max > 0
  78.      index_var = @index
  79.      tp_index = @index
  80.      mouse_x, mouse_y = Mouse.get_mouse_pos
  81.      mouse_not_in_rect = true
  82.      $mouse_not_in_rect = true
  83.      $zzhindex=@index
  84.      for i in 0...@item_max
  85.        @index = i
  86.        @zzhaaa_1=1
  87.        update_cursor_rect
  88.        top_x = self.cursor_rect.x + self.x + 16
  89.        top_y = self.cursor_rect.y + self.y + 16
  90.        bottom_x = top_x + self.cursor_rect.width
  91.        bottom_y = top_y + self.cursor_rect.height
  92.        if (mouse_x > top_x) and (mouse_y > top_y) and
  93.           (mouse_x < bottom_x) and (mouse_y < bottom_y)
  94.          mouse_not_in_rect = false
  95.          $mouse_not_in_rect= false
  96.          $zzhindex=@index
  97.          if tp_index != @index
  98.            tp_index = @index
  99.              $game_system.se_play($data_system.cursor_se)
  100.          end
  101.          break
  102.        end
  103.      end
  104.     if mouse_not_in_rect
  105.        mouse_x, mouse_y = Mouse.get_mouse_pos
  106.           # 当前行被显示开头行前面的情况下
  107.          if self.top_row < row_max-page_row_max and Mouse.press?(Mouse::LEFT)and (mouse_x>500)and(mouse_x<545)and(mouse_y>383)and(mouse_y<408)
  108.             self.top_row +=1
  109.             delay(0.1)
  110.           end
  111.           # 当前行被显示末尾行之后的情况下
  112.           if self.top_row > 0 and Mouse.press?(Mouse::LEFT)and (mouse_x>500)and(mouse_x<545)and(mouse_y>32)and(mouse_y<58)
  113.             # 从当前行向末尾滚动
  114.             self.top_row -=1
  115.             delay(0.1)
  116.           end
  117.        @index = index_var
  118.        if self.is_a?(Window_Target)
  119.           @index=-3
  120.         end
  121.        @zzhaaa_1=2
  122.        update_cursor_rect
  123.        Mouse.click_lock
  124.      else
  125.        Mouse.click_unlock               
  126.      end
  127.    end
  128.    $top_row = self.top_row
  129. end
  130.   
  131.   def update_cursor_rect
  132.     # 光标位置不满 0 的情况下
  133.     if @index < 0
  134.       self.cursor_rect.empty
  135.       return
  136.     end
  137.     # 获取当前的行
  138.     row = @index
  139.     # 当前行被显示开头行前面的情况下
  140.     if row < self.top_row
  141.       # 从当前行向开头行滚动
  142.       self.cursor_rect.empty
  143.       return
  144.     end
  145.     # 当前行被显示末尾行之后的情况下
  146.     if row > self.top_row + (self.page_row_max - 1)
  147.       # 从当前行向末尾滚动
  148.       self.cursor_rect.empty
  149.       return
  150.     end
  151.     # 计算光标坐标
  152.     x = 8
  153.     y = 26 + @index * 92- self.oy
  154.     # 更新国标矩形
  155.    self.cursor_rect.set(x, y, 490, 92)
  156. end

  157.    def top_row
  158.     # 将窗口内容的传送源 Y 坐标、1 行的高 32 等分
  159.     return self.oy / 92
  160.   end
  161.   #--------------------------------------------------------------------------
  162.   # ● 设置开头行
  163.   #     row : 显示开头的行
  164.   #--------------------------------------------------------------------------
  165.   def top_row=(row)
  166.     # row 未满 0 的场合更正为 0
  167.     if row < 0
  168.       row = 0
  169.     end
  170.     # row 超过 row_max - 1 的情况下更正为 row_max - 1
  171.     if row > row_max - 1
  172.       row = row_max - 1
  173.     end
  174.     # row 1 行高的 32 倍、窗口内容的传送源 Y 坐标

  175.      self.oy = row * 92

  176.   end
  177.   #--------------------------------------------------------------------------
  178.   # ● 获取 1 页可以显示的行数
  179.   #--------------------------------------------------------------------------
  180.   def page_row_max
  181.     # 窗口的高度,设置画面的高度减去 32 ,除以 1 行的高度 32
  182.     return (self.height - 32) / 92
  183.   end
  184.   
  185.   def delay(seconds)
  186.     for i in 0...(seconds * 1)
  187.       sleep 0.01
  188.       Graphics.update
  189.     end
  190.   end
  191.   
  192. end

  193. class Window_FilePicture2 < Window_Base
  194.   def initialize
  195.    super(-16,-8,640,480)
  196.    self.contents = Bitmap.new(640, 480)
  197.    self.opacity = 0
  198.    self.contents.clear
  199.   end
  200. def update
  201.   self.contents.clear
  202.   if $mouse_not_in_rect == false
  203.     bitmap = Bitmap.new("Graphics/System/menu/sys/存档-2.png")
  204.     src_rect = Rect.new(0, 0, bitmap.width+15, bitmap.height+15)
  205.     self.contents.blt(8, 30 + ($zzhindex - $top_row) * 92 , bitmap, src_rect)
  206.   end
  207. end
  208. end
  209.   
  210. class Window_FilePicture < Window_Base
  211. def initialize(index)
  212.    super(-16,-8,640,480)
  213.    self.contents = Bitmap.new(640, 480)
  214.     self.opacity = 0
  215.     self.contents.clear
  216.     bitmap = Bitmap.new("Graphics/System/menu/sys/存档顶条.png")
  217.     src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
  218.     self.contents.blt(5, 12, bitmap, src_rect)  
  219.     bitmap = Bitmap.new("Graphics/System/menu/sys/存档底条.png")
  220.     src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
  221.     self.contents.blt(6, 394, bitmap, src_rect)  
  222.     if index == 0
  223.       bitmap = Bitmap.new("Graphics/System/menu/sys/存储进度-3.png")
  224.     else
  225.       bitmap = Bitmap.new("Graphics/System/menu/sys/读取进度-3.png")
  226.     end
  227.   
  228.     src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
  229.     bitmap1 = Bitmap.new("Graphics/System/menu/sys/存档-1.png")
  230.     src_rect1 = Rect.new(0, 0, bitmap1.width+15, bitmap1.height+15)
  231.     for i in 0..3
  232.       self.contents.blt(8, 30+i*92, bitmap1, src_rect1)
  233.       self.contents.blt(37, 43+i*92 , bitmap, src_rect)
  234.     end
  235.     bitmap = Bitmap.new("Graphics/System/menu/sys/存档滚动条.png")
  236.     src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
  237.     self.contents.blt(500, 32, bitmap, src_rect)
  238.    
  239.     if index == 0
  240.      bitmap = Bitmap.new("Graphics/System/menu/sys/存储进度-1.png")
  241.      bitmap1 = Bitmap.new("Graphics/System/menu/sys/读取进度-2.png")
  242.     else
  243.      bitmap = Bitmap.new("Graphics/System/menu/sys/存储进度-2.png")
  244.      bitmap1 = Bitmap.new("Graphics/System/menu/sys/读取进度-1.png")
  245.     end
  246.     src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
  247.     self.contents.blt(97, 0, bitmap, src_rect)     
  248.     src_rect = Rect.new(0, 0, bitmap1.width, bitmap1.height)
  249.     self.contents.blt(282, 0, bitmap1, src_rect)
  250.   end
  251. end
  252.    
  253. class Window_File < Window_Base
  254. attr_accessor :index
  255. def initialize(index ,zzhsavenumber )
  256.   @zzhsavenumber = zzhsavenumber
  257.   @backsp = Sprite.new
  258.   @backsp.z = 99
  259.   super(-8,0,525,480)
  260.    self.opacity = 0
  261.   #这行可以不用
  262.   self.contents = Bitmap.new(width - 32, height - 32)
  263.   @index = index
  264.   #这里我要说明一句,之所以用sprite是为了放缩图片
  265.   @sprite = Sprite.new
  266.   @sprite.visible = false
  267.   @sprite.z = 1000
  268.   @sp_ch = []
  269.   @sp_ch[0] = Sprite.new
  270.   refresh
  271. end
  272. def refresh
  273.   self.contents.clear
  274.   for i in @sp_ch
  275.     i.visible = false
  276.   end
  277.   @sprite.visible = false
  278.   self.contents.font.size =18
  279.   self.contents.font.name = ["华文行楷","隶书","黑体","楷体","宋体"]
  280.   self.contents.font.color.set(0,0,0)
  281.   $zzhok = false
  282.   self.contents.draw_text(-3, 55+@zzhsavenumber * 92, 32, 32, @index.to_s , 1)
  283.   $zzhok = true
  284.   if FileTest.exist?(BBS_66RPG_DIR+"Save#{@index}.rxdata")
  285.     @sprite.visible = true
  286.     if FileTest.exist?(BBS_66RPG_DIR+"Save#{@index}.jpg")
  287.       @sprite.bitmap = Bitmap.new(BBS_66RPG_DIR+"Save#{@index}.jpg")
  288.     else
  289.       #self.contents.draw_text(32,64,400,32,"截图似乎有点问题……您搞什么了您?")
  290.     end
  291.     @sprite.x = 379
  292.     @sprite.y = 50 + @zzhsavenumber * 92
  293.     @sprite.zoom_x = 0.292
  294.     @sprite.zoom_y = 0.29
  295.     file = File.open(BBS_66RPG_DIR+"Save#{@index}.rxdata", "r")
  296.     @time_stamp = file.mtime
  297.     @gold = Marshal.load(file)
  298.     @save_map_name = Marshal.load(file)
  299.     @characters = Marshal.load(file)
  300.     @frame_count = Marshal.load(file)
  301.     @game_system = Marshal.load(file)
  302.     @game_switches = Marshal.load(file)
  303.     @game_variables = Marshal.load(file)
  304.     @total_sec = @frame_count / Graphics.frame_rate
  305.     file.close
  306.     $game_temp.last_file_index = @index
  307.     for i in [email protected]
  308.       @sp_ch[i] = Sprite.new
  309.       @sp_ch[i].visible = true
  310.       @sp_ch[i].bitmap = Bitmap.new("Graphics/system/menu/headp/" +@characters[i][2].to_s + "_save.png")
  311.       if i==0
  312.        @sp_ch[i].x = 72
  313.       else
  314.        @sp_ch[i].x = 77+i*43
  315.       end
  316.       @sp_ch[i].y = 120 + @zzhsavenumber * 92-@sp_ch[i].bitmap.height
  317.       @sp_ch[i].z = 1001
  318.     end
  319.     # 描绘游戏时间
  320.     hour = @total_sec / 60 / 60
  321.     min = @total_sec / 60 % 60
  322.     sec = @total_sec % 60
  323.     time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
  324.     self.contents.font.size =18
  325.     self.contents.font.name = ["华文行楷","隶书","黑体","楷体","宋体"]
  326.     self.contents.font.color.set(0,0,0)
  327.     $zzhok = false
  328.     self.contents.draw_text(210, 40+@zzhsavenumber * 92, 72, 32, "时间" , 2)
  329.     self.contents.draw_text(290, 40+@zzhsavenumber * 92, 72, 32, time_string, 2)
  330.     self.contents.draw_text(210, 60+@zzhsavenumber * 92, 72, 32, "金钱", 2)
  331.     self.contents.draw_text(290, 60+@zzhsavenumber * 92, 72, 32, @gold, 2)
  332.     self.contents.draw_text(210, 80+@zzhsavenumber * 92, 72, 32, "地点", 2)
  333.     self.contents.draw_text(290, 80+@zzhsavenumber * 92, 72, 32, @save_map_name, 2)
  334.     $zzhok = true
  335.     # 描绘时间标记
  336.     #self.contents.font.color = normal_color
  337.     #time_string = @time_stamp.strftime("%Y/%m/%d %H:%M")
  338.     #self.contents.draw_text(4, 420, 420 + 16, 32, time_string, 2)
  339.     #src_rect = Rect.new(0,0,16,16)
  340.     #bitmap = Bitmap.new("Graphics/system/menu/back/money.png")
  341.     #self.contents.blt(420 + 16 - @gold.size * 16, 4 + 8, bitmap, src_rect)
  342.   #else
  343.   #  self.contents.draw_text(32,32,420 + 16,32,"空白记忆")
  344.   end
  345. end
  346. def dispose
  347.   super
  348.   @sprite.dispose
  349.   @backsp.dispose
  350.   for i in @sp_ch
  351.     i.dispose
  352.   end
  353. end
  354. end


  355. class Scene_Save
  356. def main
  357.   @picture_window = Window_FilePicture_2.new(1)
  358.   @picture_window2= Window_FilePicture2_2.new
  359.   @save_command_window = Window_FileCommand_2.new($game_temp.last_file_index,0)
  360.   @save_command_window.y = -4
  361.   @save_command_window.index = $game_temp.last_file_index
  362.   #@save_command_window.update
  363.   @content_window0 = Window_File_2.new($game_temp.last_file_index,0)
  364.   @content_window1 = Window_File_2.new($game_temp.last_file_index+1,1)
  365.   @content_window2 = Window_File_2.new($game_temp.last_file_index+2,2)
  366.   @content_window3 = Window_File_2.new($game_temp.last_file_index+3,3)
  367.   @oldtop_row=0
  368.   $top_row=0
  369.   if $game_temp.last_file_index <= 33
  370.     $top_row=$game_temp.last_file_index
  371.   else
  372.     $top_row=33
  373.   end
  374.   @save_command_window.active = true
  375.   @save_command_window_update = true
  376.   # 执行过渡
  377.   Graphics.transition
  378.   # 主循环
  379.   loop do
  380.     # 刷新游戏画面
  381.     Graphics.update
  382.     # 刷新输入信息
  383.     Input.update
  384.     # 刷新画面
  385.     update
  386.     # 如果画面被切换的话就中断循环
  387.     if $scene != self
  388.       break
  389.     end
  390.   end
  391.   # 准备过渡
  392.   Graphics.freeze
  393.   @save_command_window.dispose
  394.   @content_window0.dispose
  395.   @content_window1.dispose
  396.   @content_window2.dispose
  397.   @content_window3.dispose
  398.   @picture_window.dispose
  399.   @picture_window2.dispose
  400. end
  401. def update
  402.   @save_command_window.update
  403.   @picture_window2.update
  404.   if @oldtop_row != $top_row
  405.     @content_window0.index = $top_row
  406.     @content_window0.refresh
  407.     @content_window1.index = $top_row+1
  408.     @content_window1.refresh
  409.     @content_window2.index = $top_row+2
  410.     @content_window2.refresh
  411.     @content_window3.index = $top_row+3
  412.     @content_window3.refresh
  413.   end   
  414.    @oldtop_row = $top_row
  415.   #——————下面这一部分是原装脚本——————#
  416.   if Input.trigger?(Input::B)  
  417.     $game_system.se_play($data_system.cancel_se)
  418.     if $game_temp.save_calling
  419.       $game_temp.save_calling = false
  420.       $scene = Scene_Map.new
  421.       return
  422.     end
  423.     #$scene = Scene_Map.new
  424.   end   
  425.   #———————————————————————#   
  426.   if Input.trigger?(Input::C)
  427.     # 演奏存档 SE
  428.     $game_system.se_play($data_system.save_se)
  429.     # 写入存档数据
  430.     file = File.open(BBS_66RPG_DIR+"Save#{@save_command_window.index}.rxdata", "wb")
  431.     write_save_data(file)
  432.     if FileTest.exist?(BBS_66RPG_DIR+"shot.jpg")
  433.       File.rename(BBS_66RPG_DIR+"shot.jpg", BBS_66RPG_DIR+"Save#{@save_command_window.index}.jpg")
  434.     end
  435.     file.close
  436.     $game_temp.last_file_index = @save_command_window.index
  437.     # 如果被事件调用
  438.     if $game_temp.save_calling
  439.       # 清除存档调用标志
  440.       $game_temp.save_calling = false
  441.       # 切换到地图画面
  442.       $scene = Scene_Map.new
  443.       return
  444.     end
  445.     # 切换到菜单画面
  446.     $scene = Scene_Map.new
  447.   end
  448.   #———————————————————————#
  449. end
  450. #--------------------------------------------------------------------------
  451. # ● 写入存档数据
  452. #     file : 写入用文件对像 (已经打开)
  453. #--------------------------------------------------------------------------
  454. def write_save_data(file)
  455.   # 生成描绘存档文件用的角色图形
  456.   characters = []
  457.   for i in 0...$game_party.actors.size
  458.     actor = $game_party.actors[i]
  459.     characters.push([actor.character_name, actor.character_hue, actor.id, actor.battler_name, actor.battler_hue])
  460.   end
  461.   #####################################################################
  462.   id = $game_map.map_id
  463.   name = $data_mapinfos[id].name
  464.   if name.include?("★")
  465.     @save_map_name = name.split(/★/)[0]
  466.   else
  467.     @save_map_name = name
  468.   end
  469.   Marshal.dump($game_party.gold.to_s, file)
  470.   Marshal.dump(@save_map_name, file)
  471.   #####################################################################
  472.   # 写入描绘存档文件用的角色数据
  473.   Marshal.dump(characters, file)
  474.   # 写入测量游戏时间用画面计数
  475.   Marshal.dump(Graphics.frame_count, file)
  476.   # 增加 1 次存档次数
  477.   $game_system.save_count += 1
  478.   # 保存魔法编号
  479.   # (将编辑器保存的值以随机值替换)
  480.   $game_system.magic_number = $data_system.magic_number
  481.   # 写入各种游戏对像
  482.   Marshal.dump($game_system, file)
  483.   Marshal.dump($game_switches, file)
  484.   Marshal.dump($game_variables, file)
  485.   Marshal.dump($game_self_switches, file)
  486.   Marshal.dump($game_screen, file)
  487.   Marshal.dump($game_actors, file)
  488.   Marshal.dump($game_party, file)
  489.   Marshal.dump($game_troop, file)
  490.   Marshal.dump($game_map, file)
  491.   Marshal.dump($game_player, file)
  492. end
  493. end




  494. class Scene_Menu
  495. alias bbs_66rpg_shotsave_main main
  496. def main
  497.   if @menu_index == 0
  498.     Screen::shot
  499.   end   
  500.   bbs_66rpg_shotsave_main
  501. end
  502. end

  503. class Interpreter
  504. #--------------------------------------------------------------------------
  505. # ● 调用存档画面
  506. #--------------------------------------------------------------------------
  507. def command_352
  508.   # 设置战斗中断标志
  509.   $game_temp.battle_abort = true
  510.   # 设置调用存档标志
  511.   $game_temp.save_calling = true
  512.   # 推进索引
  513.   @index += 1
  514.   # 结束
  515.   Screen::shot
  516.   return false
  517. end
  518. end
复制代码
还有在个性标题的时候进入读档界面,也发生了冲突 是  第400行 发生冲突


  1. class Scene_Load
  2. def initialize(force = false)
  3.   @in_game = force
  4.   # 再生成临时对像
  5.   $game_temp = Game_Temp.new
  6.   # 选择存档时间最新的文件
  7.   $game_temp.last_file_index = 0
  8.   latest_time = Time.at(0)
  9.   for i in 0..6
  10.     filename = BBS_66RPG_DIR+"Save#{i}.rxdata"
  11.     if FileTest.exist?(filename)
  12.       file = File.open(filename, "r")
  13.       if file.mtime > latest_time
  14.         latest_time = file.mtime
  15.         $game_temp.last_file_index = i
  16.       end
  17.       file.close
  18.     end
  19.   end
  20. end  

  21. def main
  22.   @picture_window = Window_FilePicture_2.new(0)
  23.   @picture_window2= Window_FilePicture2_2.new
  24.   @load_command_window = Window_FileCommand_2.new($game_temp.last_file_index,0)
  25.   @load_command_window.y = -4
  26.   @load_command_window.index = $game_temp.last_file_index
  27.   @content_window0 = Window_File_2.new($game_temp.last_file_index,0)
  28.   @content_window1 = Window_File_2.new($game_temp.last_file_index+1,1)
  29.   @content_window2 = Window_File_2.new($game_temp.last_file_index+2,2)
  30.   @content_window3 = Window_File_2.new($game_temp.last_file_index+3,3)
  31.   @oldtop_row=0
  32.   if $game_temp.last_file_index <= 33
  33.     $top_row=$game_temp.last_file_index
  34.   else
  35.     $top_row=33
  36.   end
  37.   @load_command_window.active = true
  38.   @load_command_window_update = true
  39.   # 执行过渡
  40.   Graphics.transition
  41.   # 主循环
  42.   loop do
  43.     # 刷新游戏画面
  44.     Graphics.update
  45.     # 刷新输入信息
  46.     Input.update
  47.     # 刷新画面
  48.     update
  49.     # 如果画面被切换的话就中断循环
  50.     if $scene != self
  51.       break
  52.     end
  53.   end
  54.   # 准备过渡
  55.   Graphics.freeze
  56.      @load_command_window.dispose
  57.      @content_window0.dispose
  58.      @content_window1.dispose
  59.      @content_window2.dispose
  60.      @content_window3.dispose
  61.      @picture_window.dispose
  62.      @picture_window2.dispose
  63. end

  64. def update
  65.   @load_command_window.update   
  66.   @picture_window2.update
  67.   if @oldtop_row != $top_row
  68.     @content_window0.index = $top_row
  69.     @content_window0.refresh
  70.     @content_window1.index = $top_row+1
  71.     @content_window1.refresh
  72.     @content_window2.index = $top_row+2
  73.     @content_window2.refresh
  74.     @content_window3.index = $top_row+3
  75.     @content_window3.refresh
  76.   end   
  77.    @oldtop_row = $top_row     
  78.   #——————下面这一部分是原装脚本——————#
  79.   if Input.trigger?(Input::B)  
  80.   # 演奏取消 SE
  81.   $game_system.se_play($data_system.cancel_se)
  82.      $scene = Scene_Title.new
  83.    end
  84.    #Mouse.press?(Mouse::LEFT)and  
  85.    mouse_x, mouse_y = Mouse.get_mouse_pos
  86.    if  (mouse_x>600)and(mouse_x<640)and(mouse_y>430)and(mouse_y<470)
  87.      if Mouse.zzhtrigger?(Mouse::LEFT)
  88.       $scene = Scene_Title.new
  89.      end
  90.    end
  91.   
  92.   #———————————————————————#   
  93.   if Input.trigger?(Input::C)
  94.     # 文件不存在的情况下
  95.     unless FileTest.exist?(BBS_66RPG_DIR+"Save#{@load_command_window.index}.rxdata")
  96.       # 演奏冻结 SE
  97.       $game_system.se_play($data_system.buzzer_se)
  98.       return
  99.     end
  100.     if $piantou == 1
  101.       for i in 1..3
  102.         $menupicback[i].bitmap.dispose
  103.       end
  104.     end
  105.     # 演奏读档 SE
  106.     $game_system.se_play($data_system.load_se)
  107.     # 写入存档数据
  108.     file = File.open(BBS_66RPG_DIR+"Save#{@load_command_window.index}.rxdata", "rb")
  109.     read_save_data(file)
  110.     file.close
  111.     # 还原 BGM、BGS
  112.     $game_system.bgm_play($game_system.playing_bgm)
  113.     $game_system.bgs_play($game_system.playing_bgs)
  114.     # 刷新地图 (执行并行事件)
  115.     $game_map.update
  116.     # 切换到地图画面
  117.     $scene = Scene_Map.new
  118.   end
  119.   #———————————————————————#
  120. end

  121. #--------------------------------------------------------------------------
  122. # ● 写入存档数据
  123. #     file : 写入用文件对像 (已经打开)
  124. #--------------------------------------------------------------------------
  125. def read_save_data(file)
  126.   @gold = Marshal.load(file)
  127.   @save_map_name = Marshal.load(file)
  128.   # 读取描绘存档文件用的角色数据
  129.   characters = Marshal.load(file)
  130.   # 读取测量游戏时间用画面计数
  131.   Graphics.frame_count = Marshal.load(file)
  132.   # 读取各种游戏对像
  133.   $game_system        = Marshal.load(file)
  134.   $game_switches      = Marshal.load(file)
  135.   $game_variables     = Marshal.load(file)
  136.   $game_self_switches = Marshal.load(file)
  137.   $game_screen        = Marshal.load(file)
  138.   $game_actors        = Marshal.load(file)
  139.   $game_party         = Marshal.load(file)
  140.   $game_troop         = Marshal.load(file)
  141.   $game_map           = Marshal.load(file)
  142.   $game_player        = Marshal.load(file)
  143.   # 魔法编号与保存时有差异的情况下
  144.   # (加入编辑器的编辑过的数据)
  145.   if $game_system.magic_number != $data_system.magic_number
  146.     # 重新装载地图
  147.     $game_map.setup($game_map.map_id)
  148.     $game_player.center($game_player.x, $game_player.y)
  149.   end
  150.   # 刷新同伴成员
  151.   $game_party.refresh
  152. end
  153. end

  154. class Window_FileCommand_2 < Window_Selectable
  155.   attr_accessor :index
  156. def initialize(index,zzhsavenumber)  
  157.   @zzhsavenumber = zzhsavenumber
  158.     super(44,16,640,454)
  159.   self.windowskin = nil
  160.   self.contents = Bitmap.new(640, 480)
  161.   @index = index
  162.   @commands = []   
  163.   for i in 0..35
  164.    @commands.push(i.to_s)
  165.   end
  166.   @[email protected]
  167.   self.opacity = 0
  168. end
  169.   
  170.   def update
  171.    self.top_row=($top_row)
  172.    self.contents.clear
  173.    self_update
  174.    if self.active and @item_max > 0
  175.      index_var = @index
  176.      tp_index = @index
  177.      mouse_x, mouse_y = Mouse.get_mouse_pos
  178.      mouse_not_in_rect = true
  179.      $mouse_not_in_rect = true
  180.      $zzhindex=@index
  181.      for i in 0...@item_max
  182.        @index = i
  183.        @zzhaaa_1=1
  184.        update_cursor_rect
  185.        top_x = self.cursor_rect.x + self.x + 16
  186.        top_y = self.cursor_rect.y + self.y + 16
  187.        bottom_x = top_x + self.cursor_rect.width
  188.        bottom_y = top_y + self.cursor_rect.height
  189.        if (mouse_x > top_x) and (mouse_y > top_y) and
  190.           (mouse_x < bottom_x) and (mouse_y < bottom_y)
  191.          mouse_not_in_rect = false
  192.          $mouse_not_in_rect= false
  193.          $zzhindex=@index
  194.          if tp_index != @index
  195.            tp_index = @index
  196.              $game_system.se_play($data_system.cursor_se)
  197.          end
  198.          break
  199.        end
  200.      end
  201.     if mouse_not_in_rect
  202.        mouse_x, mouse_y = Mouse.get_mouse_pos
  203.           # 当前行被显示开头行前面的情况下
  204.          if self.top_row < row_max-page_row_max and Mouse.press?(Mouse::LEFT)and (mouse_x>560)and(mouse_x<605)and(mouse_y>407)and(mouse_y<432)
  205.             self.top_row +=1
  206.             delay(0.1)
  207.           end
  208.           # 当前行被显示末尾行之后的情况下
  209.           if self.top_row > 0 and Mouse.press?(Mouse::LEFT)and (mouse_x>560)and(mouse_x<605)and(mouse_y>56)and(mouse_y<82)
  210.             # 从当前行向末尾滚动
  211.             self.top_row -=1
  212.             delay(0.1)
  213.           end
  214.        @index = index_var
  215.        if self.is_a?(Window_Target)
  216.           @index=-3
  217.         end
  218.        @zzhaaa_1=2
  219.        update_cursor_rect
  220.        Mouse.click_lock
  221.      else
  222.        Mouse.click_unlock               
  223.      end
  224.    end
  225.    $top_row = self.top_row
  226. end
  227.   
  228.   def update_cursor_rect
  229.     # 光标位置不满 0 的情况下
  230.     if @index < 0
  231.       self.cursor_rect.empty
  232.       return
  233.     end
  234.     # 获取当前的行
  235.     row = @index
  236.     # 当前行被显示开头行前面的情况下
  237.     if row < self.top_row
  238.       # 从当前行向开头行滚动
  239.       self.cursor_rect.empty
  240.       return
  241.     end
  242.     # 当前行被显示末尾行之后的情况下
  243.     if row > self.top_row + (self.page_row_max - 1)
  244.       # 从当前行向末尾滚动
  245.       self.cursor_rect.empty
  246.       return
  247.     end
  248.     # 计算光标坐标
  249.     x = 8
  250.     y = 26 + @index * 92- self.oy
  251.     # 更新国标矩形
  252.    self.cursor_rect.set(x, y, 490, 92)
  253. end

  254.    def top_row
  255.     # 将窗口内容的传送源 Y 坐标、1 行的高 32 等分
  256.     return self.oy / 92
  257.   end
  258.   #--------------------------------------------------------------------------
  259.   # ● 设置开头行
  260.   #     row : 显示开头的行
  261.   #--------------------------------------------------------------------------
  262.   def top_row=(row)
  263.     # row 未满 0 的场合更正为 0
  264.     if row < 0
  265.       row = 0
  266.     end
  267.     # row 超过 row_max - 1 的情况下更正为 row_max - 1
  268.     if row > row_max - 1
  269.       row = row_max - 1
  270.     end
  271.     # row 1 行高的 32 倍、窗口内容的传送源 Y 坐标

  272.      self.oy = row * 92

  273.   end
  274.   #--------------------------------------------------------------------------
  275.   # ● 获取 1 页可以显示的行数
  276.   #--------------------------------------------------------------------------
  277.   def page_row_max
  278.     # 窗口的高度,设置画面的高度减去 32 ,除以 1 行的高度 32
  279.     return (self.height - 32) / 92
  280.   end
  281.   
  282.   def delay(seconds)
  283.     for i in 0...(seconds * 1)
  284.       sleep 0.01
  285.       Graphics.update
  286.     end
  287.   end
  288.   
  289. end

  290. class Window_FilePicture2_2 < Window_Base
  291.   def initialize
  292.    super(-16,-8,640,480)
  293.    self.contents = Bitmap.new(640, 480)
  294.    self.opacity = 0
  295.    self.contents.clear
  296.   end
  297. def update
  298.   self.contents.clear
  299.   zzhx=60
  300.   zzhy=24
  301.   if $mouse_not_in_rect == false
  302.     bitmap = Bitmap.new("Graphics/System/menu/sys/存档-2.png")
  303.     src_rect = Rect.new(0, 0, bitmap.width+15, bitmap.height+15)
  304.     self.contents.blt(8+zzhx, 30 + ($zzhindex - $top_row) * 92 +zzhy, bitmap, src_rect)
  305.   end
  306. end
  307. end
  308.   
  309. class Window_FilePicture_2 < Window_Base
  310. def initialize (index)
  311.    super(-16,-16,672,512)
  312.    self.contents = Bitmap.new(656, 496)
  313.    zzhx=60
  314.    zzhy=32
  315.     self.opacity = 0
  316.     self.contents.clear
  317.     bitmap = Bitmap.new("Graphics/System/menu/底图_读档.jpg")
  318.     src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
  319.     self.contents.blt(0, 0, bitmap, src_rect)  
  320.     bitmap = Bitmap.new("Graphics/System/menu/sys/存档顶条.png")
  321.     src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
  322.     self.contents.blt(5+zzhx, 12+zzhy, bitmap, src_rect)  
  323.     bitmap = Bitmap.new("Graphics/System/menu/sys/存档底条.png")
  324.     src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
  325.     self.contents.blt(6+zzhx, 394+zzhy, bitmap, src_rect)  
  326.     if index ==0
  327.       bitmap = Bitmap.new("Graphics/System/menu/sys/读取进度-3.png")
  328.     else
  329.       bitmap = Bitmap.new("Graphics/System/menu/sys/存储进度-3.png")
  330.     end
  331.     src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
  332.     bitmap1 = Bitmap.new("Graphics/System/menu/sys/存档-1.png")
  333.     src_rect1 = Rect.new(0, 0, bitmap1.width+15, bitmap1.height+15)
  334.     for i in 0..3
  335.       self.contents.blt(8+zzhx, 30+i*92+zzhy, bitmap1, src_rect1)
  336.       self.contents.blt(37+zzhx, 43+i*92+zzhy , bitmap, src_rect)
  337.     end
  338.     bitmap = Bitmap.new("Graphics/System/menu/sys/存档滚动条.png")
  339.     src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
  340.     self.contents.blt(500+zzhx, 32+zzhy, bitmap, src_rect)
  341.   end
  342. end
  343.    
  344. class Window_File_2 < Window_Base
  345. attr_accessor :index
  346. def initialize(index ,zzhsavenumber )
  347.   @zzhsavenumber = zzhsavenumber
  348.   @backsp = Sprite.new
  349.   @backsp.z = 99
  350.   super(-8,0,525,480)
  351.    self.opacity = 0
  352.   #这行可以不用
  353.   self.contents = Bitmap.new(width - 32, height - 32)
  354.   @index = index
  355.   #这里我要说明一句,之所以用sprite是为了放缩图片
  356.   @sprite = Sprite.new
  357.   @sprite.visible = false
  358.   @sprite.z = 1000
  359.   @sp_ch = []
  360.   @sp_ch[0] = Sprite.new
  361.   refresh
  362. end
  363. def refresh
  364.   self.contents.clear
  365.   zzhx=60
  366.   zzhy=24
  367.   for i in @sp_ch
  368.     i.visible = false
  369.   end
  370.   @sprite.visible = false
  371.   self.contents.font.size =18
  372.   self.contents.font.name = ["华文行楷","隶书","黑体","楷体","宋体"]
  373.   self.contents.font.color.set(0,0,0)
  374.   $zzhok = false
  375.   self.contents.draw_text(-3+zzhx, 55+@zzhsavenumber * 92+zzhy, 32, 32, @index.to_s , 1)
  376.   $zzhok = true
  377.   if FileTest.exist?(BBS_66RPG_DIR+"Save#{@index}.rxdata")
  378.     @sprite.visible = true
  379.     if FileTest.exist?(BBS_66RPG_DIR+"Save#{@index}.jpg")
  380.       @sprite.bitmap = Bitmap.new(BBS_66RPG_DIR+"Save#{@index}.jpg")
  381.     else
  382.       #self.contents.draw_text(32,64,400,32,"截图似乎有点问题……您搞什么了您?")
  383.     end
  384.     @sprite.x = 379+zzhx
  385.     @sprite.y = 50 + @zzhsavenumber * 92+zzhy
  386.     @sprite.zoom_x = 0.292
  387.     @sprite.zoom_y = 0.29
  388.     file = File.open(BBS_66RPG_DIR+"Save#{@index}.rxdata", "r")
  389.     @time_stamp = file.mtime
  390.     @gold = Marshal.load(file)
  391.     @save_map_name = Marshal.load(file)
  392.     @characters = Marshal.load(file)
  393.     @frame_count = Marshal.load(file)
  394.     @game_system = Marshal.load(file)
  395.     @game_switches = Marshal.load(file)
  396.     @game_variables = Marshal.load(file)
  397.     @total_sec = @frame_count / Graphics.frame_rate
  398.     file.close
  399.     for i in [email protected]
  400.       @sp_ch[i] = Sprite.new
  401.       @sp_ch[i].visible = true
  402.       @sp_ch[i].bitmap = Bitmap.new("Graphics/system/menu/headp/" +@characters[i][2].to_s + "_save.png")
  403.       if i==0
  404.        @sp_ch[i].x = 72+zzhx
  405.       else
  406.        @sp_ch[i].x = 77+i*43+zzhx
  407.       end
  408.       @sp_ch[i].y = 120 + @zzhsavenumber * 92-@sp_ch[i].bitmap.height+zzhy
  409.       @sp_ch[i].z = 1001
  410.     end
  411.     # 描绘游戏时间
  412.     hour = @total_sec / 60 / 60
  413.     min = @total_sec / 60 % 60
  414.     sec = @total_sec % 60
  415.     time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
  416.     self.contents.font.size =18
  417.     self.contents.font.name = ["华文行楷","隶书","黑体","楷体","宋体"]
  418.     self.contents.font.color.set(0,0,0)
  419.     $zzhok = false
  420.     self.contents.draw_text(210+zzhx, 40+@zzhsavenumber * 92+zzhy, 72, 32, "时间" , 2)
  421.     self.contents.draw_text(290+zzhx, 40+@zzhsavenumber * 92+zzhy, 72, 32, time_string, 2)
  422.     self.contents.draw_text(210+zzhx, 60+@zzhsavenumber * 92+zzhy, 72, 32, "金钱", 2)
  423.     self.contents.draw_text(290+zzhx, 60+@zzhsavenumber * 92+zzhy, 72, 32, @gold, 2)
  424.     self.contents.draw_text(210+zzhx, 80+@zzhsavenumber * 92+zzhy, 72, 32, "地点", 2)
  425.     self.contents.draw_text(290+zzhx, 80+@zzhsavenumber * 92+zzhy, 72, 32, @save_map_name, 2)
  426.     $zzhok = true
  427.     # 描绘时间标记
  428.     #self.contents.font.color = normal_color
  429.     #time_string = @time_stamp.strftime("%Y/%m/%d %H:%M")
  430.     #self.contents.draw_text(4, 420, 420 + 16, 32, time_string, 2)
  431.     #src_rect = Rect.new(0,0,16,16)
  432.     #bitmap = Bitmap.new("Graphics/system/menu/back/money.png")
  433.     #self.contents.blt(420 + 16 - @gold.size * 16, 4 + 8, bitmap, src_rect)
  434.   #else
  435.   #  self.contents.draw_text(32,32,420 + 16,32,"空白记忆")
  436.   end
  437. end
  438. def dispose
  439.   super
  440.   @sprite.dispose
  441.   @backsp.dispose
  442.   for i in @sp_ch
  443.     i.dispose
  444.   end
  445. end
  446. end

复制代码
请各位高手帮忙解决下!!!!
作者: 563296144    时间: 2010-12-20 17:48
回复 5dare 的帖子

查看一下 你的脚本编辑器里的冲突 也就是400段 那一段代码 在你的 脚本编辑器里 一定有重复的 ,我的运行没有任何问题 = =




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1