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

Project1

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

[已经解决] 带着立绘的截图存档

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
154 小时
注册时间
2013-12-20
帖子
66
跳转到指定楼层
1
发表于 2013-12-21 07:55:03 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 丽塔菌 于 2013-12-21 20:14 编辑

希望可以把存档的样式改成这个样子,附带着游戏立绘。
因为嫌截图存档脚本有点烂大街了,自己又不会脚本什么的,于是来求助一下【捂脸
希望有人帮忙呢嗯

未命名.JPG (17.68 KB, 下载次数: 59)

未命名.JPG

点评

你单身的原因是:长得丑,还嫌别人长得丑  发表于 2013-12-21 08:26

Lv1.梦旅人

梦石
0
星屑
50
在线时间
177 小时
注册时间
2013-7-23
帖子
125
2
发表于 2013-12-21 13:17:08 | 只看该作者
我会试试的。
同样和楼主想的一样
最近在大作死中……
回复 支持 反对

使用道具 举报

Lv5.捕梦者 (暗夜天使)

只有笨蛋才会看到

梦石
1
星屑
21484
在线时间
9389 小时
注册时间
2012-6-19
帖子
7114

开拓者短篇九导演组冠军

3
发表于 2013-12-21 15:45:44 | 只看该作者


完成了,你自己先试试有没有BUG,这玩意儿主要就是修改坐标修改的挺烦,本质上并不难,

立绘放到Graphics\m5lihui文件夹下,文件名为队伍第一名角色的昵称(游戏中更改这个昵称立绘的图片就可以对应的发生改变)
  1. $_PS0 = {} if $_PS0 == nil  
  2. $_PS0["Window_SaveFile_Plus"] = 20120216
  3. module PS0
  4.   module Window_SaveFile_Plus

  5.     # 最大存档数(范围正整数)
  6.     MAX_SAVE = 18

  7.     # 存档目录(默认值 "Saves/";根目录 "")
  8.     SAVE_DIR = "Saves/"   

  9.     # 无存档时显示的文字
  10.     NO_DATA  = "无存档"

  11.     # 保存时显示的信息
  12.     SAVE_NOW = "存档中..."

  13.     # 复制存档时的帮助文字
  14.     HELP_COPY = "要复制到哪个位置?"

  15.     # 移动存档时的帮助文字
  16.     HELP_MOVE = "要移动到哪个位置?"

  17.     # 是否显示存档中窗口(true:显示;false:不显示)
  18.     # - 分辨率较大时建议显示
  19.     SHOW_SAVE_NOW = false

  20.     # 截图缩放使用的插值算法
  21.     # - "NN" 最邻近(速度最快,质量最差,RM默认算法)
  22.     # - "NZ" 不缩放(速度快,质量好,以主角为中心切边,非全屏)
  23.     Zoom_Type = "NZ"

  24.     # 双线性插值能获得更好的截图缩放质量,但所需时间较最邻近插值更长。
  25.     # 缩略图尺寸(范围整数,单位像素)
  26.     # - VA默认分辨率(544×416)推荐使用340×260
  27.     # - VA最大分辨率(640×480)推荐使用425×325
  28.     # - 本脚本兼容分辨率解放,窗口大小将自动计算。
  29.     #   请自行计算截图分辨率,注意要确保宽高比一致,
  30.     #   若使用“不缩放”模式则可以不保持一致。
  31.     Thumbnail_Width  = 340  # 宽度
  32.     Thumbnail_Height = 260  # 高度

  33.     # 缩略图位置微调(范围整数,单位像素)
  34.     Thumbnail_ox = -90    # 横向
  35.     Thumbnail_oy = -90 # 纵向

  36.     # 各窗口切换时的渐变帧数
  37.     TRANS_DURATION = 5

  38.   end
  39. end
  40. class Font
  41.   def marshal_dump
  42.   end
  43.   def marshal_load(obj)
  44.   end
  45. end
  46. class Bitmap
  47.   RtlMoveMemory_pi = Win32API.new('kernel32', 'RtlMoveMemory', 'pii', 'i')
  48.   RtlMoveMemory_ip = Win32API.new('kernel32', 'RtlMoveMemory', 'ipi', 'i')
  49.   def _dump(limit)
  50.     data = "rgba" * width * height
  51.     RtlMoveMemory_pi.call(data, address, data.length)
  52.     [width, height, Zlib::Deflate.deflate(data)].pack("LLa*")
  53.   end
  54.   def self._load(str)
  55.     w, h, zdata = str.unpack("LLa*")
  56.     b = self.new(w, h)
  57.     RtlMoveMemory_ip.call(b.address, Zlib::Inflate.inflate(zdata), w * h * 4)
  58.     return b
  59.   end
  60.   def address
  61.     buffer, ad = "rgba", object_id * 2 + 16
  62.     RtlMoveMemory_pi.call(buffer, ad, 4)
  63.     ad = buffer.unpack("L")[0] + 8
  64.     RtlMoveMemory_pi.call(buffer, ad, 4)
  65.     ad = buffer.unpack("L")[0] + 16
  66.     RtlMoveMemory_pi.call(buffer, ad, 4)
  67.     return buffer.unpack("L")[0]
  68.   end
  69. end
  70. class Game_Temp
  71.   attr_accessor :save_bitmap
  72.   attr_accessor :save_snapshoot
  73.   alias new_initialize initialize
  74.   def initialize
  75.     new_initialize
  76.     @save_bitmap = Bitmap.new(1, 1)
  77.     @save_snapshoot = Bitmap.new(1, 1)
  78.   end
  79. end
  80. module SceneManager
  81.   def self.snapshot_for_save
  82.     $game_temp.save_bitmap = Graphics.snap_to_bitmap
  83.     unless FileTest.exist?(PS0::Window_SaveFile_Plus::SAVE_DIR)
  84.       Dir.mkdir(PS0::Window_SaveFile_Plus::SAVE_DIR)
  85.     end
  86.   end
  87. end
  88. class Scene_Map < Scene_Base
  89.   alias save_terminate terminate
  90.   def terminate
  91.     SceneManager.snapshot_for_save
  92.     save_terminate
  93.   end
  94. end
  95. module DataManager
  96.   def self.save_file_exists?
  97.     !Dir.glob(PS0::Window_SaveFile_Plus::SAVE_DIR + 'Save*.rvdata2').empty?
  98.   end
  99.   def self.make_filename(index)
  100.     sprintf(PS0::Window_SaveFile_Plus::SAVE_DIR + "Save%02d.rvdata2", index + 1)
  101.   end
  102.   def self.make_save_header
  103.     d_rect = Rect.new(0, 0, PS0::Window_SaveFile_Plus::Thumbnail_Width,
  104.                             PS0::Window_SaveFile_Plus::Thumbnail_Height)
  105.     case PS0::Window_SaveFile_Plus::Zoom_Type
  106.     when "NN"
  107.       s_rect = $game_temp.save_bitmap.rect
  108.       $game_temp.save_snapshoot = Bitmap.new(d_rect.width, d_rect.height)
  109.       $game_temp.save_snapshoot.stretch_blt(d_rect, $game_temp.save_bitmap, s_rect)
  110.     when "NZ"
  111.       x = [$game_player.screen_x - d_rect.width/2, 0].max
  112.       x = [x, Graphics.width - d_rect.width].min
  113.       y = [$game_player.screen_y - d_rect.height/2, 0].max
  114.       y = [y, Graphics.height - d_rect.height].min
  115.       s_rect = Rect.new(x, y, d_rect.width, d_rect.height)
  116.       $game_temp.save_snapshoot = Bitmap.new(d_rect.width, d_rect.height)
  117.       $game_temp.save_snapshoot.blt(0, 0, $game_temp.save_bitmap, s_rect)
  118.     end
  119.     header = {}
  120.     header[:characters] = $game_party.characters_for_savefile
  121.     header[:playtime_s] = $game_system.playtime_s
  122.     header[:snapshoot]  = $game_temp.save_snapshoot
  123.     header[:lihuiname]  = $game_party.members[0].nickname
  124.     header
  125.   end
  126.   def self.save_game(index)
  127.     saving_window = Window_Saving.new
  128.     Graphics.update
  129.     begin
  130.       save_game_without_rescue(index)
  131.     rescue
  132.        delete_save_file(index)
  133.        false
  134.     end
  135.     saving_window.dispose
  136.     return true
  137.   end
  138. end
  139. class Window_Yes_Or_No < Window_HorzCommand
  140.   def initialize(yes, no)
  141.     [url=home.php?mod=space&uid=40913]@yes[/url] = yes
  142.     @no = no
  143.     super(130, 0)
  144.     self.x = Graphics.width - self.width - 50
  145.     self.visible = false
  146.     self.active = false
  147.     [url=home.php?mod=space&uid=370741]@Index[/url] = 0
  148.   end
  149.   def col_max
  150.     return 2
  151.   end
  152.   def make_command_list
  153.     add_command(@yes,   :yes)
  154.     add_command(@no,    :cancel)
  155.   end
  156.   def process_ok
  157.     Input.update
  158.     call_ok_handler
  159.   end
  160.   def process_cancel
  161.     Input.update
  162.     call_cancel_handler
  163.   end
  164.   def activate
  165.     temp = self.y + self.height - Graphics.height
  166.     if temp > 0
  167.       self.y -= (temp + 12)
  168.     end
  169.     self.active = true
  170.     self
  171.   end
  172. end
  173. class Window_Saving < Window_Base
  174.   def initialize
  175.     w = PS0::Window_SaveFile_Plus::SAVE_NOW.length * 16 + 32
  176.     x = (Graphics.width - w)/2
  177.     y = (Graphics.height - fitting_height(1))/2
  178.     super(x, y, w, fitting_height(1))
  179.     self.visible = PS0::Window_SaveFile_Plus::SHOW_SAVE_NOW
  180.     draw_text_ex(4, 0, PS0::Window_SaveFile_Plus::SAVE_NOW)
  181.   end
  182. end
  183. class Window_SaveManagerCommand < Window_Command
  184.   def initialize(*args)
  185.     @copy, @move, @delete, [url=home.php?mod=space&uid=9053]@cancel[/url] = args[0..3]
  186.     super(130, 0)
  187.     self.x = Graphics.width - self.width - 35
  188.     self.visible = false
  189.     self.active = false
  190.     @index = 0
  191.   end
  192.   #--------------------------------------------------------------------------
  193.   # ● 获取窗口的宽度
  194.   #--------------------------------------------------------------------------
  195.   def window_width
  196.     return 100
  197.   end
  198.   #--------------------------------------------------------------------------
  199.   # ● 获取项目数
  200.   #--------------------------------------------------------------------------
  201.   def item_max
  202.     return 4
  203.   end
  204.   def make_command_list
  205.     add_command(@copy,   :copy  )
  206.     add_command(@move,   :move  )
  207.     add_command(@delete, :delete)
  208.     add_command(@cancel, :cancel)
  209.   end
  210.   def process_ok
  211.     Input.update
  212.     call_ok_handler
  213.   end
  214.   def activate
  215.     temp = self.y + self.height - Graphics.height
  216.     if temp > 0
  217.       self.y -= (temp + 12)
  218.     end
  219.     self.active = true
  220.     self
  221.   end
  222. end
  223. class Window_FileCommand < Window_Command
  224.   #--------------------------------------------------------------------------
  225.   # ● オブジェクト初期化
  226.   #--------------------------------------------------------------------------
  227.   def initialize
  228.     super(160, 0)
  229.   end
  230.   def window_height
  231.     return fitting_height(1)
  232.   end
  233.   def window_width
  234.     Graphics.width-160
  235.   end
  236.   def visible_line_number
  237.     item_max
  238.   end
  239.   def make_command_list
  240.     add_main_commands
  241.   end
  242.   def add_main_commands
  243.     for i in 1..PS0::Window_SaveFile_Plus::MAX_SAVE
  244.       if i < 10
  245.         text = Vocab::File + " 0" + i.to_s
  246.       else
  247.         text = Vocab::File + " " + i.to_s
  248.       end
  249.       add_command(text, :file)
  250.     end
  251.   end
  252.   def process_ok
  253.   end
  254. end
  255. class Window_SaveFile < Window_Base
  256.   def initialize(index)
  257.     super(160, fitting_height(1), Graphics.width-160, Graphics.height-fitting_height(3))
  258.     @file_index = index
  259.     @selected = true
  260.     refresh
  261.   end
  262.   def refresh
  263.     contents.clear
  264.     change_color(normal_color)
  265.     w = (self.width-PS0::Window_SaveFile_Plus::Thumbnail_Width-16)/2
  266.     h = (self.height-PS0::Window_SaveFile_Plus::Thumbnail_Height-16)/2
  267.     width  = w + PS0::Window_SaveFile_Plus::Thumbnail_ox
  268.     height = h + PS0::Window_SaveFile_Plus::Thumbnail_oy
  269.     draw_shadow(w-4+5, h-10+5)
  270.     draw_text((self.width-32-PS0::Window_SaveFile_Plus::NO_DATA.length*16)/2,
  271.               self.height/2-32, PS0::Window_SaveFile_Plus::NO_DATA.length*32,
  272.               line_height, PS0::Window_SaveFile_Plus::NO_DATA)
  273.     draw_snapshoot(w-4, h-15)
  274.     draw_party_characters(20, contents.height - line_height+22)
  275.     draw_playtime(-10, contents.height - line_height, contents.width - 4, 2)   
  276.   end
  277.   def draw_party_characters(x, y)
  278.     header = DataManager.load_header(@file_index)
  279.     return unless header
  280.     header[:characters].each_with_index do |data, i|
  281.       draw_character(data[0], data[1], x + i * 36, y)
  282.     end
  283.   end
  284.   def draw_playtime(x, y, width, align)
  285.     header = DataManager.load_header(@file_index)
  286.     return unless header
  287.     draw_text(x, y, width, line_height, header[:playtime_s], 2)
  288.   end
  289.   def draw_snapshoot(x, y)
  290.     header = DataManager.load_header(@file_index)
  291.     return unless header
  292.     bitmap = header[:snapshoot]
  293.     contents.blt(x, y, bitmap, bitmap.rect)
  294.     bitmap.dispose
  295.   end
  296.   def draw_shadow(x, y)
  297.     header = DataManager.load_header(@file_index)
  298.     return unless header
  299.     contents.fill_rect(x, y, PS0::Window_SaveFile_Plus::Thumbnail_Width,
  300.                              PS0::Window_SaveFile_Plus::Thumbnail_Height, Color.new(0, 0, 0))
  301.     contents.blur
  302.   end
  303. end
  304. module Cache
  305.   def self.m5lihui(filename)
  306.     load_bitmap("Graphics/m5lihui/", filename)
  307.   end
  308. end
  309. class Window_M5Lihui < Window_Base
  310.   def initialize(index)
  311.     super(0, 0, Graphics.width, Graphics.height)
  312.     self.z = 200
  313.     self.opacity = 0
  314.     @save_file_index = index
  315.     refresh
  316.   end
  317.   def standard_padding
  318.     return 0
  319.   end
  320.   def refresh
  321.     contents.clear
  322.     draw_actor_lihui
  323.   end
  324.   def draw_actor_lihui
  325.     header = DataManager.load_header(@save_file_index)
  326.     return unless header and header[:lihuiname]
  327.     bitmap = Cache.m5lihui(header[:lihuiname])
  328.     rect = Rect.new(0, 0, Graphics.width, Graphics.height)
  329.     contents.blt(0, 0, bitmap, rect, 255)
  330.     bitmap.dispose
  331.   end  
  332. end
  333. class Scene_File < Scene_MenuBase
  334.   def start
  335.     super
  336.     create_help_window
  337.     create_savefile_viewport
  338.     create_command_window
  339.     create_savefile_window
  340.     create_manager_window
  341.     create_replace_window
  342.     create_delete_window   
  343.   end
  344.   def terminate
  345.     super
  346.     @savefile_viewport.dispose
  347.     @savefile_window.dispose
  348.     @command_window.dispose
  349.     @window_manager.dispose
  350.     @window_replace.dispose
  351.     @window_delete.dispose
  352.   end
  353.   def update
  354.     super
  355.     update_savefile_selection
  356.   end
  357.   def create_replace_window
  358.     @window_replace = Window_Yes_Or_No.new("替换", "取消")
  359.     @window_replace.set_handler(:yes,    method(:do_replace))
  360.     @window_replace.set_handler(:cancel, method(:do_cancel))
  361.   end
  362.   def create_delete_window
  363.     @window_delete  = Window_Yes_Or_No.new("删除", "取消")
  364.     @window_delete.set_handler(:yes,    method(:do_delete))
  365.     @window_delete.set_handler(:cancel, method(:do_return_manager))
  366.     @window_delete.x += 40
  367.   end
  368.   def create_manager_window
  369.     @window_manager = Window_SaveManagerCommand.new("复制", "移动", "删除", "取消")
  370.     @window_manager.set_handler(:copy  , method(:on_copy?))
  371.     @window_manager.set_handler(:move  , method(:on_move?))
  372.     @window_manager.set_handler(:delete, method(:on_delete?))
  373.     @window_manager.set_handler(:cancel, method(:do_cancel))
  374.   end
  375.   def create_help_window
  376.     @help_window = Window_Help.new(1)
  377.     @help_window.set_text(help_window_text)
  378.   end
  379.   def help_window_text
  380.     return ""
  381.   end
  382.   #--------------------------------------------------------------------------
  383.   # ● セーブファイルビューポートの作成
  384.   #--------------------------------------------------------------------------
  385.   def create_savefile_viewport
  386.     @savefile_viewport = Viewport.new
  387.     @savefile_viewport.rect.y = @help_window.height
  388.     @savefile_viewport.rect.height -= @help_window.height
  389.   end
  390.   def create_savefile_window
  391.     @savefile_window = Window_SaveFile.new(@index)
  392.     @savefile_window.viewport = @savefile_viewport
  393.     @window_lihui = Window_M5Lihui.new(@index)
  394.   end
  395.   def create_command_window
  396.     @command_window = Window_FileCommand.new
  397.     @command_window.index = first_savefile_index
  398.     @index = @command_window.index
  399.     @command_window.viewport = @savefile_viewport
  400.     @command_window.set_handler(:file,      method(:on_savefile_ok))
  401.   end
  402.   def update_savefile_selection
  403.     if @source_index != nil
  404.       if Input.trigger?(:C)
  405.         if @index == @source_index
  406.           Sound.play_buzzer
  407.         elsif FileTest.exist?(DataManager.make_filename(@index))
  408.           Graphics.freeze
  409.           @command_window.deactivate
  410.           @window_replace.y = 72
  411.           @window_replace.activate
  412.           @window_replace.visible = true
  413.           @window_replace.refresh
  414.           Sound.play_ok
  415.           Graphics.transition(PS0::Window_SaveFile_Plus::TRANS_DURATION)
  416.         else
  417.           return on_copy_ok
  418.         end
  419.       elsif Input.trigger?(:B)
  420.         return do_return_manager
  421.       end
  422.     else
  423.       if Input.trigger?(:C)
  424.         if self.is_a?(Scene_Save) and FileTest.exist?(DataManager.make_filename(@index))
  425.           Graphics.freeze
  426.           @command_window.deactivate
  427.           @window_replace.y = 72
  428.           @window_replace.activate
  429.           @window_replace.visible = true
  430.           @window_replace.refresh
  431.           Sound.play_ok
  432.           Graphics.transition(PS0::Window_SaveFile_Plus::TRANS_DURATION)
  433.         else
  434.           return on_savefile_ok
  435.         end
  436.       elsif Input.trigger?(:B)
  437.         return on_savefile_cancel
  438.       elsif Input.trigger?(:F5)
  439.         unless @window_manager.active == true or
  440.                @window_delete.active == true or
  441.                @window_replace.active == true
  442.           return on_manager?
  443.         end
  444.       end
  445.     end
  446.     @need_refresh = true if @index != @command_window.index
  447.     if @need_refresh
  448.       Graphics.freeze
  449.       @index = @command_window.index      
  450.       @savefile_window.dispose
  451.       @window_lihui.dispose
  452.       create_savefile_window
  453.       @need_refresh = false
  454.       Graphics.transition(PS0::Window_SaveFile_Plus::TRANS_DURATION)
  455.     end
  456.   end
  457.   def on_savefile_ok
  458.   end
  459.   def on_savefile_cancel
  460.     Sound.play_cancel
  461.     return_scene
  462.   end
  463.   def on_copy_ok
  464.     Graphics.freeze
  465.     source_name = DataManager.make_filename(@source_index)
  466.     new_name    = DataManager.make_filename(@index)
  467.     case @source_type
  468.     when "copy"
  469.       Win32API.new('kernel32',"CopyFileA",'ppl','').call(source_name,new_name,0)
  470.     when "move"
  471.       File.rename(source_name, new_name)
  472.     end
  473.     @help_window.set_text(help_window_text)
  474.     @source_index = nil
  475.     do_return_savelist
  476.   end
  477.   def on_copy?
  478.     Graphics.freeze
  479.     @help_window.set_text(PS0::Window_SaveFile_Plus::HELP_COPY)
  480.     @source_index = @index
  481.     @source_type = "copy"
  482.     do_return_savelist
  483.   end
  484.   def on_move?
  485.     Graphics.freeze
  486.     @help_window.set_text(PS0::Window_SaveFile_Plus::HELP_MOVE)
  487.     @source_index = @index
  488.     @source_type = "move"
  489.     do_return_savelist
  490.   end
  491.   def on_manager?
  492.     if FileTest.exist?(DataManager.make_filename(@index))
  493.       Graphics.freeze
  494.       @command_window.deactivate
  495.       @window_manager.y = 72
  496.       @window_manager.activate
  497.       @window_manager.visible = true
  498.       @window_manager.refresh
  499.       Sound.play_ok
  500.       Graphics.transition(PS0::Window_SaveFile_Plus::TRANS_DURATION)
  501.     else
  502.       Sound.play_buzzer
  503.     end
  504.   end
  505.   def on_delete?
  506.     Graphics.freeze
  507.     @window_manager.deactivate
  508.     @command_window.deactivate
  509.     @window_delete.y = 72 + 72
  510.     @window_delete.activate
  511.     @window_delete.visible = true
  512.     @window_delete.refresh
  513.     Sound.play_ok
  514.     Graphics.transition(PS0::Window_SaveFile_Plus::TRANS_DURATION)
  515.   end
  516.   def do_delete
  517.     Graphics.freeze
  518.     File.delete(DataManager.make_filename(@index))
  519.     @window_delete.index  = 0
  520.     @window_manager.index = 0
  521.     @window_delete.visible  = false
  522.     @window_manager.visible = false
  523.     @window_delete.deactivate
  524.     @window_manager.deactivate
  525.     @command_window.activate
  526.     @need_refresh = true
  527.     Sound.play_save
  528.     if DataManager.save_file_exists?
  529.       Graphics.transition(PS0::Window_SaveFile_Plus::TRANS_DURATION)
  530.     else
  531.       return_scene
  532.     end
  533.   end
  534.   def do_replace
  535.     Graphics.freeze
  536.     if @source_index != nil
  537.       return on_copy_ok
  538.     else
  539.       return on_savefile_ok
  540.     end
  541.     @window_replace.visible = false
  542.     @window_replace.deactivate
  543.     @need_refresh = true
  544.   end
  545.   def do_cancel
  546.     Graphics.freeze
  547.     Sound.play_cancel
  548.     @window_delete.index  = 0
  549.     @window_replace.index = 0
  550.     @window_manager.index = 0
  551.     @window_delete.visible  = false
  552.     @window_replace.visible = false
  553.     @window_manager.visible = false
  554.     @window_delete.deactivate
  555.     @window_replace.deactivate
  556.     @window_manager.deactivate
  557.     @command_window.activate
  558.     Graphics.transition(PS0::Window_SaveFile_Plus::TRANS_DURATION)
  559.   end
  560.   def do_return_manager
  561.     Graphics.freeze
  562.     @help_window.set_text(help_window_text)
  563.     @command_window.index = @source_index unless @source_index == nil
  564.     @source_index = nil
  565.     @source_type = nil
  566.     @command_window.deactivate
  567.     @window_delete.index  = 0
  568.     @window_replace.index = 0
  569.     @window_delete.visible  = false
  570.     @window_replace.visible = false
  571.     @window_delete.deactivate
  572.     @window_replace.deactivate
  573.     @window_manager.y = 72
  574.     @window_manager.activate
  575.     @window_manager.visible = true
  576.     @window_manager.refresh
  577.     Sound.play_cancel
  578.     Graphics.transition(PS0::Window_SaveFile_Plus::TRANS_DURATION)
  579.   end
  580.   def do_return_savelist
  581.     @window_manager.visible = false
  582.     @window_manager.deactivate
  583.     @command_window.activate
  584.     @need_refresh = true
  585.     Sound.play_ok
  586.   end
  587. end
复制代码

点评

94我有用依个显示箭头的脚本,箭头位置会高依点。 240行改成super(160, 50)箭头位置正确,但是存档数的条状会往下跑~~大概是修改什么地方呢? >"< 谢谢~~   发表于 2014-2-26 14:43
请问光标位置高了一点~~要修改什么地方呢? 谢谢~~  发表于 2014-2-26 09:21
射射喵5大大,正好也有用立绘菜单W  发表于 2013-12-21 19:35
点赞  发表于 2013-12-21 19:02
吓……吓尿了!!喵呜喵5大神!!请让我做你的画师!!!【滚  发表于 2013-12-21 17:05

评分

参与人数 2星屑 +12 梦石 +2 收起 理由
tan12345 + 12 塞糖
Sion + 2 认可答案

查看全部评分

回复 支持 反对

使用道具 举报

Lv5.捕梦者 (暗夜天使)

只有笨蛋才会看到

梦石
1
星屑
21484
在线时间
9389 小时
注册时间
2012-6-19
帖子
7114

开拓者短篇九导演组冠军

4
发表于 2013-12-21 19:43:23 | 只看该作者
如果有使用立绘菜单的话,请把本脚本316~320行删掉

点评

测试了一下发现其实不删除也可以的,不过算了,删除了也不会出错就是了  发表于 2013-12-21 20:16
……哎?  发表于 2013-12-21 19:58
删掉了还是会出现下面那情况  发表于 2013-12-21 19:47
啊看见了我去试试  发表于 2013-12-21 19:46
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
154 小时
注册时间
2013-12-20
帖子
66
5
 楼主| 发表于 2013-12-21 19:45:31 | 只看该作者
喵呜喵5 发表于 2013-12-21 15:45
完成了,你自己先试试有没有BUG,这玩意儿主要就是修改坐标修改的挺烦,本质上并不难,

立绘放到Graphic ...

试用了一下跳出了错误窗口
要改的地方也都改了QAQ

333.jpg (6.02 KB, 下载次数: 36)

333.jpg

点评

135行 header[:lihuiname] = $game_party.members[0].nickname 改成 header[:lihuiname] = $game_party.members[0].name  发表于 2013-12-21 21:11
你希望用什么方式来定义立绘的名字?(主角的姓名?某个变量的数值?)  发表于 2013-12-21 21:07
回复 支持 反对

使用道具 举报

Lv5.捕梦者 (暗夜天使)

只有笨蛋才会看到

梦石
1
星屑
21484
在线时间
9389 小时
注册时间
2012-6-19
帖子
7114

开拓者短篇九导演组冠军

6
发表于 2013-12-21 20:05:45 | 只看该作者
丽塔菌 发表于 2013-12-21 19:45
试用了一下跳出了错误窗口
要改的地方也都改了QAQ

真的删干净了吗?要删除的全部内容是这个脚本中的下面这段哦,你有没有错删除什么地方了?
  1. module Cache
  2.   def self.m5lihui(filename)
  3.     load_bitmap("Graphics/m5lihui/", filename)
  4.   end
  5. end
复制代码

点评

谢谢,问题成功解决·  发表于 2013-12-21 21:33
【QAQ【测试了一下发现游戏立绘没有显示,可是立绘已经放入文件夹里面了,是要在脚本改坐标吗?  发表于 2013-12-21 20:25
【QAQ【测试了一下发现游戏立绘没有显示,可是立绘已经放入文件夹里面了,是要在脚本改坐标吗?  发表于 2013-12-21 20:24
啊发现错误了【自己原来的截图存档没有删除,谢谢QAQ问题解决了  发表于 2013-12-21 20:14
回复 支持 反对

使用道具 举报

Lv5.捕梦者 (暗夜天使)

只有笨蛋才会看到

梦石
1
星屑
21484
在线时间
9389 小时
注册时间
2012-6-19
帖子
7114

开拓者短篇九导演组冠军

7
发表于 2013-12-21 20:32:54 | 只看该作者
喵呜喵5 发表于 2013-12-21 20:05
真的删干净了吗?要删除的全部内容是这个脚本中的下面这段哦,你有没有错删除什么地方了? ...

请检查以下几件事:
1.这个脚本不兼容旧的存档,要使用的话请使用新的存档
2.这个脚本和显示立绘的菜单脚本显示立绘的方式一样,请直接对立绘素材动手
3.脚本显示的立绘文件名为队伍中第一名角色的昵称,请检查这个昵称是不是没有设置的
4.附带一个测试脚本时我用的立绘素材(商业素材,仅供交流学习,请勿用于游戏中)

点评

【不知道为什么喜欢定义为主角姓名【喂  发表于 2013-12-21 21:08
原来我不能显示是因为旧存档,可是游戏的昵称由于都是使用主角的,于是造成点击读档的时候显示的是菜单立绘,那么这个该怎么处理  发表于 2013-12-21 20:53
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
189 小时
注册时间
2013-1-26
帖子
72
8
发表于 2014-1-4 06:24:09 | 只看该作者


我有用自制选单
因此连结到存档是Scene_Save

请问怎么解决呢

点评

我只能为你@喵呜喵5  发表于 2014-1-4 09:30
回复 支持 反对

使用道具 举报

Lv5.捕梦者 (暗夜天使)

只有笨蛋才会看到

梦石
1
星屑
21484
在线时间
9389 小时
注册时间
2012-6-19
帖子
7114

开拓者短篇九导演组冠军

9
发表于 2014-1-4 10:57:19 | 只看该作者
ninesound 发表于 2014-1-4 06:24
我有用自制选单
因此连结到存档是Scene_Save

自制选单的脚本发上来一下,不然我没法改.........

PS.我没收到@ .........
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
780
在线时间
350 小时
注册时间
2013-8-5
帖子
77
10
发表于 2014-3-4 18:58:57 | 只看该作者
本帖最后由 mileo 于 2014-3-7 01:25 编辑



用了一个MOG_Menu_Cursor的脚本,就变这样了 (如图~

RUBY 代码复制
  1. #==============================================================================
  2. # +++ MOG - Animated Cursor (V1.2) +++
  3. #==============================================================================
  4. # By Moghunter
  5. # [url=http://www.atelier-rgss.com/]http://www.atelier-rgss.com/[/url]
  6. #==============================================================================
  7. # Adiciona um cursor animado nos menus de comandos.
  8. #==============================================================================
  9. # Será necessário ter a imagem
  10. #
  11. # Menu_Cursor.png
  12. #
  13. # gravado na pasta GRAPHICS/SYSTEM/
  14. #==============================================================================
  15. # Ativando a animação do cursor
  16. #
  17. # Basta criar uma imagem que tenha a largura com no minimo o dobro de altura da
  18. # imagem do cursor.
  19. #
  20. # EX
  21. # largura 32 pixel (width) altura 32 pixel = 1 frames de animação.(Sem animação)
  22. # largura 64 pixel (width) altura 32 pixel = 2 frames de animação.
  23. # largura 128 pixel (width) altura 32 pixel = 4 frames de animação.
  24. # largura 256 pixel (width) altura 32 pixel = 8 frames de animação
  25. # Etc...
  26. #
  27. # NOTA
  28. # Não há limite para quantidade de frames de animação, se não quiser a animação
  29. # basta criar uma imagem com a altura proporcional a largura da imagem.
  30. #
  31. #==============================================================================
  32. # ● Histórico (Version History)
  33. #==============================================================================
  34. # v 1.1 - Correção da posição do cursor na cena de batalha.
  35. #==============================================================================
  36.  
  37. module MOG_MENU_CURSOR
  38.   #Ativar animação do cursor se movimentando para os lados.
  39.   SIDE_ANIMATION = true
  40.   #Definição da posição do cursor. (Ajustes na posição)
  41.   CURSOR_POSITION = [0,0]
  42.   #Definição da velocidade da animação de frames.
  43.   CURSOR_ANIMATION_SPEED = 9
  44. end
  45.  
  46. #==============================================================================
  47. # ■ Game_System
  48. #==============================================================================
  49. class Game_System
  50.  
  51.   attr_accessor :menu_cursor_name
  52.  
  53.   #--------------------------------------------------------------------------
  54.   # ● Initialize
  55.   #--------------------------------------------------------------------------      
  56.   alias mog_menu_cursor_initialize initialize
  57.   def initialize
  58.       mog_menu_cursor_initialize
  59.       @menu_cursor_name = "Menu_Cursor"
  60.   end  
  61.  
  62. end  
  63.  
  64. #==============================================================================
  65. # ■ Game_Temp
  66. #==============================================================================
  67. class Game_Temp
  68.  
  69.   attr_accessor :menu_cursor   
  70.  
  71.   #--------------------------------------------------------------------------
  72.   # ● Initialize
  73.   #--------------------------------------------------------------------------      
  74.   alias mog_cursor_sprite_initialize initialize
  75.   def initialize
  76.       mog_cursor_sprite_initialize
  77.       @menu_cursor = [false,0,0,0]
  78.   end  
  79.  
  80. end  
  81.  
  82. #==============================================================================
  83. # ■ Sprite Cursor
  84. #==============================================================================
  85. class Sprite_Cursor < Sprite
  86.  
  87.   include MOG_MENU_CURSOR
  88.  
  89.   #--------------------------------------------------------------------------
  90.   # ● Initialize
  91.   #--------------------------------------------------------------------------   
  92.   def initialize(viewport = nil , x , y)
  93.       super(viewport)
  94.       @cursor_image = Cache.system($game_system.menu_cursor_name.to_s)
  95.       @frame_max = (@cursor_image.width / @cursor_image.height) rescue 1
  96.       @frame_range = @frame_max > 0 ? (@cursor_image.width  / @frame_max) : 1
  97.       @frame = 0
  98.       @ca_speed = CURSOR_ANIMATION_SPEED
  99.       self.bitmap = Bitmap.new(@frame_range,@frame_range)
  100.       self.z = 10000
  101.       self.opacity = 0
  102.       @cw = self.bitmap.width / 2
  103.       @c_p = [-@cw + CURSOR_POSITION[0],CURSOR_POSITION[1]]
  104.       [url=home.php?mod=space&uid=287812]@mx[/url] = [0,0,0]
  105.       refresh_animation(true)
  106.       update_move
  107.   end
  108.  
  109.   #--------------------------------------------------------------------------
  110.   # ● Dispose
  111.   #--------------------------------------------------------------------------   
  112.   def dispose
  113.       self.bitmap.dispose
  114.       self.bitmap = nil
  115.       @cursor_image.dispose
  116.       super
  117.   end  
  118.  
  119.   #--------------------------------------------------------------------------
  120.   # ● Update
  121.   #--------------------------------------------------------------------------  
  122.   def update
  123.       if cursor_visible?
  124.          self.visible = true
  125.          update_move
  126.          refresh_animation(false)
  127.       else   
  128.          self.visible = false
  129.       end  
  130.   end
  131.  
  132.   #--------------------------------------------------------------------------
  133.   # ● Initialize
  134.   #--------------------------------------------------------------------------      
  135.   def refresh_animation(start = false)
  136.       @ca_speed += 1
  137.       return if @frame_max == 1 and !start
  138.       return if @ca_speed < CURSOR_ANIMATION_SPEED
  139.       @ca_speed = 0
  140.       self.bitmap.clear
  141.       scr_rect = Rect.new(@frame_range * @frame,0,@frame_range,@frame_range)
  142.       self.bitmap.blt(0,0,@cursor_image, scr_rect)
  143.       @frame += 1
  144.       @frame = 0 if @frame >= @frame_max
  145.   end  
  146.  
  147.   #--------------------------------------------------------------------------
  148.   # ● Cursor Visible?
  149.   #--------------------------------------------------------------------------   
  150.   def cursor_visible?
  151.       px = $game_temp.menu_cursor[2]
  152.       py = $game_temp.menu_cursor[3]
  153.       return false if $game_temp.menu_cursor[1] == 0
  154.       return false if px < 0 or py < 0 or (px == 0 and py == 0)
  155.       return true
  156.   end  
  157.  
  158.   #--------------------------------------------------------------------------
  159.   # ● Update Move
  160.   #--------------------------------------------------------------------------   
  161.   def update_move
  162.       self.opacity += 25
  163.       @new_pos = [$game_temp.menu_cursor[2],$game_temp.menu_cursor[3]]
  164.       execute_animation_s
  165.       execute_move(0,self.x, @new_pos[0] + @mx[1] + @c_p[0])
  166.       execute_move(1,self.y, @new_pos[1] + @c_p[1])
  167.   end  
  168.  
  169.   #--------------------------------------------------------------------------
  170.   # ● Execute Animation S
  171.   #--------------------------------------------------------------------------      
  172.   def execute_animation_s
  173.       return if !SIDE_ANIMATION
  174.       @mx[2] += 1
  175.       return if @mx[2] < 4
  176.       @mx[2] = 0
  177.       @mx[0] += 1
  178.       case @mx[0]
  179.          when 1..7;  @mx[1] += 1            
  180.          when 8..14; @mx[1] -= 1
  181.          else
  182.            @mx[0] = 0
  183.            @mx[1] = 0
  184.       end
  185.   end
  186.  
  187.   #--------------------------------------------------------------------------
  188.   # ● Execute Move
  189.   #--------------------------------------------------------------------------      
  190.   def execute_move(type,cp,np)
  191.       sp = 5 + ((cp - np).abs / 5)
  192.       if cp > np
  193.          cp -= sp
  194.          cp = np if cp < np
  195.       elsif cp < np
  196.          cp += sp
  197.          cp = np if cp > np
  198.       end     
  199.       self.x = cp if type == 0
  200.       self.y = cp if type == 1
  201.   end  
  202.  
  203. end
  204.  
  205. #==============================================================================
  206. # ■ CURSOR_MENU SPRITE
  207. #==============================================================================
  208. module CURSOR_MENU_SPRITE
  209.  
  210.   #--------------------------------------------------------------------------
  211.   # ● Cursor Sprite Enable
  212.   #--------------------------------------------------------------------------      
  213.   def cursor_sprite_enable
  214.       return if self.index == nil rescue return
  215.       create_cursor_sprite
  216.       update_cursor_sprite
  217.       update_cusor_position
  218.       if !self.active
  219.          $game_temp.menu_cursor[1] -= 1 if $game_temp.menu_cursor[1] > 0
  220.       end
  221.   end
  222.  
  223.   #--------------------------------------------------------------------------
  224.   # ● Create Cursor Sprite
  225.   #--------------------------------------------------------------------------   
  226.   def create_cursor_sprite
  227.       return if @cursor != nil
  228.       return if $game_temp.menu_cursor[0]
  229.       $game_temp.menu_cursor[0] = true
  230.       reset_cursor_position
  231.       @cursor = Sprite_Cursor.new(nil,x,y)
  232.       @cursor_name = $game_system.menu_cursor_name
  233.   end   
  234.  
  235.   #--------------------------------------------------------------------------
  236.   # ● Dispose Cursor Sprite
  237.   #--------------------------------------------------------------------------      
  238.   def dispose_cursor_sprite
  239.       return if @cursor == nil
  240.       $game_temp.menu_cursor[0] = false
  241.       reset_cursor_position
  242.       @cursor.dispose
  243.       @cursor = nil
  244.   end  
  245.  
  246.   #--------------------------------------------------------------------------
  247.   # ● Reset Cursor Position
  248.   #--------------------------------------------------------------------------        
  249.   def reset_cursor_position
  250.       $game_temp.menu_cursor[1] = 0
  251.       $game_temp.menu_cursor[2] = -32
  252.       $game_temp.menu_cursor[3] = -32
  253.   end  
  254.  
  255.   #--------------------------------------------------------------------------
  256.   # ● Update Cursor
  257.   #--------------------------------------------------------------------------         
  258.   def update_cursor_sprite
  259.       return if @cursor == nil
  260.       @cursor.update
  261.       refresh_cursor_sprite if @cursor_name != $game_system.menu_cursor_name
  262.   end
  263.  
  264.   #--------------------------------------------------------------------------
  265.   # ● Refresh Cursor Sprite
  266.   #--------------------------------------------------------------------------            
  267.   def refresh_cursor_sprite
  268.       @cursor_name = $game_system.menu_cursor_name
  269.       dispose_cursor_sprite
  270.       create_cursor_sprite
  271.   end  
  272.  
  273.   #--------------------------------------------------------------------------
  274.   # ● Update Cursor Position
  275.   #--------------------------------------------------------------------------         
  276.   def update_cusor_position
  277.       return if !can_update_cursor_position?
  278.       x_v = [0,0]
  279.       if SceneManager.scene_is?(Scene_Battle)
  280.           if self.viewport != nil
  281.              x_v = [-self.viewport.ox, self.viewport.rect.y]
  282.           end
  283.       end      
  284.       x_e = (self.cursor_rect.x + self.x) - self.ox
  285.       $game_temp.menu_cursor[2] = x_e + x_v[0]
  286.       y_e = (self.cursor_rect.y + self.y + self.cursor_rect.height / 2) - self.oy
  287.       $game_temp.menu_cursor[3] = y_e + x_v[1]
  288.       $game_temp.menu_cursor[1] = 13
  289.    end
  290.  
  291.   #--------------------------------------------------------------------------
  292.   # ● Can Update Cursor
  293.   #--------------------------------------------------------------------------            
  294.    def can_update_cursor_position?
  295.        return false if !self.active     
  296.        return false if self.index < 0
  297.        return false if !self.visible
  298.        return true
  299.    end  
  300.  
  301. end
  302.  
  303. #==============================================================================
  304. # ■ Window Base
  305. #==============================================================================
  306. class Window_Base < Window
  307.   include CURSOR_MENU_SPRITE
  308.  
  309.   #--------------------------------------------------------------------------
  310.   # ● Dispose
  311.   #--------------------------------------------------------------------------              
  312.   alias mog_menu_cursor_base_dispose dispose
  313.   def dispose
  314.       mog_menu_cursor_base_dispose
  315.       dispose_cursor_sprite
  316.   end  
  317.  
  318.   #--------------------------------------------------------------------------
  319.   # ● Update
  320.   #--------------------------------------------------------------------------              
  321.   alias mog_cursor_update update
  322.   def update
  323.       mog_cursor_update
  324.       cursor_sprite_enable
  325.   end   
  326.  
  327. end
  328.  
  329. $mog_rgss3_animated_cursor = true




图书馆的截图存档貌似有同样问题~~
光标位置不正确的话不知道是要改光标脚本还是改存档脚本

(使用默认存档的话则是光标不显示

不知道有没有高手可以帮忙>"<

谢谢你



点评

用了土法炼钢的方式自己搞定了啊~ 不过还是在此求有无大神可以直接脚本搞定~~ 感谢!!  发表于 2014-3-7 12:37
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-25 17:19

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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