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

Project1

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

[RMVA发布] [向DH致敬]VA简易半身像对话框Beta

[复制链接]

Lv3.寻梦者

唯一的信徒

梦石
0
星屑
1665
在线时间
1357 小时
注册时间
2013-1-29
帖子
1637
跳转到指定楼层
1
发表于 2013-6-30 09:01:15 | 显示全部楼层 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 Sion 于 2013-12-21 20:54 编辑

【向Division Heaven致敬】

好的,于是这个脚本的语句混乱、逻辑不清、bug多多、异常的蛋疼,所以这个才是beta版=-=

于是乎二话不说上范例:
Bust Shot.rar (799.54 KB, 下载次数: 3402) (没有自带rgss300.dll请自己打开范例之后保存之后使用)
RUBY 代码复制
  1. #encoding:utf-8
  2. #==============================================================================
  3. # ■ 半身像对话框 by LBQ
  4. #------------------------------------------------------------------------------
  5. #  一个简单的半身像对话框罢了= =
  6. #------------------------------------------------------------------------------
  7. # ■ 用法一览
  8. #     1:如何将半身像应用到游戏中?
  9. #       ——如果想要把一个脸图替换成半身像,则需要找到这个脸图的编号,比如说拉尔
  10. #           夫,就是Actor1的编号0,之后去在Graphics/Busts这个文件夹里面拷贝一个
  11. #           叫做Actor1_0的图像,这个图像会被当做半身像替换原有图像。
  12. #==============================================================================
  13. # 2013.8.25 => 修复存档不能Bug (感谢小刀
  14. #==============================================================================
  15. $imported ||= {}
  16. $imported[:LBQ_Bust]=true
  17.  
  18. module LBQ
  19.   module Bust
  20.     FOLDER="Busts"
  21.     SUB1=[/【/,    "\\{\\c[6]-- "]
  22.     SUB2=[/】/,    " --\\c[0]\\}"]
  23.  
  24.     TEXT_FOR_NEXT="[next]"
  25.     TEXT_FOR_END ="[end]"
  26.  
  27.     INDENT=255 #半身像的缩进
  28.   end
  29. end
  30.  
  31. module Cache
  32.   def self.busts(filename)
  33.     load_bitmap("Graphics/#{LBQ::Bust::FOLDER}/", filename)
  34.   end
  35. end
  36.  
  37.  
  38.  
  39. class Sprite_Bust < Sprite_Base
  40.   attr_accessor   :bust_graphics
  41.   attr_accessor   :status
  42.  
  43.   def initialize(vp=nil)
  44.     super(vp)
  45.     @bust_graphics=nil
  46.     @status=:nothing
  47.   end
  48.  
  49.   def slide_in
  50.     @status=:sliding_in
  51.   end
  52.  
  53.   def slide_out
  54.     @status=:sliding_out
  55.     if $game_temp.do_not_slide_out
  56.       @status=:slided_out
  57.       set_pos
  58.     end
  59.   end
  60.  
  61.  
  62.  
  63.  
  64.   def set_pos(slide_in=true)
  65.     self.x=0 - self.bitmap.width
  66.     self.y=Graphics.height-self.bitmap.height
  67.  
  68.     self.x=0 unless slide_in
  69.   end
  70.  
  71.  
  72.   def set_graphics(bust_graphics)
  73.     self.bitmap=Cache.busts(bust_graphics)
  74.   end
  75.  
  76.  
  77.  
  78.   def update
  79.     super
  80.     case @status
  81.     when :nothing
  82.       # Do Nothing
  83.     when :sliding_in
  84.       #Slide In
  85.       self.x+=12
  86.       if self.x>=0
  87.         self.x=0
  88.         @status=:slided_in
  89.       end
  90.  
  91.     when :sliding_out
  92.       self.x-=12
  93.       if self.x<= -self.bitmap.width
  94.         self.x= -self.bitmap.width
  95.         @status=:slided_out
  96.       end
  97.       #Slide Out
  98.     when :slided_in
  99.       #Slided in
  100.     when :slided_out
  101.       #Sliede out
  102.     end
  103.  
  104.   end
  105.  
  106.  
  107. end
  108.  
  109.  
  110.  
  111. class Game_Temp
  112.   attr_accessor   :bust_name
  113.   attr_accessor   :bust
  114.   attr_accessor   :have_bust
  115.   attr_accessor   :do_not_slide_out
  116.  
  117.   alias lbq_bust_shot_game_message_init initialize
  118.   def initialize
  119.     lbq_bust_shot_game_message_init
  120.     @bust_name=""
  121.     @bust=nil
  122.     @have_bust=false
  123.     @do_not_slide_out=false
  124.   end
  125.  
  126.  
  127.  
  128.  
  129. end
  130.  
  131. class Game_Message
  132.    #--------------------------------------------------------------------------
  133.   # ● 添加内容
  134.   #--------------------------------------------------------------------------
  135.   def add(text)
  136.     new_text=text.gsub(LBQ::Bust::SUB1[0],LBQ::Bust::SUB1[1])
  137.     new_text2=new_text.gsub(LBQ::Bust::SUB2[0],LBQ::Bust::SUB2[1])
  138.     if new_text2.include? LBQ::Bust::TEXT_FOR_NEXT
  139.       new_text2.delete!(LBQ::Bust::TEXT_FOR_NEXT)
  140.       $game_temp.do_not_slide_out=true
  141.     end
  142.  
  143.     if new_text2.include? LBQ::Bust::TEXT_FOR_END
  144.       new_text2.delete!(LBQ::Bust::TEXT_FOR_END)
  145.       $game_temp.do_not_slide_out=false
  146.     end
  147.     @texts.push(new_text2)
  148.   end
  149. end
  150.  
  151.  
  152. class Game_Interpreter
  153.   alias lbq_bust_shot_command_101 command_101
  154.   #--------------------------------------------------------------------------
  155.   # ● 显示文字
  156.   #--------------------------------------------------------------------------
  157.   def command_101
  158.     $game_temp.bust=nil
  159.       unless @params[0].empty?
  160.         if File.exist?("Graphics/#{LBQ::Bust::FOLDER}/#{@params[0]}_#{@params[1]}.png")
  161.           $game_temp.have_bust=true
  162.         else
  163.           $game_temp.have_bust=false
  164.           $game_temp.bust_name=""
  165.         end
  166.       end
  167.  
  168.     unless @params[3] == 2
  169.       $game_temp.have_bust=false
  170.     end
  171.  
  172.     if $game_temp.have_bust
  173.       $game_temp.bust_name="#{@params[0]}_#{@params[1]}"
  174.       $game_temp.bust=nil
  175.       $game_temp.bust=Sprite_Bust.new
  176.       $game_temp.bust.set_graphics($game_temp.bust_name)
  177.       $game_temp.bust.z=99999
  178.       unless $game_temp.do_not_slide_out
  179.         $game_temp.bust.set_pos
  180.         $game_temp.bust.slide_in
  181.       else
  182.         $game_temp.bust.set_pos(false)
  183.         $game_temp.bust.slide_in
  184.       end
  185.     end
  186.  
  187.     lbq_bust_shot_command_101
  188.     if $game_temp.have_bust
  189.         $game_temp.bust.slide_out
  190.         Fiber.yield until $game_temp.bust.status==:slided_out
  191.     end
  192.     $game_temp.have_bust=false
  193.     $game_temp.bust_name=""
  194.  
  195.   end
  196.  
  197.  
  198.   alias lbq_bust_int_update update
  199.   def update
  200.     lbq_bust_int_update
  201.     $game_temp.bust.update unless $game_temp.bust.nil?
  202.   end
  203.  
  204. end
  205.  
  206.  
  207. class Window_Message
  208.   #--------------------------------------------------------------------------
  209.   # ● 获取换行位置
  210.   #--------------------------------------------------------------------------
  211.   def new_line_x
  212.     # 如果有头像
  213.     unless $game_message.face_name.empty?
  214.       value=112
  215.       value=LBQ::Bust::INDENT unless $game_temp.bust_name.empty?
  216.     # 木有
  217.     else
  218.       value=0
  219.     end
  220.     return value
  221.   end
  222. end
  223.  
  224.  
  225. class Window_Message
  226.   #--------------------------------------------------------------------------
  227.   # ● 翻页处理
  228.   #--------------------------------------------------------------------------
  229.   def new_page(text, pos)
  230.     contents.clear
  231.     draw_face($game_message.face_name, $game_message.face_index, 0, 0) if $game_temp.bust_name.empty?
  232.     reset_font_settings
  233.     pos[:x] = new_line_x
  234.     pos[:y] = 0
  235.     pos[:new_x] = new_line_x
  236.     pos[:height] = calc_line_height(text)
  237.     clear_flags
  238.   end
  239. end

用法
在"Busts"文件夹里面命名半身像,比如名字是:Actor1_0 则代表这个会自动替换脸图Actor1中的0号(就是拉尔夫)
在句尾打[next]会进入不撤出半身像模式、[end]会结束该模式

点评

另外只要默认加密打包这个脚本就显示不了半身像  发表于 2014-9-6 12:02
一看标题就知道是LBQ……  发表于 2013-6-30 11:31

评分

参与人数 5星屑 +487 收起 理由
一摸多汁 + 30 希望改进
1715063941 + 7 2或乃好
小学生 + 10 转载
芙蕾娅 + 140 挺不错的
feizhaodan + 300 奖赏条例

查看全部评分

『我只是一个正在潜心修炼的渣乐师罢了』
Dear Time\(^o^)/~


假如上面的图片挂了的话麻烦各位去发个帖 @ 一下 orzFly 让他修复 deartime

Lv3.寻梦者

唯一的信徒

梦石
0
星屑
1665
在线时间
1357 小时
注册时间
2013-1-29
帖子
1637
2
 楼主| 发表于 2013-7-28 21:29:08 | 显示全部楼层
JN1412 发表于 2013-7-26 03:59
如何在某些对话中不需要半身像,半身像为空。那么显示的文字会到后面去,怎么解决这个问题呢?求解...{:2_2 ...
  1. #encoding:utf-8
  2. #==============================================================================
  3. # ■ 半身像对话框 by LBQ
  4. #------------------------------------------------------------------------------
  5. #  一个简单的半身像对话框罢了= =
  6. #------------------------------------------------------------------------------
  7. # ■ 用法一览
  8. #     1:如何将半身像应用到游戏中?
  9. #       ——如果想要把一个脸图替换成半身像,则需要找到这个脸图的编号,比如说拉尔
  10. #           夫,就是Actor1的编号0,之后去在Graphics/Busts这个文件夹里面拷贝一个
  11. #           叫做Actor1_0的图像,这个图像会被当做半身像替换原有图像。
  12. #==============================================================================
  13. $imported ||= {}
  14. $imported[:LBQ_Bust]=true

  15. module LBQ
  16.   module Bust
  17.     FOLDER="Busts"
  18.     SUB1=[/【/,    "\\{\\c[6]-- "]
  19.     SUB2=[/】/,    " --\\c[0]\\}"]

  20.     TEXT_FOR_NEXT="[next]"
  21.     TEXT_FOR_END ="[end]"

  22.     INDENT=255 #半身像的缩进
  23.   end
  24. end

  25. module Cache
  26.   def self.busts(filename)
  27.     load_bitmap("Graphics/#{LBQ::Bust::FOLDER}/", filename)
  28.   end
  29. end



  30. class Sprite_Bust < Sprite_Base
  31.   attr_accessor   :bust_graphics
  32.   attr_accessor   :status

  33.   def initialize(vp=nil)
  34.     super(vp)
  35.     @bust_graphics=nil
  36.     @status=:nothing
  37.   end

  38.   def slide_in
  39.     @status=:sliding_in
  40.   end

  41.   def slide_out
  42.     @status=:sliding_out
  43.     if $game_message.do_not_slide_out
  44.       @status=:slided_out
  45.       set_pos
  46.     end
  47.   end




  48.   def set_pos(slide_in=true)
  49.     self.x=0 - self.bitmap.width
  50.     self.y=Graphics.height-self.bitmap.height

  51.     self.x=0 unless slide_in
  52.   end


  53.   def set_graphics(bust_graphics)
  54.     self.bitmap=Cache.busts(bust_graphics)
  55.   end



  56.   def update
  57.     super
  58.     case @status
  59.     when :nothing
  60.       # Do Nothing
  61.     when :sliding_in
  62.       #Slide In
  63.       self.x+=12
  64.       if self.x>=0
  65.         self.x=0
  66.         @status=:slided_in
  67.       end

  68.     when :sliding_out
  69.       self.x-=12
  70.       if self.x<= -self.bitmap.width
  71.         self.x= -self.bitmap.width
  72.         @status=:slided_out
  73.       end
  74.       #Slide Out
  75.     when :slided_in
  76.       #Slided in
  77.     when :slided_out
  78.       #Sliede out
  79.     end

  80.   end


  81. end


  82. class Game_Message
  83.   attr_accessor   :bust_name
  84.   attr_accessor   :bust
  85.   attr_accessor   :have_bust
  86.   attr_accessor   :do_not_slide_out

  87.   alias lbq_bust_shot_game_message_init initialize
  88.   def initialize
  89.     lbq_bust_shot_game_message_init
  90.     @bust_name=""
  91.     @bust=nil
  92.     @have_bust=false
  93.     @do_not_slide_out=false
  94.   end



  95.   #--------------------------------------------------------------------------
  96.   # ● 添加内容
  97.   #--------------------------------------------------------------------------
  98.   def add(text)
  99.     new_text=text.gsub(LBQ::Bust::SUB1[0],LBQ::Bust::SUB1[1])
  100.     new_text2=new_text.gsub(LBQ::Bust::SUB2[0],LBQ::Bust::SUB2[1])
  101.     if new_text2.include? LBQ::Bust::TEXT_FOR_NEXT
  102.       new_text2.delete!(LBQ::Bust::TEXT_FOR_NEXT)
  103.       $game_message.do_not_slide_out=true
  104.     end

  105.     if new_text2.include? LBQ::Bust::TEXT_FOR_END
  106.       new_text2.delete!(LBQ::Bust::TEXT_FOR_END)
  107.       $game_message.do_not_slide_out=false
  108.     end
  109.     @texts.push(new_text2)
  110.   end
  111. end



  112. class Game_Interpreter
  113.   alias lbq_bust_shot_command_101 command_101
  114.   #--------------------------------------------------------------------------
  115.   # ● 显示文字
  116.   #--------------------------------------------------------------------------
  117.   def command_101
  118.     $game_message.bust=nil
  119.       unless @params[0].empty?
  120.         if File.exist?("Graphics/#{LBQ::Bust::FOLDER}/#{@params[0]}_#{@params[1]}.png")
  121.           $game_message.have_bust=true
  122.         else
  123.           $game_message.have_bust=false
  124.           $game_message.bust_name=""
  125.         end
  126.       end

  127.     unless @params[3] == 2
  128.       $game_message.have_bust=false
  129.     end

  130.     if $game_message.have_bust
  131.       $game_message.bust_name="#{@params[0]}_#{@params[1]}"
  132.       $game_message.bust=nil
  133.       $game_message.bust=Sprite_Bust.new
  134.       $game_message.bust.set_graphics($game_message.bust_name)
  135.       $game_message.bust.z=99999
  136.       unless $game_message.do_not_slide_out
  137.         $game_message.bust.set_pos
  138.         $game_message.bust.slide_in
  139.       else
  140.         $game_message.bust.set_pos(false)
  141.         $game_message.bust.slide_in
  142.       end
  143.     end

  144.     lbq_bust_shot_command_101
  145.     if $game_message.have_bust
  146.         $game_message.bust.slide_out
  147.         Fiber.yield until $game_message.bust.status==:slided_out
  148.     end
  149.     $game_message.have_bust=false
  150.     $game_message.bust_name=""

  151.   end


  152.   alias lbq_bust_int_update update
  153.   def update
  154.     lbq_bust_int_update
  155.     $game_message.bust.update unless $game_message.bust.nil?
  156.   end

  157. end


  158. class Window_Message
  159.   #--------------------------------------------------------------------------
  160.   # ● 获取换行位置
  161.   #--------------------------------------------------------------------------
  162.   def new_line_x
  163.     value=0
  164.     value=112 unless $game_message.face_name.empty?
  165.     unless $game_message.face_name.empty? && $game_message.bust_name.empty?
  166.       value=LBQ::Bust::INDENT
  167.     end
  168.    
  169.     return value
  170.   end
  171. end


  172. class Window_Message
  173.   #--------------------------------------------------------------------------
  174.   # ● 翻页处理
  175.   #--------------------------------------------------------------------------
  176.   def new_page(text, pos)
  177.     contents.clear
  178.     draw_face($game_message.face_name, $game_message.face_index, 0, 0) if $game_message.bust_name.empty?
  179.     reset_font_settings
  180.     pos[:x] = new_line_x
  181.     pos[:y] = 0
  182.     pos[:new_x] = new_line_x
  183.     pos[:height] = calc_line_height(text)
  184.     clear_flags
  185.   end
  186. end
复制代码
理论上应当修复完毕,对于这个不便深表歉意
『我只是一个正在潜心修炼的渣乐师罢了』
Dear Time\(^o^)/~


假如上面的图片挂了的话麻烦各位去发个帖 @ 一下 orzFly 让他修复 deartime
回复 支持 反对

使用道具 举报

Lv3.寻梦者

唯一的信徒

梦石
0
星屑
1665
在线时间
1357 小时
注册时间
2013-1-29
帖子
1637
3
 楼主| 发表于 2016-11-1 00:23:52 | 显示全部楼层
BWR 发表于 2016-10-29 20:38
腳本我什ˊ麼都沒動,為什麼會這樣呢?

因为脚本有些时日了 + 学业繁忙,所以我恐怕需要一个能够直接出现 bug 的工程,或者出现 bug 的步骤我才有可能解决这个问题。

也许脚本本身写的不好会导致这种问题有时发生有时不发生,但是我也没有精力来修自己三年前写的脚本。

所以假如有工程的话希望上传工程嗯。
『我只是一个正在潜心修炼的渣乐师罢了』
Dear Time\(^o^)/~


假如上面的图片挂了的话麻烦各位去发个帖 @ 一下 orzFly 让他修复 deartime
回复 支持 反对

使用道具 举报

Lv3.寻梦者

唯一的信徒

梦石
0
星屑
1665
在线时间
1357 小时
注册时间
2013-1-29
帖子
1637
4
 楼主| 发表于 2016-11-2 05:52:31 | 显示全部楼层
BWR 发表于 2016-11-1 21:04
舊的問題沒了 新的問題來了 嗚嗚嗚
是檔案名稱不能用中文嗎?
我半身像放在資料夾裡了,但遊戲中還是只有9 ...

实测发现中文可以,所以假如方便的话上传一个能够重复 bug 的工程。

或者也可以自己试着从中文改成英文。

或者可以对比一下范例看看有没有做错了什么(虽然可能性不大不过还是做一下吧)。
『我只是一个正在潜心修炼的渣乐师罢了』
Dear Time\(^o^)/~


假如上面的图片挂了的话麻烦各位去发个帖 @ 一下 orzFly 让他修复 deartime
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-17 01:34

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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