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

Project1

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

[已经过期] 求一个对话框显示字同时伴有声音的脚本

[复制链接]

Lv2.观梦者

梦石
0
星屑
789
在线时间
115 小时
注册时间
2017-12-2
帖子
74
跳转到指定楼层
1
发表于 2018-2-10 12:08:21 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 wskai 于 2018-2-10 12:37 编辑

可以给个范例工程,不要FUKI对话框之类的,和我游戏的脚本冲突了还什么怎么了不清楚导致无法使用或是帮我解决一下也行,谢谢!!!!!!!

按图片顺序发布

在别的工程也不行,一个个脚本排查也排查不出来



RUBY 代码复制
  1. #==============================================================================
  2. #
  3. # ▼ Yami Engine Ace - 气泡对话框
  4. # -- 最后更新: 2012.06.07
  5. # -- 使用难度: Normal
  6. # -- 需要脚本: 无
  7. #
  8. #==============================================================================
  9.  
  10. $imported = {} if $imported.nil?
  11. $imported["YSE-PopMessage"] = true
  12.  
  13. #==============================================================================
  14. # ▼ Updates
  15. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  16. # 2012.06.07 - Fixed Compatible: YEA - Ace Message System.
  17. # 2012.05.11 - Fixed Message Position.
  18. #            - Remove Requirement: YSE - Fix Events Order.
  19. # 2012.05.07 - Fixed Face position.
  20. #            - Added Requirement: YSE - Fix Events Order.
  21. # 2012.04.06 - You can change Bubble Tag filename.
  22. # 2012.03.28 - Fixed Default Message Position and Sizes.
  23. # 2012.03.27 - Fixed Default Message.
  24. # 2012.03.27 - Added Bubble Tag.
  25. # 2012.03.25 - Fixed Escape Message.
  26. # 2012.03.24 - Fixed Battle Message.
  27. # 2012.03.24 - Rewrote script.
  28. #
  29. #==============================================================================
  30. # ▼ 介绍
  31. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  32. # 本脚本可以将对话框改变为气泡对话框,使用"BubbleTag"作为气泡标志图片,放在:
  33. # \Graphics\System 文件夹中.
  34. # 需要配合脚本:Yami Engine Ace - Bug修复: 事件ID顺序 一起使用.
  35. #==============================================================================
  36. # ▼ 安装方式
  37. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  38. # 打开脚本编辑器,将本脚本拷贝/复制到一个在▼ 插件脚本之下▼ Main之上的新
  39. # 脚本页/槽中.记得保存你的工程以使脚本生效.
  40. #
  41. # -----------------------------------------------------------------------------
  42. # 文本代码 - 可以在文字窗口中使用的代码.
  43. # -----------------------------------------------------------------------------
  44. #     代码:    效果:
  45. #    \bm[x]    - 在x号事件处显示气泡对话框. *注释
  46. #    \cbm      - 关闭气泡对话框效果.
  47. #
  48. #              *注释: 设定为 0 则会在角色处显示.
  49. #
  50. #==============================================================================
  51. # ▼ 兼容性
  52. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  53. # 本脚本仅为RPG Maker VX Ace编写.极不可能在无任何修改的情况下运行于RPG Maker VX.
  54. #
  55. #==============================================================================
  56.  
  57. module YSE
  58.   module POP_MESSAGE
  59.  
  60.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  61.     # - 视觉效果设置 -
  62.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  63.     LIMIT = { # 开始.
  64.       :limit_width    =>  0,  # 宽度限制,设定为0则无限制.
  65.       :limit_line     =>  6,  # 行数限制,设定为0则无限制.
  66.     } # 结束.
  67.  
  68.     POSITION = { # 开始.
  69.       :x_buffer       =>  0,   #调整气泡对话框的x坐标
  70.       :y_buffer       =>  -36, #调整气泡对话框的y坐标
  71.       :face_x_buffer  =>  8,   #调整角色肖像图的x坐标
  72.       :face_y_buffer  =>  24,  #调整角色肖像图的y坐标
  73.       :tag_y_buffer   =>  -6,  #调整角色肖像图的y坐标
  74.       :name_x_buffer  =>  112, #调整名称窗口的x坐标,需要脚本 YEA - 文本系统.
  75.     } # 结束.
  76.  
  77.     EFFECT = { # 开始.
  78.       :fade_face       =>  true, #是否显示角色肖像图淡入效果
  79.       :move_face       =>  true, #是否显示角色肖像图移动效果
  80.       :use_bubble_tag  =>  true, #是否显示气泡标志图片
  81.       :bubble_tag_name => "BubbleTag",#气泡标志图片的文件名
  82.     } # 结束.
  83.  
  84.   end
  85. end
  86.  
  87. #==============================================================================
  88. # ▼ 编辑以下内容可能会出现电脑损坏、死机,电脑主人脑袋爆炸、昏迷、死亡或口臭
  89. # 所以编辑了后果自负。
  90. #==============================================================================
  91.  
  92. #==============================================================================
  93. # ■ Spriteset_Map
  94. #==============================================================================
  95.  
  96. class Spriteset_Map
  97.  
  98.   #--------------------------------------------------------------------------
  99.   # public instance variables
  100.   #--------------------------------------------------------------------------
  101.   attr_accessor :character_sprites
  102.  
  103. end # Spriteset_Map
  104.  
  105. #==============================================================================
  106. # ■ Window_Message_Face
  107. #==============================================================================
  108.  
  109. class Window_Message_Face < Window_Base
  110.  
  111.   #--------------------------------------------------------------------------
  112.   # initialize
  113.   #--------------------------------------------------------------------------
  114.   def initialize
  115.     super(0, 0, 120, 120)
  116.     self.opacity = 0
  117.     @face_name = ""
  118.     @face_index = 0
  119.     @move_x = 0
  120.     close
  121.   end
  122.  
  123.   #--------------------------------------------------------------------------
  124.   # message_window=
  125.   #--------------------------------------------------------------------------
  126.   def message_window=(window)
  127.     @message_window = window
  128.   end
  129.  
  130.   #--------------------------------------------------------------------------
  131.   # set_face
  132.   #--------------------------------------------------------------------------
  133.   def set_face
  134.     contents.clear
  135.     return unless @message_window
  136.     if !$game_message.face_name.empty?
  137.       draw_face($game_message.face_name, $game_message.face_index, 0, 0)
  138.       set_position
  139.       show_face
  140.     else
  141.       hide_face
  142.     end
  143.   end
  144.  
  145.   #--------------------------------------------------------------------------
  146.   # set_position
  147.   #--------------------------------------------------------------------------
  148.   def set_position
  149.     return unless @message_window
  150.     self.x = @message_window.x
  151.     self.y = @message_window.y - 96
  152.     self.x += YSE::POP_MESSAGE::POSITION[:face_x_buffer]
  153.     self.y += YSE::POP_MESSAGE::POSITION[:face_y_buffer]
  154.     self.y += (@message_window.real_lines - 1) * 24
  155.     self.z = @message_window.z + 1
  156.     if (@face_name != $game_message.face_name || @face_index != $game_message.face_index)
  157.       if YSE::POP_MESSAGE::EFFECT[:move_face]
  158.         @move_x = 30
  159.         self.x -= 30
  160.       end
  161.       @face_name = $game_message.face_name
  162.       @face_index = $game_message.face_index
  163.       self.contents_opacity = 0 if YSE::POP_MESSAGE::EFFECT[:fade_face]
  164.     end
  165.   end
  166.  
  167.   #--------------------------------------------------------------------------
  168.   # show_face
  169.   #--------------------------------------------------------------------------
  170.   def show_face
  171.     open
  172.   end
  173.  
  174.   #--------------------------------------------------------------------------
  175.   # hide_face
  176.   #--------------------------------------------------------------------------
  177.   def hide_face
  178.     contents.clear
  179.     close
  180.   end
  181.  
  182.   #--------------------------------------------------------------------------
  183.   # update
  184.   #--------------------------------------------------------------------------
  185.   def update
  186.     super
  187.     self.contents_opacity += 15 if self.contents_opacity < 255
  188.     unless @move_x <= 0
  189.       self.x += 2
  190.       @move_x -= 2
  191.     end
  192.   end
  193.  
  194. end # Sprite_Message_Face
  195.  
  196. #==============================================================================
  197. # ■ Window_Message
  198. #==============================================================================
  199.  
  200. class Window_Message < Window_Base
  201.  
  202.   #--------------------------------------------------------------------------
  203.   # new method: face_window=
  204.   #--------------------------------------------------------------------------
  205.   def face_window=(window)
  206.     @face_window = window
  207.   end
  208.  
  209.   #--------------------------------------------------------------------------
  210.   # new method: bubble_tag=
  211.   #--------------------------------------------------------------------------
  212.   def bubble_tag=(sprite)
  213.     @bubble_tag = sprite
  214.   end
  215.  
  216.   #--------------------------------------------------------------------------
  217.   # new method: message_escape_characters_pop_message
  218.   #--------------------------------------------------------------------------
  219.   def message_escape_characters_pop_message(result)
  220.     result.gsub!(/\eBM\[(\d+)\]/i) { event_pop_message_setup($1.to_i, false) }
  221.     result.gsub!(/\eBMF\[(\d+)\]/i) { event_pop_message_setup($1.to_i, true) }
  222.     result.gsub!(/\eCBM/i) { event_pop_message_setup(nil, false) }
  223.     result
  224.   end
  225.  
  226.   #--------------------------------------------------------------------------
  227.   # alias method: convert_escape_characters
  228.   #--------------------------------------------------------------------------
  229.   alias yse_convert_escape_characters_pm convert_escape_characters
  230.   def convert_escape_characters(text)
  231.     result = yse_convert_escape_characters_pm(text)
  232.     result = message_escape_characters_pop_message(result)
  233.     result
  234.   end
  235.  
  236.   #--------------------------------------------------------------------------
  237.   # new method: event_pop_message_setup
  238.   #--------------------------------------------------------------------------
  239.   def event_pop_message_setup(event_id, follower = false)
  240.     if follower && $game_player.followers[event_id].nil?
  241.       @event_pop_id = nil
  242.       @event_pop_follower = false
  243.       return ""
  244.     end
  245.     @event_pop_follower = follower
  246.     @event_pop_id = event_id
  247.     return ""
  248.   end
  249.  
  250.   #--------------------------------------------------------------------------
  251.   # new method: set_face_position
  252.   #--------------------------------------------------------------------------
  253.   def set_face_position
  254.     return unless SceneManager.scene_is?(Scene_Map)
  255.     return unless @event_pop_id
  256.     return unless @face_window
  257.     contents.clear
  258.     @face_window.set_face
  259.     return unless $imported["YEA-MessageSystem"]
  260.     return if @face_window.close?
  261.     #@name_window.x = self.x + YSE::POP_MESSAGE::POSITION[:face_x_buffer] + YSE::POP_MESSAGE::POSITION[:name_x_buffer] if (@name_position == 1 || @name_position == 2)
  262.   end
  263.  
  264.   #--------------------------------------------------------------------------
  265.   # alias method: new_page
  266.   #--------------------------------------------------------------------------
  267.   alias window_message_new_page_pm_yse new_page
  268.   def new_page(text, pos)
  269.     window_message_new_page_pm_yse(text, pos)
  270.     set_face_position
  271.   end
  272.  
  273.   #--------------------------------------------------------------------------
  274.   # alias method: close
  275.   #--------------------------------------------------------------------------
  276.   alias pop_message_close close
  277.   def close
  278.     pop_message_close
  279.     return unless SceneManager.scene_is?(Scene_Map)
  280.     return unless @event_pop_id
  281.     @event_pop_id = nil
  282.     @event_pop_follower = false
  283.     @face_window.hide_face
  284.     return unless YSE::POP_MESSAGE::EFFECT[:use_bubble_tag]
  285.     @bubble_tag.visible = false if @bubble_tag
  286.   end
  287.  
  288.   #--------------------------------------------------------------------------
  289.   # alias method: open_and_wait
  290.   #--------------------------------------------------------------------------
  291.   alias pop_message_open_and_wait open_and_wait
  292.   def open_and_wait
  293.     pop_message_open_and_wait
  294.     return unless YSE::POP_MESSAGE::EFFECT[:use_bubble_tag]
  295.     @bubble_tag.visible = true if @event_pop_id && @bubble_tag
  296.   end
  297.  
  298.   #--------------------------------------------------------------------------
  299.   # alias method: process_all_text
  300.   #--------------------------------------------------------------------------
  301.   alias pop_message_process_all_text process_all_text
  302.   def process_all_text
  303.     @event_pop_id = nil
  304.     convert_escape_characters($game_message.all_text)
  305.     update_placement
  306.     adjust_pop_message($game_message.all_text)
  307.     pop_message_process_all_text
  308.   end
  309.  
  310.   #--------------------------------------------------------------------------
  311.   # alias method: update_placement
  312.   #--------------------------------------------------------------------------
  313.   alias event_pop_message_update_placement update_placement
  314.   def update_placement
  315.     if SceneManager.scene_is?(Scene_Map)
  316.       if @event_pop_id.nil?
  317.         fix_default_message
  318.         event_pop_message_update_placement
  319.       elsif @event_pop_id == 0
  320.         character = $game_player
  321.         self.y = character.screen_y - self.height + YSE::POP_MESSAGE::POSITION[:y_buffer]
  322.         self.x = character.screen_x - self.width / 2 + YSE::POP_MESSAGE::POSITION[:x_buffer]
  323.         fix_position_bubble(character)
  324.         set_bubble_tag(character)
  325.       elsif @event_pop_id > 0
  326.         hash = @event_pop_follower ? $game_player.followers : $game_map.events
  327.         character = hash[@event_pop_id]
  328.         self.y = character.screen_y - self.height + YSE::POP_MESSAGE::POSITION[:y_buffer]
  329.         self.x = character.screen_x - self.width / 2 + YSE::POP_MESSAGE::POSITION[:x_buffer]
  330.         fix_position_bubble(character)
  331.         set_bubble_tag(character)
  332.       end
  333.     else
  334.       event_pop_message_update_placement
  335.     end
  336.   end
  337.  
  338.   #--------------------------------------------------------------------------
  339.   # new method: fix_default_message
  340.   #--------------------------------------------------------------------------
  341.   def fix_default_message
  342.     self.width = window_width
  343.     self.height = window_height
  344.     self.x = 0
  345.     @face_window.hide_face if @face_window
  346.     create_contents
  347.     return unless YSE::POP_MESSAGE::EFFECT[:use_bubble_tag]
  348.     @bubble_tag.visible = false if @bubble_tag
  349.   end
  350.  
  351.   #--------------------------------------------------------------------------
  352.   # new method: fix_position_bubble
  353.   #--------------------------------------------------------------------------
  354.   def fix_position_bubble(character)
  355.     end_x = self.x + self.width
  356.     end_y = self.y + self.height
  357.     self.x = 0 if self.x < 0
  358.     self.y = character.screen_y if self.y < 0
  359.     self.x = Graphics.width - self.width if end_x > Graphics.width
  360.     self.y = Graphics.height - self.height if end_y > Graphics.height
  361.   end
  362.  
  363.   #--------------------------------------------------------------------------
  364.   # new method: set_bubble_tag
  365.   #--------------------------------------------------------------------------
  366.   def set_bubble_tag(character)
  367.     return unless YSE::POP_MESSAGE::EFFECT[:use_bubble_tag]
  368.     return unless @bubble_tag
  369.     up = self.y == character.screen_y
  370.     self.y += up ? @bubble_tag.height / 2 : -@bubble_tag.height / 2
  371.     @bubble_tag.x = character.screen_x - @bubble_tag.width / 2
  372.     if up
  373.       @bubble_tag.src_rect.set(0, @bubble_tag.height, @bubble_tag.width, @bubble_tag.height)
  374.       @bubble_tag.y = self.y - @bubble_tag.height - YSE::POP_MESSAGE::POSITION[:tag_y_buffer]
  375.     else
  376.       @bubble_tag.src_rect.set(0, 0, @bubble_tag.width, @bubble_tag.height)
  377.       @bubble_tag.y = self.y + self.height + YSE::POP_MESSAGE::POSITION[:tag_y_buffer]
  378.     end
  379.   end
  380.  
  381.   #--------------------------------------------------------------------------
  382.   # new method: cal_number_line
  383.   #--------------------------------------------------------------------------
  384.   def cal_number_line(text)
  385.     result = 0
  386.     text.each_line { result += 1 }
  387.     return result
  388.   end
  389.  
  390.   #--------------------------------------------------------------------------
  391.   # new method: cal_width_line
  392.   #--------------------------------------------------------------------------
  393.   def cal_width_line(text)
  394.     result = 0
  395.     text.each_line { |line|
  396.       result = text_size(line).width if result < text_size(line).width
  397.     }
  398.     return result
  399.   end
  400.  
  401.   #--------------------------------------------------------------------------
  402.   # alias method: adjust_message_window_size
  403.   #--------------------------------------------------------------------------
  404.   if $imported["YEA-MessageSystem"]
  405.   alias yse_pop_message_adjust_message_window_size adjust_message_window_size
  406.   def adjust_message_window_size
  407.     start_name_window if @event_pop_id
  408.     return if @event_pop_id
  409.     yse_pop_message_adjust_message_window_size
  410.   end
  411.   end
  412.  
  413.   #--------------------------------------------------------------------------
  414.   # new method: adjust_pop_message
  415.   #--------------------------------------------------------------------------
  416.   def adjust_pop_message(text = " ")
  417.     return unless SceneManager.scene_is?(Scene_Map)
  418.     unless @event_pop_id
  419.       if $imported["YEA-MessageSystem"]
  420.         #adjust_message_window_size
  421.       end
  422.       return
  423.     end
  424.     n_line = cal_number_line(text)
  425.     n_line = YSE::POP_MESSAGE::LIMIT[:limit_line] if YSE::POP_MESSAGE::LIMIT[:limit_line] > 0 && cal_number_line(text) > YSE::POP_MESSAGE::LIMIT[:limit_line]
  426.     @real_lines = n_line
  427.     self.height = fitting_height(n_line)
  428.     self.width = cal_width_line(text) + 24
  429.     self.width += new_line_x
  430.     if self.width > YSE::POP_MESSAGE::LIMIT[:limit_width] && YSE::POP_MESSAGE::LIMIT[:limit_width] > 0
  431.       self.width = YSE::POP_MESSAGE::LIMIT[:limit_width]
  432.     end
  433.     create_contents
  434.     update_placement
  435.   end
  436.  
  437.   #--------------------------------------------------------------------------
  438.   # overwrite method: new_line_x
  439.   #--------------------------------------------------------------------------
  440.   def new_line_x
  441.     if $game_message.face_name.empty?
  442.       return 0
  443.     else
  444.       result = YSE::POP_MESSAGE::POSITION[:face_x_buffer]
  445.       p_x = $imported["YEA-MessageSystem"] ? YEA::MESSAGE::FACE_INDENT_X : 112
  446.       result += p_x
  447.       return result
  448.     end
  449.   end
  450.  
  451.   #--------------------------------------------------------------------------
  452.   # new method: real_lines
  453.   #--------------------------------------------------------------------------
  454.   def real_lines
  455.     @real_lines
  456.   end
  457.  
  458. end # Window_Message
  459.  
  460. #==============================================================================
  461. # ■ Scene_Map
  462. #==============================================================================
  463.  
  464. class Scene_Map < Scene_Base
  465.  
  466.   #--------------------------------------------------------------------------
  467.   # alias method: create_message_window
  468.   #--------------------------------------------------------------------------
  469.   alias yse_pm_create_message_window create_message_window
  470.   def create_message_window
  471.     yse_pm_create_message_window
  472.     @face_window = Window_Message_Face.new
  473.     @face_window.message_window = @message_window
  474.     if YSE::POP_MESSAGE::EFFECT[:use_bubble_tag]
  475.       @bubble_tag_sprite = Sprite.new
  476.       @bubble_tag_sprite.visible = false
  477.       @bubble_tag_sprite.bitmap = Cache.system(YSE::POP_MESSAGE::EFFECT[:bubble_tag_name])
  478.       @bubble_tag_sprite.src_rect.set(0, 0, @bubble_tag_sprite.width, @bubble_tag_sprite.height / 2)
  479.       @message_window.bubble_tag = @bubble_tag_sprite
  480.     end
  481.     @message_window.face_window = @face_window
  482.   end
  483.  
  484.   #--------------------------------------------------------------------------
  485.   # alias method: dispose_spriteset
  486.   #--------------------------------------------------------------------------
  487.   alias pop_message_dispose_spriteset dispose_spriteset
  488.   def dispose_spriteset
  489.     pop_message_dispose_spriteset
  490.     return unless @bubble_tag_sprite
  491.     @bubble_tag_sprite.dispose
  492.   end
  493.  
  494. end # Scene_Map
  495.  
  496. #==============================================================================
  497. #
  498. # ▼ End of File
  499. #
  500. #==============================================================================











RUBY 代码复制
  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - 文本系统 v1.05
  4. # -- 最后更新: 2012.01.13
  5. # -- 使用难度: 普通
  6. # -- 需要脚本: 无
  7. #
  8. #==============================================================================
  9.  
  10. $imported = {} if $imported.nil?
  11. $imported["YEA-MessageSystem"] = true
  12.  
  13. #==============================================================================
  14. # ▼ Updates
  15. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  16. # 2012.07.21 - Fixed REGEXP error at line 824
  17. # 2012.01.13 - Bug Fixed: Negative tags didn't display other party members.
  18. # 2012.01.12 - Compatibility Update: Message Actor Codes
  19. # 2012.01.10 - Added Feature: \pic[x] text code.
  20. # 2012.01.04 - Bug Fixed: \ic tag was \ii. No longer the case.
  21. #            - Added: Scroll Text window now uses message window font.
  22. # 2011.12.31 - Started Script and Finished.
  23. #
  24. #==============================================================================
  25. # ▼ 介绍
  26. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  27. # 尽管RPG Maker VX Ace已经为文本系统添加各种实用的功能,再加多一点新功能也未尝
  28. # 不可,像新的窗口,转换文本编码,以更快的方式输出物品,武器,护甲等的图标和/或
  29. # 名称。本脚本还为脚本开发人员提供在游戏过程中调整文本窗口大小的功能,使用单
  30. # 独的字体,并为玩家提供文本快进功能。
  31. #
  32. #==============================================================================
  33. # ▼ 安装方式
  34. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  35. # 打开脚本编辑器,将本脚本拷贝/复制到一个在▼ 插件脚本之下▼ Main之上的新
  36. # 脚本页/槽中.记得保存你的工程以使脚本生效.
  37. #
  38. # -----------------------------------------------------------------------------
  39. # 文本代码 - 在文本窗口中可以使用的代码.
  40. # -----------------------------------------------------------------------------
  41. #    代码:       效果:
  42. #    \v[x]     - 显示x号变量的值.
  43. #    \n[x]     - 显示x号角色的名字.
  44. #    \p[x]     - 显示队伍中x号队友的名字.
  45. #    \g        - 显示当前金币名.
  46. #    \c[x]     - 改变字体颜色为x.
  47. #    \i[x]     - 显示index为x的图标.
  48. #    \{        - 文字增大8点.
  49. #    \}        - 文字缩小8点.
  50. #    \$        - 打开金币窗口.
  51. #    \.        - 等待15帧 (1/4秒).
  52. #    \|        - 等待60帧 (1秒).
  53. #    \!        - 等待直到玩家按下确定键.
  54. #    \>        - 立即显示完剩下的文本.
  55. #    \<        - 停止立即显示剩下的文本.
  56. #    \^        - 跳到下一个文本框.
  57. #    \\        - 显示一个"\".
  58. #
  59. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  60. #
  61. #    等待:       效果:
  62. #    \w[x]     - 等待x帧 (60 帧 = 1 秒). 仅用于文本窗口.
  63. #
  64. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  65. #
  66. #  名称窗口:     效果:
  67. #    \n<x>     - 创建一个显示"x"的名称窗口. 靠左. *注释
  68. #    \nc<x>    - 创建一个显示"x"的名称窗口. 居中. *注释
  69. #    \nr<x>    - 创建一个显示"x"的名称窗口. 靠右. *注释
  70. #
  71. #              *注释: 仅用于文本窗口.
  72. #
  73. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  74. #
  75. #    位置:       效果:
  76. #    \px[n]    - 将文本的x坐标设定为n.
  77. #    \py[n]    - 将文本的y坐标设定为n.
  78. #
  79. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  80. #
  81. #     图片:       效果:
  82. #    \pic[x]   - 显示图片x,其放在文件夹:Graphics\Pictures .
  83. #
  84. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  85. #
  86. #     轮廓:      效果:
  87. #    \oc[x]    - 设定轮廓颜色为x.
  88. #    \oo[x]    - 设定轮廓不透明度为x.
  89. #
  90. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  91. #
  92. #    字体:       效果:
  93. #    \fr       - 重置全部字体的变化.
  94. #    \fz[x]    - 改变字体大小为x.
  95. #    \fn[x]    - 改变字体名为x.
  96. #    \fb       - 切换字体加粗状态.
  97. #    \fi       - 切换字体斜体状态.
  98. #    \fo       - 切换字体轮廓状态.
  99. #    \fs       - 切换字体阴影状态.
  100. #
  101. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  102. #
  103. #     角色:       效果:
  104. #    \af[x]    - 显示x号角色的脸图. *注释
  105. #    \ac[x]    - 显示x号角色的职业名. *注释
  106. #    \as[x]    - 显示x号角色的副职业名. 需要脚本: Class System. *注释
  107. #    \an[x]    - 显示x号角色的称号. *注释
  108. #
  109. #              *注释: 如果x是0或负数,则视为当前角色(玩家操控的队长)或队友:
  110. #                   0 - 队长
  111. #                  -1 - 第一个非队长角色.
  112. #                  -2 - 第二个非队长角色. 以此类推.
  113. #
  114. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  115. #
  116. #     名字:      效果:
  117. #    \nc[x]    - 显示x号职业的名字.
  118. #    \ni[x]    - 显示x号物品的名字.
  119. #    \nw[x]    - 显示x号武器的名字.
  120. #    \na[x]    - 显示x号防具的名字.
  121. #    \ns[x]    - 显示x号技能的名字.
  122. #    \nt[x]    - 显示x号状态的名字.
  123. #
  124. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  125. #
  126. #  图标+名字:    效果:
  127. #    \ic[x]    - 显示x号职业的名字和图标. *
  128. #    \ii[x]    - 显示x号物品的名字和图标.
  129. #    \iw[x]    - 显示x号武器的名字和图标.
  130. #    \ia[x]    - 显示x号防具的名字和图标.
  131. #    \is[x]    - 显示x号技能的名字和图标.
  132. #    \it[x]    - 显示x号状态的名字和图标.
  133. #
  134. #              *注释: 需要脚本 YEA - Class System
  135. #
  136. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  137. #
  138. # 以上就为本脚本全部可用的文本代码。请记住某些代码仅可用于文本窗口,其他的则可以
  139. # 使用于物品/技能/武器/防具等的描述、角色说明或其他地方。
  140. #
  141. #==============================================================================
  142. # ▼ 兼容性
  143. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  144. # 本脚本仅为RPG Maker VX Ace编写.极不可能在无任何修改的情况下运行于RPG Maker VX.
  145. #
  146. #==============================================================================
  147.  
  148. module YEA
  149.   module MESSAGE
  150.  
  151.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  152.     # - 通用设置 -
  153.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  154.     # 下面是文本窗口的通用设置.
  155.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  156.     # 快速跳过文本的按钮。按住时将加速显示文本,但是不会跳过等待。按住时会自动
  157.     # 跳到下一个文本窗口
  158.     TEXT_SKIP = :A     #  :A 为键盘上的Shift键.
  159.  
  160.     # 存储文本窗口中最大行数的变量。如果你不想使用这个功能,请设定为0。当
  161.     # 设定为0或以下时,脚本会自动默认为4行
  162.     VARIABLE_ROWS  = 21
  163.  
  164.     # 存储文本窗口中最大列数的变量。如果你不想使用这个功能,请设定为0。当
  165.     # 设定为0或以下时,脚本会自动默认列宽度为游戏窗口的宽度
  166.     VARIABLE_WIDTH = 22
  167.  
  168.     # 这是文本窗口在显示脸图时将缩进的空间量。 默认: 112
  169.     FACE_INDENT_X = 112
  170.  
  171.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  172.     # - 名称窗口设置 -
  173.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  174.     # 名称窗口是区别于文本窗口的另一个窗口,用于显示角色的名字。
  175.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  176.     NAME_WINDOW_X_BUFFER = -20     # 调整名称窗口的x坐标.
  177.     NAME_WINDOW_Y_BUFFER = 0       # 调整名称窗口的y坐标.
  178.     NAME_WINDOW_PADDING  = 20      # 横向增加的宽度.
  179.     NAME_WINDOW_OPACITY  = 255     # 名称窗口的不透明度.
  180.     NAME_WINDOW_COLOUR   = 6       # 默认文本颜色.
  181.  
  182.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  183.     # - 文本字体设置 -
  184.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  185.     # Ace 文本系统将游戏中的系统字体于文本字体中脱离。
  186.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  187.     # 在数组中放置要使用的字体,若在玩家的电脑中第一种字体不存在,则会使用第二
  188.     # 种字体,以此类推。
  189.     MESSAGE_WINDOW_FONT_NAME = ["黑体", "宋体", "微软雅黑"]
  190.  
  191.     # 关于字体的其他设置.
  192.     MESSAGE_WINDOW_FONT_SIZE    = 24       # 字体大小.
  193.     MESSAGE_WINDOW_FONT_BOLD    = false    # 是否默认加粗?
  194.     MESSAGE_WINDOW_FONT_ITALIC  = false    # 是否默认斜体?
  195.     MESSAGE_WINDOW_FONT_OUTLINE = true     # 是否默认显示轮廓?
  196.     MESSAGE_WINDOW_FONT_SHADOW  = false    # 是否默认显示阴影?
  197.  
  198.   end # MESSAGE
  199. end # YEA
  200.  
  201. #==============================================================================
  202. # ▼ 编辑以下内容可能会出现电脑损坏、死机,电脑主人脑袋爆炸、昏迷、死亡或口臭
  203. # 所以编辑了后果自负。
  204. #==============================================================================
  205.  
  206. #==============================================================================
  207. # ■ Variable
  208. #==============================================================================
  209.  
  210. module Variable
  211.  
  212.   #--------------------------------------------------------------------------
  213.   # self.message_rows
  214.   #--------------------------------------------------------------------------
  215.   def self.message_rows
  216.     return 4 if YEA::MESSAGE::VARIABLE_ROWS <= 0
  217.     return 4 if $game_variables[YEA::MESSAGE::VARIABLE_ROWS] <= 0
  218.     return $game_variables[YEA::MESSAGE::VARIABLE_ROWS]
  219.   end
  220.  
  221.   #--------------------------------------------------------------------------
  222.   # self.message_width
  223.   #--------------------------------------------------------------------------
  224.   def self.message_width
  225.     return Graphics.width if YEA::MESSAGE::VARIABLE_WIDTH <= 0
  226.     return Graphics.width if $game_variables[YEA::MESSAGE::VARIABLE_WIDTH] <= 0
  227.     return $game_variables[YEA::MESSAGE::VARIABLE_WIDTH]
  228.   end
  229.  
  230. end # Variable
  231.  
  232. #==============================================================================
  233. # ■ Game_Interpreter
  234. #==============================================================================
  235.  
  236. class Game_Interpreter
  237.  
  238.   #--------------------------------------------------------------------------
  239.   # overwrite method: command_101
  240.   #--------------------------------------------------------------------------
  241.   def command_101
  242.     wait_for_message
  243.     $game_message.face_name = @params[0]
  244.     $game_message.face_index = @params[1]
  245.     $game_message.background = @params[2]
  246.     $game_message.position = @params[3]
  247.     while continue_message_string?
  248.       @index += 1
  249.       if @list[@index].code == 401
  250.         $game_message.add(@list[@index].parameters[0])
  251.       end
  252.       break if $game_message.texts.size >= Variable.message_rows
  253.     end
  254.     case next_event_code
  255.     when 102
  256.       @index += 1
  257.       setup_choices(@list[@index].parameters)
  258.     when 103
  259.       @index += 1
  260.       setup_num_input(@list[@index].parameters)
  261.     when 104
  262.       @index += 1
  263.       setup_item_choice(@list[@index].parameters)
  264.     end
  265.     wait_for_message
  266.   end
  267.  
  268.   #--------------------------------------------------------------------------
  269.   # new method: continue_message_string?
  270.   #--------------------------------------------------------------------------
  271.   def continue_message_string?
  272.     return true if next_event_code == 101 && Variable.message_rows > 4
  273.     return next_event_code == 401
  274.   end
  275.  
  276. end # Game_Interpreter
  277.  
  278. #==============================================================================
  279. # ■ Window_Base
  280. #==============================================================================
  281.  
  282. class Window_Base < Window
  283.  
  284.   #--------------------------------------------------------------------------
  285.   # new method: setup_message_font
  286.   #--------------------------------------------------------------------------
  287.   def setup_message_font
  288.     @message_font = true
  289.     change_color(normal_color)
  290.     contents.font.out_color = Font.default_out_color
  291.     contents.font.name = YEA::MESSAGE::MESSAGE_WINDOW_FONT_NAME
  292.     contents.font.size = YEA::MESSAGE::MESSAGE_WINDOW_FONT_SIZE
  293.     contents.font.bold = YEA::MESSAGE::MESSAGE_WINDOW_FONT_BOLD
  294.     contents.font.italic = YEA::MESSAGE::MESSAGE_WINDOW_FONT_ITALIC
  295.     contents.font.outline = YEA::MESSAGE::MESSAGE_WINDOW_FONT_OUTLINE
  296.     contents.font.shadow = YEA::MESSAGE::MESSAGE_WINDOW_FONT_SHADOW
  297.   end
  298.  
  299.   #--------------------------------------------------------------------------
  300.   # alias method: reset_font_settings
  301.   #--------------------------------------------------------------------------
  302.   alias window_base_reset_font_settings_ams reset_font_settings
  303.   def reset_font_settings
  304.     if @message_font
  305.       setup_message_font
  306.     else
  307.       window_base_reset_font_settings_ams
  308.       contents.font.out_color = Font.default_out_color
  309.       contents.font.outline = Font.default_outline
  310.       contents.font.shadow = Font.default_shadow
  311.     end
  312.   end
  313.  
  314.   #--------------------------------------------------------------------------
  315.   # alias method: convert_escape_characters
  316.   #--------------------------------------------------------------------------
  317.   alias window_base_convert_escape_characters_ams convert_escape_characters
  318.   def convert_escape_characters(text)
  319.     result = window_base_convert_escape_characters_ams(text)
  320.     result = convert_ace_message_system_new_escape_characters(result)
  321.     return result
  322.   end
  323.  
  324.   #--------------------------------------------------------------------------
  325.   # new method: convert_ace_message_system_new_escape_characters
  326.   #--------------------------------------------------------------------------
  327.   def convert_ace_message_system_new_escape_characters(result)
  328.     #---
  329.     result.gsub!(/\eFR/i) { "\eAMSF[0]" }
  330.     result.gsub!(/\eFB/i) { "\eAMSF[1]" }
  331.     result.gsub!(/\eFI/i) { "\eAMSF[2]" }
  332.     result.gsub!(/\eFO/i) { "\eAMSF[3]" }
  333.     result.gsub!(/\eFS/i) { "\eAMSF[4]" }
  334.     #---
  335.     result.gsub!(/\eAC\[([-+]?\d+)\]/i) { escape_actor_class_name($1.to_i) }
  336.     result.gsub!(/\eAS\[([-+]?\d+)\]/i) { escape_actor_subclass_name($1.to_i) }
  337.     result.gsub!(/\eAN\[([-+]?\d+)\]/i) { escape_actor_nickname($1.to_i) }
  338.     #---
  339.     result.gsub!(/\eNC\[(\d+)\]/i) { $data_classes[$1.to_i].name }
  340.     result.gsub!(/\eNI\[(\d+)\]/i) { $data_items[$1.to_i].name }
  341.     result.gsub!(/\eNW\[(\d+)\]/i) { $data_weapons[$1.to_i].name }
  342.     result.gsub!(/\eNA\[(\d+)\]/i) { $data_armors[$1.to_i].name }
  343.     result.gsub!(/\eNS\[(\d+)\]/i) { $data_skills[$1.to_i].name }
  344.     result.gsub!(/\eNT\[(\d+)\]/i) { $data_states[$1.to_i].name }
  345.     #---
  346.     result.gsub!(/\eIC\[(\d+)\]/i) { escape_icon_item($1.to_i, :class) }
  347.     result.gsub!(/\eII\[(\d+)\]/i) { escape_icon_item($1.to_i, :item) }
  348.     result.gsub!(/\eIW\[(\d+)\]/i) { escape_icon_item($1.to_i, :weapon) }
  349.     result.gsub!(/\eIA\[(\d+)\]/i) { escape_icon_item($1.to_i, :armour) }
  350.     result.gsub!(/\eIS\[(\d+)\]/i) { escape_icon_item($1.to_i, :skill) }
  351.     result.gsub!(/\eIT\[(\d+)\]/i) { escape_icon_item($1.to_i, :state) }
  352.     #---
  353.     return result
  354.   end
  355.  
  356.   #--------------------------------------------------------------------------
  357.   # new method: escape_actor_class_name
  358.   #--------------------------------------------------------------------------
  359.   def escape_actor_class_name(actor_id)
  360.     actor_id = $game_party.members[actor_id.abs].id if actor_id <= 0
  361.     actor = $game_actors[actor_id]
  362.     return "" if actor.nil?
  363.     return actor.class.name
  364.   end
  365.  
  366.   #--------------------------------------------------------------------------
  367.   # new method: actor_subclass_name
  368.   #--------------------------------------------------------------------------
  369.   def escape_actor_subclass_name(actor_id)
  370.     return "" unless $imported["YEA-ClassSystem"]
  371.     actor_id = $game_party.members[actor_id.abs].id if actor_id <= 0
  372.     actor = $game_actors[actor_id]
  373.     return "" if actor.nil?
  374.     return "" if actor.subclass.nil?
  375.     return actor.subclass.name
  376.   end
  377.  
  378.   #--------------------------------------------------------------------------
  379.   # new method: escape_actor_nickname
  380.   #--------------------------------------------------------------------------
  381.   def escape_actor_nickname(actor_id)
  382.     actor_id = $game_party.members[actor_id.abs].id if actor_id <= 0
  383.     actor = $game_actors[actor_id]
  384.     return "" if actor.nil?
  385.     return actor.nickname
  386.   end
  387.  
  388.   #--------------------------------------------------------------------------
  389.   # new method: escape_icon_item
  390.   #--------------------------------------------------------------------------
  391.   def escape_icon_item(data_id, type)
  392.     case type
  393.     when :class
  394.       return "" unless $imported["YEA-ClassSystem"]
  395.       icon = $data_classes[data_id].icon_index
  396.       name = $data_items[data_id].name
  397.     when :item
  398.       icon = $data_items[data_id].icon_index
  399.       name = $data_items[data_id].name
  400.     when :weapon
  401.       icon = $data_weapons[data_id].icon_index
  402.       name = $data_weapons[data_id].name
  403.     when :armour
  404.       icon = $data_armors[data_id].icon_index
  405.       name = $data_armors[data_id].name
  406.     when :skill
  407.       icon = $data_skills[data_id].icon_index
  408.       name = $data_skills[data_id].name
  409.     when :state
  410.       icon = $data_states[data_id].icon_index
  411.       name = $data_states[data_id].name
  412.     else; return ""
  413.     end
  414.     text = "\eI[#{icon}]" + name
  415.     return text
  416.   end
  417.  
  418.   #--------------------------------------------------------------------------
  419.   # alias method: process_escape_character
  420.   #--------------------------------------------------------------------------
  421.   alias window_base_process_escape_character_ams process_escape_character
  422.   def process_escape_character(code, text, pos)
  423.     case code.upcase
  424.     #---
  425.     when 'FZ'
  426.       contents.font.size = obtain_escape_param(text)
  427.     when 'FN'
  428.       text.sub!(/\[(.*?)\]/, "")
  429.       font_name = $1.to_s
  430.       font_name = Font.default_name if font_name.nil?
  431.       contents.font.name = font_name.to_s
  432.     #---
  433.     when 'OC'
  434.       colour = text_color(obtain_escape_param(text))
  435.       contents.font.out_color = colour
  436.     when 'OO'
  437.       contents.font.out_color.alpha = obtain_escape_param(text)
  438.     #---
  439.     when 'AMSF'
  440.       case obtain_escape_param(text)
  441.       when 0; reset_font_settings
  442.       when 1; contents.font.bold = !contents.font.bold
  443.       when 2; contents.font.italic = !contents.font.italic
  444.       when 3; contents.font.outline = !contents.font.outline
  445.       when 4; contents.font.shadow = !contents.font.shadow
  446.       end
  447.     #---
  448.     when 'PX'
  449.       pos[:x] = obtain_escape_param(text)
  450.     when 'PY'
  451.       pos[:y] = obtain_escape_param(text)
  452.     #---
  453.     when 'PIC'
  454.       text.sub!(/\[(.*?)\]/, "")
  455.       bmp = Cache.picture($1.to_s)
  456.       rect = Rect.new(0, 0, bmp.width, bmp.height)
  457.       contents.blt(pos[:x], pos[:y], bmp, rect)
  458.     #---
  459.     else
  460.       window_base_process_escape_character_ams(code, text, pos)
  461.     end
  462.   end
  463.  
  464. end # Window_Base
  465.  
  466. #==============================================================================
  467. # ■ Window_ChoiceList
  468. #==============================================================================
  469.  
  470. class Window_ChoiceList < Window_Command
  471.  
  472.   #--------------------------------------------------------------------------
  473.   # alias method: initialize
  474.   #--------------------------------------------------------------------------
  475.   alias window_choicelist_initialize_ams initialize
  476.   def initialize(message_window)
  477.     window_choicelist_initialize_ams(message_window)
  478.     setup_message_font
  479.   end
  480.  
  481. end # Window_ChoiceList
  482.  
  483. #==============================================================================
  484. # ■ Window_ScrollText
  485. #==============================================================================
  486.  
  487. class Window_ScrollText < Window_Base
  488.  
  489.   #--------------------------------------------------------------------------
  490.   # alias method: initialize
  491.   #--------------------------------------------------------------------------
  492.   alias window_scrolltext_initialize_ams initialize
  493.   def initialize
  494.     window_scrolltext_initialize_ams
  495.     setup_message_font
  496.   end
  497.  
  498. end # Window_ScrollText
  499.  
  500. #==============================================================================
  501. # ■ Window_NameMessage
  502. #==============================================================================
  503.  
  504. class Window_NameMessage < Window_Base
  505.  
  506.   #--------------------------------------------------------------------------
  507.   # initialize
  508.   #--------------------------------------------------------------------------
  509.   def initialize(message_window)
  510.     @message_window = message_window
  511.     super(0, 0, Graphics.width, fitting_height(1))
  512.     self.opacity = YEA::MESSAGE::NAME_WINDOW_OPACITY
  513.     self.z = @message_window.z + 1
  514.     self.openness = 0
  515.     setup_message_font
  516.     @close_counter = 0
  517.     deactivate
  518.   end
  519.  
  520.   #--------------------------------------------------------------------------
  521.   # update
  522.   #--------------------------------------------------------------------------
  523.   def update
  524.     super
  525.     return if self.active
  526.     return if self.openness == 0
  527.     return if @closing
  528.     @close_counter -= 1
  529.     return if @close_counter > 0
  530.     close
  531.   end
  532.  
  533.   #--------------------------------------------------------------------------
  534.   # start_close
  535.   #--------------------------------------------------------------------------
  536.   def start_close
  537.     @close_counter = 4
  538.     deactivate
  539.   end
  540.  
  541.   #--------------------------------------------------------------------------
  542.   # force_close
  543.   #--------------------------------------------------------------------------
  544.   def force_close
  545.     @close_counter = 0
  546.     deactivate
  547.     close
  548.   end
  549.  
  550.   #--------------------------------------------------------------------------
  551.   # start
  552.   #--------------------------------------------------------------------------
  553.   def start(text, x_position)
  554.     @text = text.clone
  555.     set_width
  556.     create_contents
  557.     set_x_position(x_position)
  558.     set_y_position
  559.     refresh
  560.     activate
  561.     open
  562.   end
  563.  
  564.   #--------------------------------------------------------------------------
  565.   # set_width
  566.   #--------------------------------------------------------------------------
  567.   def set_width
  568.     text = @text.clone
  569.     dw = standard_padding * 2 + text_size(text).width
  570.     dw += YEA::MESSAGE::NAME_WINDOW_PADDING * 2
  571.     dw += calculate_size(text.slice!(0, 1), text) until text.empty?
  572.     self.width = dw
  573.   end
  574.  
  575.   #--------------------------------------------------------------------------
  576.   # calculate_size
  577.   #--------------------------------------------------------------------------
  578.   def calculate_size(code, text)
  579.     case code
  580.     when "\e"
  581.       return calculate_escape_code_width(obtain_escape_code(text), text)
  582.     else
  583.       return 0
  584.     end
  585.   end
  586.  
  587.   #--------------------------------------------------------------------------
  588.   # calculate_escape_code_width
  589.   #--------------------------------------------------------------------------
  590.   def calculate_escape_code_width(code, text)
  591.     dw = -text_size("\e").width - text_size(code).width
  592.     case code.upcase
  593.     when 'C', 'OC', 'OO'
  594.       dw += -text_size("[" + obtain_escape_param(text).to_s + "]").width
  595.       return dw
  596.     when 'I'
  597.       dw += -text_size("[" + obtain_escape_param(text).to_s + "]").width
  598.       dw += 24
  599.       return dw
  600.     when '{'
  601.       make_font_bigger
  602.     when '}'
  603.       make_font_smaller
  604.     when 'FZ'
  605.       contents.font.size = obtain_escape_param(text)
  606.     when 'FN'
  607.       text.sub!(/\[(.*?)\]/, "")
  608.       font_name = $1.to_s
  609.       font_name = Font.default_name if font_name.nil?
  610.       contents.font.name = font_name.to_s
  611.     when 'AMSF'
  612.       case obtain_escape_param(text)
  613.       when 0; reset_font_settings
  614.       when 1; contents.font.bold = !contents.font.bold
  615.       when 2; contents.font.italic = !contents.font.italic
  616.       when 3; contents.font.outline = !contents.font.outline
  617.       when 4; contents.font.shadow = !contents.font.shadow
  618.       end
  619.     else
  620.       return dw
  621.     end
  622.   end
  623.  
  624.   #--------------------------------------------------------------------------
  625.   # set_y_position
  626.   #--------------------------------------------------------------------------
  627.   def set_x_position(x_position)
  628.     case x_position
  629.     when 1 # Left
  630.       self.x = @message_window.x
  631.       self.x += YEA::MESSAGE::NAME_WINDOW_X_BUFFER
  632.     when 2 # 3/10
  633.       self.x = @message_window.x
  634.       self.x += @message_window.width * 3 / 10
  635.       self.x -= self.width / 2
  636.     when 3 # Center
  637.       self.x = @message_window.x
  638.       self.x += @message_window.width / 2
  639.       self.x -= self.width / 2
  640.     when 4 # 7/10
  641.       self.x = @message_window.x
  642.       self.x += @message_window.width * 7 / 10
  643.       self.x -= self.width / 2
  644.     when 5 # Right
  645.       self.x = @message_window.x + @message_window.width
  646.       self.x -= self.width
  647.       self.x -= YEA::MESSAGE::NAME_WINDOW_X_BUFFER
  648.     end
  649.     self.x = [[self.x, Graphics.width - self.width].min, 0].max
  650.   end
  651.  
  652.   #--------------------------------------------------------------------------
  653.   # set_y_position
  654.   #--------------------------------------------------------------------------
  655.   def set_y_position
  656.     case $game_message.position
  657.     when 0
  658.       self.y = @message_window.height
  659.       self.y -= YEA::MESSAGE::NAME_WINDOW_Y_BUFFER
  660.     else
  661.       self.y = @message_window.y - self.height
  662.       self.y += YEA::MESSAGE::NAME_WINDOW_Y_BUFFER
  663.     end
  664.   end
  665.  
  666.   #--------------------------------------------------------------------------
  667.   # refresh
  668.   #--------------------------------------------------------------------------
  669.   def refresh
  670.     contents.clear
  671.     reset_font_settings
  672.     @text = sprintf("\eC[%d]%s", YEA::MESSAGE::NAME_WINDOW_COLOUR, @text)
  673.     draw_text_ex(YEA::MESSAGE::NAME_WINDOW_PADDING, 0, @text)
  674.   end
  675.  
  676. end # Window_NameMessage
  677.  
  678. #==============================================================================
  679. # ■ Window_Message
  680. #==============================================================================
  681.  
  682. class Window_Message < Window_Base
  683.  
  684.   #--------------------------------------------------------------------------
  685.   # alias method: initialize
  686.   #--------------------------------------------------------------------------
  687.   alias window_message_initialize_ams initialize
  688.   def initialize
  689.     window_message_initialize_ams
  690.     setup_message_font
  691.   end
  692.  
  693.   #--------------------------------------------------------------------------
  694.   # overwrite method: window_width
  695.   #--------------------------------------------------------------------------
  696.   def window_width
  697.     return Variable.message_width
  698.   end
  699.  
  700.   #--------------------------------------------------------------------------
  701.   # overwrite method: window_height
  702.   #--------------------------------------------------------------------------
  703.   def window_height
  704.     return fitting_height(Variable.message_rows)
  705.   end
  706.  
  707.   #--------------------------------------------------------------------------
  708.   # alias method: create_all_windows
  709.   #--------------------------------------------------------------------------
  710.   alias window_message_create_all_windows_ams create_all_windows
  711.   def create_all_windows
  712.     window_message_create_all_windows_ams
  713.     @name_window = Window_NameMessage.new(self)
  714.   end
  715.  
  716.   #--------------------------------------------------------------------------
  717.   # overwrite method: create_back_bitmap
  718.   #--------------------------------------------------------------------------
  719.   def create_back_bitmap
  720.     @back_bitmap = Bitmap.new(width, height)
  721.     rect1 = Rect.new(0, 0, Graphics.width, 12)
  722.     rect2 = Rect.new(0, 12, Graphics.width, fitting_height(4) - 24)
  723.     rect3 = Rect.new(0, fitting_height(4) - 12, Graphics.width, 12)
  724.     @back_bitmap.gradient_fill_rect(rect1, back_color2, back_color1, true)
  725.     @back_bitmap.fill_rect(rect2, back_color1)
  726.     @back_bitmap.gradient_fill_rect(rect3, back_color1, back_color2, true)
  727.   end
  728.  
  729.   #--------------------------------------------------------------------------
  730.   # alias method: dispose_all_windows
  731.   #--------------------------------------------------------------------------
  732.   alias window_message_dispose_all_windows_ams dispose_all_windows
  733.   def dispose_all_windows
  734.     window_message_dispose_all_windows_ams
  735.     @name_window.dispose
  736.   end
  737.  
  738.   #--------------------------------------------------------------------------
  739.   # alias method: update_all_windows
  740.   #--------------------------------------------------------------------------
  741.   alias window_message_update_all_windows_ams update_all_windows
  742.   def update_all_windows
  743.     window_message_update_all_windows_ams
  744.     @name_window.update
  745.     @name_window.back_opacity = self.back_opacity
  746.     @name_window.opacity = self.opacity
  747.   end
  748.  
  749.   #--------------------------------------------------------------------------
  750.   # alias method: update_show_fast
  751.   #--------------------------------------------------------------------------
  752.   alias window_message_update_show_fast_ams update_show_fast
  753.   def update_show_fast
  754.     @show_fast = true if Input.press?(YEA::MESSAGE::TEXT_SKIP)
  755.     window_message_update_show_fast_ams
  756.   end
  757.  
  758.   #--------------------------------------------------------------------------
  759.   # overwrite method: input_pause
  760.   #--------------------------------------------------------------------------
  761.   def input_pause
  762.     self.pause = true
  763.     wait(10)
  764.     Fiber.yield until Input.trigger?(:B) || Input.trigger?(:C) ||
  765.       Input.press?(YEA::MESSAGE::TEXT_SKIP)
  766.     Input.update
  767.     self.pause = false
  768.   end
  769.  
  770.   #--------------------------------------------------------------------------
  771.   # overwrite method: convert_escape_characters
  772.   #--------------------------------------------------------------------------
  773.   def convert_escape_characters(text)
  774.     result = super(text.to_s.clone)
  775.     result = namebox_escape_characters(result)
  776.     result = message_escape_characters(result)
  777.     return result
  778.   end
  779.  
  780.   #--------------------------------------------------------------------------
  781.   # new method: namebox_escape_characters
  782.   #--------------------------------------------------------------------------
  783.   def namebox_escape_characters(result)
  784.     result.gsub!(/\eN\<(.+?)\>/i)  { namewindow($1, 1) }
  785.     result.gsub!(/\eN1\<(.+?)\>/i) { namewindow($1, 1) }
  786.     result.gsub!(/\eN2\<(.+?)\>/i) { namewindow($1, 2) }
  787.     result.gsub!(/\eNC\<(.+?)\>/i) { namewindow($1, 3) }
  788.     result.gsub!(/\eN3\<(.+?)\>/i) { namewindow($1, 3) }
  789.     result.gsub!(/\eN4\<(.+?)\>/i) { namewindow($1, 4) }
  790.     result.gsub!(/\eN5\<(.+?)\>/i) { namewindow($1, 5) }
  791.     result.gsub!(/\eNR\<(.+?)\>/i) { namewindow($1, 5) }
  792.     return result
  793.   end
  794.  
  795.   #--------------------------------------------------------------------------
  796.   # new method: namebox
  797.   #--------------------------------------------------------------------------
  798.   def namewindow(text, position)
  799.     @name_text = text
  800.     @name_position = position
  801.     return ""
  802.   end
  803.  
  804.   #--------------------------------------------------------------------------
  805.   # new method: message_escape_characters
  806.   #--------------------------------------------------------------------------
  807.   def message_escape_characters(result)
  808.     result.gsub!(/\eAF\[(-?\d+)]/i) { change_face($1.to_i) }
  809.     return result
  810.   end
  811.  
  812.   #--------------------------------------------------------------------------
  813.   # new method: change_face
  814.   #--------------------------------------------------------------------------
  815.   def change_face(actor_id)
  816.     actor_id = $game_party.members[actor_id.abs].id if actor_id <= 0
  817.     actor = $game_actors[actor_id]
  818.     return "" if actor.nil?
  819.     $game_message.face_name = actor.face_name
  820.     $game_message.face_index = actor.face_index
  821.     return ""
  822.   end
  823.  
  824.   #--------------------------------------------------------------------------
  825.   # alias method: new_page
  826.   #--------------------------------------------------------------------------
  827.   alias window_message_new_page_ams new_page
  828.   def new_page(text, pos)
  829.     adjust_message_window_size
  830.     window_message_new_page_ams(text, pos)
  831.   end
  832.  
  833.   #--------------------------------------------------------------------------
  834.   # overwrite method: new_line_x
  835.   #--------------------------------------------------------------------------
  836.   def new_line_x
  837.     return $game_message.face_name.empty? ? 0 : YEA::MESSAGE::FACE_INDENT_X
  838.   end
  839.  
  840.   #--------------------------------------------------------------------------
  841.   # new method: adjust_message_window_size
  842.   #--------------------------------------------------------------------------
  843.   def adjust_message_window_size
  844.     self.height = window_height
  845.     self.width = window_width
  846.     create_contents
  847.     update_placement
  848.     self.x = (Graphics.width - self.width) / 2
  849.     start_name_window
  850.   end
  851.  
  852.   #--------------------------------------------------------------------------
  853.   # new method: clear_name_window
  854.   #--------------------------------------------------------------------------
  855.   def clear_name_window
  856.     @name_text = ""
  857.     @name_position = 0
  858.   end
  859.  
  860.   #--------------------------------------------------------------------------
  861.   # new method: start_name_window
  862.   #--------------------------------------------------------------------------
  863.   def start_name_window
  864.     return if @name_text == ""
  865.     @name_window.start(@name_text, @name_position)
  866.   end
  867.  
  868.   #--------------------------------------------------------------------------
  869.   # overwrite method: fiber_main
  870.   #--------------------------------------------------------------------------
  871.   def fiber_main
  872.     $game_message.visible = true
  873.     update_background
  874.     update_placement
  875.     loop do
  876.       process_all_text if $game_message.has_text?
  877.       process_input
  878.       $game_message.clear
  879.       @gold_window.close
  880.       @name_window.start_close
  881.       Fiber.yield
  882.       break unless text_continue?
  883.     end
  884.     close_and_wait
  885.     $game_message.visible = false
  886.     @fiber = nil
  887.   end
  888.  
  889.   #--------------------------------------------------------------------------
  890.   # alias method: open_and_wait
  891.   #--------------------------------------------------------------------------
  892.   alias window_message_open_and_wait_ams open_and_wait
  893.   def open_and_wait
  894.     clear_name_window
  895.     adjust_message_window_size
  896.     window_message_open_and_wait_ams
  897.   end
  898.  
  899.   #--------------------------------------------------------------------------
  900.   # alias method: close_and_wait
  901.   #--------------------------------------------------------------------------
  902.   alias window_message_close_and_wait_ams close_and_wait
  903.   def close_and_wait
  904.     @name_window.force_close
  905.     window_message_close_and_wait_ams
  906.   end
  907.  
  908.   #--------------------------------------------------------------------------
  909.   # alias method: all_close?
  910.   #--------------------------------------------------------------------------
  911.   alias window_message_all_close_ams all_close?
  912.   def all_close?
  913.     return window_message_all_close_ams && @name_window.close?
  914.   end
  915.  
  916.   #--------------------------------------------------------------------------
  917.   # alias method: process_escape_character
  918.   #--------------------------------------------------------------------------
  919.   alias window_message_process_escape_character_ams process_escape_character
  920.   def process_escape_character(code, text, pos)
  921.     case code.upcase
  922.     when 'W' # Wait
  923.       wait(obtain_escape_param(text))
  924.     else
  925.       window_message_process_escape_character_ams(code, text, pos)
  926.     end
  927.   end
  928.  
  929. end # Window_Message
  930.  
  931. #==============================================================================
  932. #
  933. # ▼ End of File
  934. #
  935. #==============================================================================








=begin
#==============================================================================
* 闲谈对话框 (Yami 气泡对话框 的插件) - v1.3c
  作者: Quack
  翻译:nil2018(○┰○)
#==============================================================================
效果:
1-允许你使用"闲谈对话框。和默认对话框区别为,闲谈对话框不会暂停游戏,也不会因为
  玩家按下任何按键而关闭,取而代之的是为对话框设定一个计时器,时间到了会自动将
  其关闭。还有一个特点是:可以同时显示多个闲谈对话框(有最大显示数量限制,默认
  为7,你可以在下面的"MAX_MSGS"中调整最大数)
  
  将普通对话框“变成”闲谈对话框的方法为:在对话框中填入标志:'<cm:X>'
  其中X为显示的时间,单位为秒(注意:这个标志必须放在对话框的第一行!!)
  将X设定为负值时,对话框就不会消失了。你可以使用脚本来关闭所有闲谈对话框:
  clear_chatter
  
2-说话的气泡标志(bubble message)和原来一样,都是: \bm[x]
  新添加了思考(bubble message thought)的气泡标志:  \bmt[x]
  
3-气泡对话框可以在战斗中使用了。可以使用 \bm[x] 或 \bmt[x] 来显示气泡对话框。to show a pop message.
  如果你要在敌人头上显示气泡对话框,请将x替换为负值.
  在战斗中:    \bm[1] 显示在1号敌人头上
                \bm[-1] 显示在1号角色头上
  对于1号敌人,使用 \bm[1] ,4号敌人则使用 \bm[4]
  同时,对于角色: 1号角色 = \bm[-1]
  
  然而,要想在战斗中在角色头上显示气泡对话框,需要你使用“显示角色战斗图”的
  脚本。我不能保证我的脚本适用于所有该功能的脚本。但我可以保证和Jet's sideview
  battlers 相兼容。
  
  有一个问题是,当战斗图的大小过大或过小时,对话框窗口会有些移位。
  使用以下标志来调整对话框的位置:
  \ox[X] - 调整气泡对话框的x坐标
  \oy[X] - 调整气泡对话框的y坐标
  
  有一点需要注意的是,如果你还使用了Yanfly的核心脚本&Yanfly的文本系统,你需要将
  核心脚本中的 FONT_NAME 和文本系统的i MESSAGE_WINDOW_FONT_NAME 设定相匹配(两
  个地方都要设定相同的字体)否则两个脚本的设定结合起来,有时会使文本的宽度计算
  错误。这个问题不大,可是在气泡对话框中,会改变气泡对话框的窗口宽度,这就是个
  大问题了(yanfly两个脚本中,关于字体的其他设定例如是否加粗是否斜体等,也最好
  设定得一模一样)
  
版本 1.1 更新功能:

1-添加文本打字音效,你可以在 TEXT_SOUNDS 的哈希表中设定(在下面查看更多地介绍)
  使用标志:
  <ts:x>   文章打字音x,x为存在于 TEXT_SOUNDS 哈希表中的打字音效名字.
  
2-添加对话框背景色调的功能。你可以在 WINDOW_TONES 哈希表中预设色调种类
  使用标志: <bc:x> ,其中x为存在于 WINDOW_TONES 哈希表中的色调名字.

3-有时,你需要在同一个对话框中显示不同的字体,可能会使对话框变得过大或过小。Sometimes you might want to change font size in your message, multiple times,
  使用标志: <pms:x,y> 可以调整气泡对话框的大小.x为宽度变化,y为高度变化
  例如,你使用了标志<pms:20,-10> ,则对话框的宽度会增加20,高度会减少10.
  
4-如果你和我一样,被记忆事件id、书写一大堆标志而困扰,以下功能会帮到你。
  
  仅使用一个标志<bt:x> (对于谈话气泡) 或 <btt:x> (对于思考气泡)
  就可以让该事件使用你设定的背景颜色和文本打字音效。
  
  那原理是什么?
  举个例子,我有一个作为队伍角色的事件,她叫Emil.在事件名中填入了标志: <emil>.
  然后,当我使用了标志: <bt:emil> 或 <btt:emil> 气泡对话框会自动显示到该事件的
  头上(如果有多个事件名为<emil>的事件,也会只显示一个对话框),且使用
  WINDOW_TONES 中的'emil'作为窗口色调,使用TEXT_SOUNDS中的'emil'作为文本打字音效
  但不能用于btt,因为思考中还会有打字音效不是太奇怪了吗?
  
  
  这也会在你检查事件时,更清楚地明白哪个事件是'emil',而不是去找哪个事件是某某id
  
  如果你想指定用于角色(player) 的话,使用标志'pl',例如:
  <bt:pl>
  这样就可以使设定窗口色调和打字音效的"打包"设定同时应用于角色了。
  或许在队员变化大的情况下不怎么实用,但是我仍然添加了此功能。
  
  如果你很好奇为什么我新添加的标志和以前的不一样...因为!Consistence is overrated
  anyway, who needs it?  (0.0)
  
  使用标志(<bt:x> & <btt:x>) 需要你安装脚本 Qonvenience (你也许会叫它做
  我的'核心' 脚本,类似其他人的 (Yanfly,
  Victor, Yami, etc).
  你可以在下面的'使用条件'部分找到下载地址.
  
版本 1.2 更新功能:

- 显示选项时,会根据你使用的是气泡对话框还是普通的对话框而显示不同的样子。
  使用默认对话框时,选项的外貌不变。使用气泡对话框时选项会变得更大,且显示在对
  话框窗口中.
  
版本 1.3更新功能:

- 修复了一些肖像图和名称窗口的问题。问题并没有完全解决,因为我自己的工程里并
没有使用名称窗口或肖像图,所以本人并不是很感兴趣去花时间到这些地方。
  
-和窗口色调、打字音效一样,你现在可以使用标志来显示名称窗口了。
  
==============================================================================
安装注释:
需要脚本 Yami气泡对话框.
将本脚本放在其之下.

==============================================================================
使用条件:
需要Yami气泡对话框脚本,你可以在这里下载:
​https://github.com/suppayami/rmvxa-collection/blob/master/yami-script-ace/10%20-%20Pop%20Message.txt
同时还需要我的 Qonvenience脚本 ,如果你想使用:<bt:x> 和 <btt:x>的话
在这里下载:
http://pastebin.com/J6haUy5T

==============================================================================
Credits:
Yami 为 气泡对话框的作者.

==============================================================================
使用条款:
随意使用(没错,包括商业游戏),只要你不声明这个脚本是你自己写的。
同时我也希望你能在使用此脚本时,属名我为脚本的作者。
请记住本脚本必须和Yami的气泡对话框同时使用,其也有自己的使用条款.

==============================================================================
Bugs:
不懂

==============================================================================
History:
11/10/2016 - Fixed some problems added some minor feature.
19/01/2016 - Fixed some bugs, changes to choices when a pop message is used.
14/01/2016 - Chatter messages now last forever if you set the duration to a
             negative number. Also added method for clearing all chatter
             to use in script calls. Also squashed some bugs.
13/01/2016 - Pretty big update. Added more functionality.
10/01/2016 - Proper release since Absurdiness found the original script so I
             could separate the addon from the original.
08/01/2016 - Initial release

=end

$imported = {} if $imported.nil?
$imported["Chatter_Messages"] = true

#==============================================================================
# * 设定
#==============================================================================

module YSE
  module POP_MESSAGE
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - 视觉设定 -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
   
    EFFECT2 = { # 开始.
      :bubble_tag_name => "BubbleTag_Speech",
      :thought_bubble_tag_name => "BubbleTag_Thought",
    } # 结束.
  end
end

module QUACK
  module MSG
   
    # 闲谈窗口同时显示的最大数量。
    # 太少会限制了你的选择,太多会使画面杂乱。
    MAX_MSGS = 7
   
    # 在这里设定窗口颜色。
    # 格式:
    # '名称' => Tone.new(红,绿,蓝,灰度)
    # 名称为字符,红绿蓝为数字,范围是 -255~255
    # 灰度的范围是 0 到 255. 灰度为可选值,不一定非要写。
    WINDOW_TONES = {
      #在下面手动添加设定
      '偏红' => Tone.new(85,44,51),
      '杰克' => Tone.new(-34,85,102),
      '狂人' => Tone.new(68,68,68,10),
      '普尔' => Tone.new(102,34,-34),
      '爱丽丝' => Tone.new(102,34,51),
      # 自己设定更多的
    }
   
    # 在这里设定文本打字音效
    # 格式:
    # '名称' => ["文件名",音量, 最低音调, 最高音调],
    # 名称为字符,文件名为音效文件名where Key is a string. Sound is the name of your sound,
    # 音量音调为数字,范围是 0-100.
    TEXT_SOUNDS = {
      #在下面手动添加设定
      '0' => nil, # 无任何打字音效的默认值!
      '1' => ["Cursor1", 80, 70, 100],
      '2' => ["Cursor1", 80, 90, 120],
      '3' => ["Knock", 80, 50, 75],
      '杰克' => ["Cursor1", 80, 90, 120],
      '狂人' => ["Cursor1", 80, 45, 70],
      '普尔' => ["Cursor1", 80, 70, 100],
      '爱丽丝' => ["Cursor1", 70, 110, 140],
      # And above this line
    }
   
    NAMES = {
      # 设定名称
      '1' => "冒险家杰克",
      '2' => "疯狂实验员"
    }
   
    # 每X个字符播放一次打字音效.
    SOUND_PLAY_FREQUENCY = 3
   
    # 气泡对话框是否在使用选项时随着文本显示而逐渐增大,还是立刻显示为最大尺寸
    POP_CHOICE_GROW = true
   
  end
end

#==============================================================================
# * SCRIPT START
#==============================================================================

#==============================================================================
# ?! DataManager
#==============================================================================
module DataManager
  class << self
    alias quack_msg_create_game_objects create_game_objects
    def create_game_objects
      quack_msg_create_game_objects
      if !$imported["YSE-PopMessage"]
        msgbox(sprintf("This script(Chatter Messages) requires Yami's Pop Messages to function", "ChatterMessages", 1))
        exit
      end
      $game_message.quack_msg_make
    end
  end
end

#==============================================================================
# ?! Game_Message
#==============================================================================
class Game_Message
  attr_accessor :quack_msgs
  attr_accessor :ev_id
  
  # new
  def quack_msg_make
    @quack_msgs = []
    QUACK::MSG::MAX_MSGS.times {@quack_msgs.push(Game_Message.new)}
    @quack_msg_ttl = 0
    @c_msg = 0
  end
  # new
  def set_ttl(ttl)
    @quack_msg_ttl = ttl
  end
  # new
  def ttl_sub
    @quack_msg_ttl -= 1 if @quack_msg_ttl > 0
  end
  # new
  def expire?
    return false if @quack_msg_ttl < 0
    @quack_msg_ttl == 0
  end
  # new
  def prepare_msg(duration)
    @quack_msg_ttl = (duration * 60).to_i
  end
  # new
  def fin_msg
    @quack_msg_ttl = 0
    @c_msg = (@c_msg + 1) % QUACK::MSG::MAX_MSGS
  end
  # new
  def add_chatter(text)
    m = @quack_msgs[@c_msg]
    m.add(text)
    m.face_name = face_name
    m.face_index = face_index
    m.set_ttl(@quack_msg_ttl)
  end
  # new
  def clear_chatter
    @quack_msgs.each {|m| m.set_ttl(0) }
  end
  
  # new
  def clear_chatter_event(e)
    # Find any chatter attached to certain event id and close the chatter
    @quack_msgs.each {|m| m.set_ttl(0) if m.ev_id == e }
  end
end

#==============================================================================
# ?! Window_Message
#==============================================================================

class Window_Message < Window_Base
  
  # new
  def chatter?
    false
  end
  # new
  def source
    $game_message
  end
  # overwrite
  def standard_padding
    return 8
  end
  # alias
  alias quack_chatter_init initialize
  def initialize
    @msg_tone = $game_system.window_tone
    @snd_f = 0
    #@name_text = ""
    quack_chatter_init
  end
  # new
  def speech_bubble_tag=(sprite)
    @speech_bubble_tag = sprite
  end
  # new
  def thought_bubble_tag=(sprite)
    @thought_bubble_tag = sprite
  end
  # new
  def set_offset_x(x)
    @ox = x
    return ""
  end
  # new
  def set_offset_y(y)
    @oy = y
    return ""
  end
  # overwrite
  def cal_width_line(text)
    result = 0
    text.each_line { |line|
      result = text_size(line).width if result < text_size(line).width
    }
    return result
  end
  # alias
  alias quack_chatter_process_character process_character
  def process_character(c, text, pos)
    if @snd_f == 0 && !@show_fast && !@text_sound.nil?
      Audio.se_play("Audio/SE/"+@text_sound[0],@text_sound[1],@text_sound[2]+rand(@text_sound[3]-@text_sound[2]))
    end
    @snd_f += 1
    @snd_f = 0 if @snd_f == QUACK::MSG::SOUND_PLAY_FREQUENCY
    quack_chatter_process_character(c,text,pos)
  end
  # overwrite
  def update_tone
    self.tone.set(@msg_tone)
  end
  # overwrite
  def message_escape_characters_pop_message(result)
    @msg_tone = $game_system.window_tone
    @event_pop_id = nil
    set_offset_x(0)
    set_offset_y(0)
    @text_sound = QUACK::MSG::TEXT_SOUNDS['0']
    @msg_size_x = 0
    @msg_size_y = 0
    reset_font_settings
   
    result.gsub!(/<BT:([^<>]*)>/i) { event_pop_message_setup2($1, false) }
    result.gsub!(/<BTT:([^<>]*)>/i) { event_pop_message_setup2($1, true) }
    result.gsub!(/\eOX\[([-+]?\d+)\]/i) { set_offset_x($1.to_i) }
    result.gsub!(/\eOY\[([-+]?\d+)\]/i) { set_offset_y($1.to_i) }
    result.gsub!(/\eBM\[([-+]?\d+)\]/i) { event_pop_message_setup($1.to_i, false) }
    result.gsub!(/\eBMT\[([-+]?\d+)\]/i) { event_pop_message_setup($1.to_i, true) }
    result.gsub!(/\eBMF\[(\d+)\]/i) { event_pop_message_setup($1.to_i, false, true) }
    result.gsub!(/\eCBM/i) { event_pop_message_setup(nil, false) }
    result.gsub!(/<BC:([^<>]*)>/i) { @msg_tone = QUACK::MSG::WINDOW_TONES[$1] ;""}
    result.gsub!(/<TS:([^<>]*)>/i) { @text_sound = QUACK::MSG::TEXT_SOUNDS[$1]; ""}
    result.gsub!(/<PMS:([-+]?\d+),([-+]?\d+)>/i) { @msg_size_x = $1.to_i ;@msg_size_y = $2.to_i; ""}
    result
  end
  # new
  def event_pop_message_setup2(tag, thought = false)
    if SceneManager.scene_is?(Scene_Battle)
      if tag.include?('act')
        ev_id = tag[3].to_i
        ev_id = (1+$game_party.members.index($game_actors[ev_id])) * -1
        @msg_tone = QUACK::MSG::WINDOW_TONES[tag] if QUACK::MSG::WINDOW_TONES.has_key?(tag)
        @text_sound = QUACK::MSG::TEXT_SOUNDS[tag] if !thought && QUACK::MSG::TEXT_SOUNDS.has_key?(tag)
      else
        msgbox(sprintf("无任何事件使用标志: '" + tag + "'.","Chatter Messages",1))
      end
      return event_pop_message_setup(ev_id, thought)
    end
    msgbox(sprintf("使用此标志需要你安装Qonvenience.","Chatter Messages",1)) if !$imported["Qonvenience"]
    if tag == 'pl'
      ev_id = 0
    else
      ev_id = $game_map.first_event_tag(tag).id
      msgbox(sprintf("无任何事件使用标志: '" + tag + "'.","Chatter Messages",1)) if ev_id.nil?
    end
    @msg_tone = QUACK::MSG::WINDOW_TONES[tag] if QUACK::MSG::WINDOW_TONES.has_key?(tag)
    @text_sound = QUACK::MSG::TEXT_SOUNDS[tag] if !thought && QUACK::MSG::TEXT_SOUNDS.has_key?(tag)
    namewindow(QUACK::MSG::NAMES[tag], 1) if $imported["YEA-MessageSystem"] && QUACK::MSG::NAMES.has_key?(tag) && @name_text == ""
    return event_pop_message_setup(ev_id, thought)
  end
  # overwrite
  def event_pop_message_setup(event_id, thought = false, follower = false)
    start_name_window if $imported["YEA-MessageSystem"]
    if follower && $game_player.followers[event_id].nil?
      @event_pop_id = nil
      @event_pop_follower = false
      return ""
    end
    if thought # THOUGHT
      @speech_bubble_tag.visible = false
      @bubble_tag = @thought_bubble_tag
    else # SPEECH
      @thought_bubble_tag.visible = false
      @bubble_tag = @speech_bubble_tag
    end
    @event_pop_follower = follower
    @event_pop_id = event_id
    # close any chatter message currently attached to this event
    $game_message.clear_chatter_event(event_id)
    source.ev_id = event_id
    return ""
  end
  # overwrite
  def set_face_position
    #return unless SceneManager.scene_is?(Scene_Map)
    return unless @event_pop_id
    return unless @face_window
    contents.clear
    @face_window.set_face
    return unless $imported["YEA-MessageSystem"]
    return if @face_window.close?
    #@name_window.x = self.x + YSE::POP_MESSAGE::POSITION[:face_x_buffer] + YSE::POP_MESSAGE::POSITION[:name_x_buffer] if (@name_position == 1 || @name_position == 2)
  end
  # overwrite
  def close
    pop_message_close
    #return unless SceneManager.scene_is?(Scene_Map)
    return unless @event_pop_id
    @event_pop_follower = false
    @face_window.hide_face
    return unless YSE::POP_MESSAGE::EFFECT[:use_bubble_tag]
    @speech_bubble_tag.visible = false if @speech_bubble_tag
    @thought_bubble_tag.visible = false if @thought_bubble_tag
    source.ev_id = nil
  end
  # overwrite
  def process_all_text
    @event_pop_id = nil
    @name_text = ""
    txt = convert_escape_characters($game_message.all_text)
    update_placement
    adjust_pop_message(txt)#$game_message.all_text)
    pop_message_process_all_text
  end
  # overwrite
  def update_placement
    if SceneManager.scene_is?(Scene_Map)
      if @event_pop_id.nil?
        fix_default_message
        event_pop_message_update_placement
      elsif @event_pop_id == 0
        character = $game_player
        self.y = character.screen_y + @oy - self.height + YSE::POP_MESSAGE::POSITION[:y_buffer]
        self.x = character.screen_x + @ox - self.width / 2 + YSE::POP_MESSAGE::POSITION[:x_buffer]
        fix_position_bubble(character)
        set_bubble_tag(character)
        @name_window.update_pos if $imported["YEA-MessageSystem"] && @name_window.open?
        @face_window.set_position if !chatter? && @face_window.open?
      elsif @event_pop_id > 0
        hash = @event_pop_follower ? $game_player.followers : $game_map.events
        character = hash[@event_pop_id]
        self.y = character.screen_y + @oy - self.height + YSE::POP_MESSAGE::POSITION[:y_buffer]
        self.x = character.screen_x + @ox - self.width / 2 + YSE::POP_MESSAGE::POSITION[:x_buffer]
        fix_position_bubble(character)
        set_bubble_tag(character)
        @name_window.update_pos if $imported["YEA-MessageSystem"] && @name_window.open?
        @face_window.set_position if !chatter? && @face_window.open?
      end
    else
      # IF IN BATTLE
      #event_pop_message_update_placement
      if @event_pop_id.nil?
        fix_default_message
        event_pop_message_update_placement
      elsif @event_pop_id < 0
        battler = $game_party.members[(@event_pop_id * -1)-1]
        self.y = battler.screen_y + @oy - self.height + YSE::POP_MESSAGE::POSITION[:y_buffer]
        self.x = battler.screen_x + @ox - self.width / 2 + YSE::POP_MESSAGE::POSITION[:x_buffer]
        fix_position_bubble(battler)
        set_bubble_tag(battler)
        @name_window.update_pos if $imported["YEA-MessageSystem"] && @name_window.open?
        @face_window.set_position if !chatter? && @face_window.open?
      elsif @event_pop_id > 0
        battler = $game_troop.members[@event_pop_id-1]
        self.y = battler.screen_y + @oy - self.height + YSE::POP_MESSAGE::POSITION[:y_buffer]
        self.x = battler.screen_x + @ox - self.width / 2 + YSE::POP_MESSAGE::POSITION[:x_buffer]
        fix_position_bubble(battler)
        set_bubble_tag(battler)
        @name_window.update_pos if $imported["YEA-MessageSystem"] && @name_window.open?
        @face_window.set_position if !chatter? && @face_window.open?
      end
    end
  end
  # overwrite
  def fix_default_message
    self.width = window_width
    self.height = window_height
    self.x = 0
    @face_window.hide_face if @face_window
    #create_contents
    return unless YSE::POP_MESSAGE::EFFECT[:use_bubble_tag]
    @speech_bubble_tag.visible = false if @speech_bubble_tag
    @thought_bubble_tag.visible = false if @thought_bubble_tag
  end
  # overwrite
  def fix_position_bubble(character)
    end_x = self.x + self.width
    end_y = self.y + self.height
    self.x = 0 if self.x < 0
    self.y = character.screen_y + @oy if self.y < 0
    self.y = -99 if self.y < 0
    self.x = Graphics.width - self.width if end_x > Graphics.width
    self.y = Graphics.height - self.height if end_y > Graphics.height
  end
  # overwrite
  def set_bubble_tag(character)
    return unless YSE::POP_MESSAGE::EFFECT[:use_bubble_tag]
    return unless @bubble_tag
    up = self.y == character.screen_y + @oy
    if self.y == -99
      self.y = 0
      up = true
    end
    self.y += up ? @bubble_tag.height / 2 : -@bubble_tag.height / 2
    @bubble_tag.x = character.screen_x + @ox - @bubble_tag.width / 2
    if up
      @bubble_tag.src_rect.set(0, @bubble_tag.height, @bubble_tag.width, @bubble_tag.height)
      @bubble_tag.y = self.y - @bubble_tag.height - YSE::POP_MESSAGE::POSITION[:tag_y_buffer]
    else
      @bubble_tag.src_rect.set(0, 0, @bubble_tag.width, @bubble_tag.height)
      @bubble_tag.y = self.y + self.height + YSE::POP_MESSAGE::POSITION[:tag_y_buffer]
    end
    @bubble_tag.z = self.z + 1000
  end
  # overwrite
  def adjust_pop_message(text = " ")
    #return unless SceneManager.scene_is?(Scene_Map)
    unless @event_pop_id
      if $imported["YEA-MessageSystem"]
        #adjust_message_window_size
      end
      return
    end
    n_line = cal_number_line(text)
    n_line = YSE::POP_MESSAGE::LIMIT[:limit_line] if YSE::POP_MESSAGE::LIMIT[:limit_line] > 0 && cal_number_line(text) > YSE::POP_MESSAGE::LIMIT[:limit_line]
    @real_lines = n_line
    self.height = fitting_height(n_line)
    self.height += @msg_size_y
    self.width = cal_width_line(text) + 10
    self.width += @msg_size_x
    self.width += new_line_x
    if self.width > YSE::POP_MESSAGE::LIMIT[:limit_width] && YSE::POP_MESSAGE::LIMIT[:limit_width] > 0
      self.width = YSE::POP_MESSAGE::LIMIT[:limit_width]
    end
    if $game_message.choice? && !QUACK::MSG::POP_CHOICE_GROW
      dy = fitting_height($game_message.choices.size) - 16
      self.y -= dy - 16
      self.height += dy - 16
      @face_window.y -= dy - 16
      @name_window.y -= dy - 16 if $imported["YEA-MessageSystem"]
    end
    # If a chatter message with face graphic, force height to be at least big enough to show the face.
    if chatter? && !source.face_name.empty?
      self.height = [self.height, 86].max
    end
   
    create_contents
    update_placement
  end
  # alias
  alias yse_pop_dispose dispose
  def dispose
    @speech_bubble_tag.visible = false if @speech_bubble_tag
    @thought_bubble_tag.visible = false if @thought_bubble_tag
    yse_pop_dispose
  end
  # alias
  alias chatter_msg_input_choice input_choice
  def input_choice
    if !close? && pop_message? && QUACK::MSG::POP_CHOICE_GROW
      f = Fiber.new { add_room_for_choices }
      @choice_window.visible = false
      @choice_window.set_fiber(f)
      f.resume
    end
    chatter_msg_input_choice
  end
  # new
  def add_room_for_choices
    q = fitting_height($game_message.choices.size) - 16
    i = 0
    while true
      i += 4
      self.y -= 4
      self.height += 4
      @face_window.y -= 4
      @name_window.y -= 4 if $imported["YEA-MessageSystem"]
      break if i >= q
      Fiber.yield
    end
    @choice_window.visible = true
    @choice_window.set_fiber(nil)
  end
  # new
  def pop_message?
    @event_pop_id
  end
end

#==============================================================================
# ?! Window_ChoiceList
#==============================================================================
class Window_ChoiceList < Window_Command
  # alias
  alias chatter_msg_init initialize
  def initialize(message_window)
    chatter_msg_init(message_window)
    self.opacity = 0
    self.z = 20070
  end
  # new
  def set_fiber(fiber)
    @fiber = fiber
  end
  # alias
  alias chatter_msg_update update
  def update
    chatter_msg_update
    @fiber.resume if @fiber
  end
  # alias
  alias chatter_msg_update_placement update_placement
  def update_placement
    if @message_window.pop_message?
      self.opacity = 0
      self.width = @message_window.width-26 + padding * 2
      self.width = [width, Graphics.width].min
      self.height = fitting_height($game_message.choices.size)
      self.x = @message_window.x
      self.y = @message_window.y+@message_window.height-self.height+6
    else
      self.opacity = 255
      chatter_msg_update_placement
    end
  end
end

class Window_NameMessage < Window_Base
  #def hide_me
  #  self.x = 99999
  #  self.y = 99999
  #end
end

#==============================================================================
# ■ Window_NameMessage
#==============================================================================
class Window_NameMessage < Window_Base
  # alias
  alias quack_msg_name_init initialize
  def initialize(message_window)
    quack_msg_name_init(message_window)
    self.z += 2
  end
  # new
  def update_pos
    set_x_position(1)
    #set_y_position
    self.y = @message_window.y - self.height / 1.25
    self.y = 0 if self.y < 0
  end
  # overwrite
      #  self.y = @message_window.height
      #  self.y -= YEA::MESSAGE::NAME_WINDOW_Y_BUFFER
      #else
      #  self.y = @message_window.y - self.height / 1.25
      #  self.y += YEA::MESSAGE::NAME_WINDOW_Y_BUFFER
      #end
end
  
#==============================================================================
# ¡ Window_Message_Face
#==============================================================================

class Window_Message_Face < Window_Base
  alias quack_msg_face_pos set_position
  def set_position
    quack_msg_face_pos
    self.y -= 4
  end
end

#==============================================================================
# ?! Window_Quack_Message
#==============================================================================
class Window_Quack_Message < Window_Message
  attr_accessor :active
  
  # overwrite
  def initialize(msg_source, zz)
    super()
    self.z = zz
    @quack_msg_source = msg_source
    @active = false
    @background = 0
    self.opacity = 255
    self.visible = false
    clear_name_window if $imported["YEA-MessageSystem"]
  end
  # overwrite
  def chatter?
    true
  end
  # overwrite
  def source
    @quack_msg_source
  end
  # overwrite
  def update
    if @quack_msg_source.busy?
      if @quack_msg_source.expire?
        close
      else
        self.visible = true if !self.visible
        @quack_msg_source.ttl_sub
      end
    end
    self.visible = false if self.visible && close?
    super
  end
  # overwrite
  def update_placement
    return if @closing
    super
  end
  # overwrite
  def update_show_fast
    return false
  end
  # overwrite
  def process_all_text
    @event_pop_id = nil
    text = convert_escape_characters(@quack_msg_source.all_text)
    update_placement
    adjust_pop_message(text)
    open_and_wait
    #text = convert_escape_characters(@quack_msg_source.all_text)
    pos = {}
    new_page(text, pos)
    process_character(text.slice!(0, 1), text, pos) until text.empty? || close?
  end
  # overwrite
  def close
    pop_message_close #super
    return unless @event_pop_id
    return unless YSE::POP_MESSAGE::EFFECT[:use_bubble_tag]
    @speech_bubble_tag.visible = false if @speech_bubble_tag
    @thought_bubble_tag.visible = false if @thought_bubble_tag
    source.ev_id = nil
    @name_text = ""
  end
  # overwrite
  def input_pause
    self.pause = true
    wait(10)
    Fiber.yield until close?
    self.pause = false
  end
  # overwrite
  def update_fiber
    if @fiber
      @fiber.resume
    elsif @quack_msg_source.busy?
      @fiber = Fiber.new { fiber_main }
      @fiber.resume
    else
      @quack_msg_source.visible = false
    end
  end
  def fiber_main
    @quack_msg_source.visible = true
    #update_background
    update_placement
    loop do
      process_all_text if @quack_msg_source.has_text?
      process_input
      @quack_msg_source.clear
      @name_window.start_close if $imported["YEA-MessageSystem"]
      Fiber.yield
      break unless text_continue?
    end
    close_and_wait
    @quack_msg_source.visible = false
    @fiber = nil
  end
  #def update_background
  #  @background = @quack_msg_source.background
  #  self.opacity = @background == 0 ? 255 : 0
  #end
  def process_input
    input_pause unless @pause_skip
  end
  def text_continue?
    @quack_msg_source.has_text?# && !settings_changed?
  end
  def settings_changed?
    #@background != $game_message.background ||
    #@position != @quack_msg_source.position
    false
  end
  def new_page(text, pos)
    contents.clear
    draw_face(@quack_msg_source.face_name, @quack_msg_source.face_index, 0, 0)
    reset_font_settings
    pos[:x] = new_line_x
    pos[:y] = 0
    pos[:new_x] = new_line_x
    pos[:height] = calc_line_height(text)
    clear_flags
  end
  def new_line_x
    @quack_msg_source.face_name.empty? ? 0 : 112
  end
  # overwrite
  def input_pause
    #self.pause = true
    wait(10)
    Fiber.yield until @quack_msg_source.expire? #Input.trigger?(:B) || Input.trigger?(:C)
    #Input.update
    #self.pause = false
  end
  
  # overwrite
  def create_all_windows
    @name_window = Window_NameMessage.new(self) if $imported["YEA-MessageSystem"]
  end
  # overwrite
  def dispose_all_windows
    @name_window.dispose if $imported["YEA-MessageSystem"]
  end
  # overwrite
  def update_all_windows
    if $imported["YEA-MessageSystem"]
      @name_window.update
      @name_window.back_opacity = self.back_opacity
      @name_window.opacity = self.opacity
    end
  end
  # overwrite
  def event_pop_message_update_placement
  end
  # overwrite
  def all_close?
    close? && (!$imported["YEA-MessageSystem"] || @name_window.close?)
  end
  
  if $imported["YEA-MessageSystem"]
    def close_and_wait
      @name_window.force_close
      window_message_close_and_wait_ams
    end
  end
end

#==============================================================================
# ?! Scene_Map
#==============================================================================

class Scene_Map < Scene_Base
  # alias
  alias quack_msg_update update
  def update
    @quack_msgs.each {|m|
      m.update
      if m.open?
        m.update_placement
      end
    }
    @message_window.update_placement if @message_window.open?
    quack_msg_update
  end
  # overwrite
  def create_message_window
    yse_pm_create_message_window
    @face_window = Window_Message_Face.new
    @face_window.message_window = @message_window
    if @bubble_tag_sprite || @thought_bubble_tag_sprite
    @bubble_tag_sprite.dispose
    @thought_bubble_tag_sprite.dispose
    end
    if YSE::POP_MESSAGE::EFFECT[:use_bubble_tag]
      @bubble_tag_sprite = Sprite.new
      @bubble_tag_sprite.visible = false
      @bubble_tag_sprite.bitmap = Cache.system(YSE::POP_MESSAGE::EFFECT2[:bubble_tag_name])
      @bubble_tag_sprite.src_rect.set(0, 0, @bubble_tag_sprite.width, @bubble_tag_sprite.height / 2)
      @message_window.speech_bubble_tag = @bubble_tag_sprite
      
      @thought_bubble_tag_sprite = Sprite.new
      @thought_bubble_tag_sprite.visible = false
      @thought_bubble_tag_sprite.bitmap = Cache.system(YSE::POP_MESSAGE::EFFECT2[:thought_bubble_tag_name])
      @thought_bubble_tag_sprite.src_rect.set(0, 0, @thought_bubble_tag_sprite.width, @thought_bubble_tag_sprite.height / 2)
      @message_window.thought_bubble_tag = @thought_bubble_tag_sprite
    end
    @message_window.face_window = @face_window
   
    quack_msg_create_msg
  end
  # new
  def quack_msg_create_msg
    unless @quack_msgs.nil?
      @quack_msgs.each {|m| m.dispose}
      @quack_msg_speech_bubble_sprites.each {|s| s.dispose}
      @quack_msg_thought_bubble_sprites.each {|s| s.dispose}
    end
    @quack_msgs = []
    @quack_faces = []
    @quack_msg_speech_bubble_sprites = []
    @quack_msg_thought_bubble_sprites = []
    QUACK::MSG::MAX_MSGS.times do |i|
      qm = Window_Quack_Message.new($game_message.quack_msgs, 200-QUACK::MSG::MAX_MSGS+i)
      @quack_msgs.push(qm)
      ss = Sprite.new
      ss.visible = false
      ss.bitmap = Cache.system(YSE::POP_MESSAGE::EFFECT2[:bubble_tag_name])
      ss.src_rect.set(0, 0, ss.width, ss.height / 2)
      qm.speech_bubble_tag = ss
      ts = Sprite.new
      ts.visible = false
      ts.bitmap = Cache.system(YSE::POP_MESSAGE::EFFECT2[:thought_bubble_tag_name])
      ts.src_rect.set(0, 0, ts.width, ts.height / 2)
      qm.thought_bubble_tag = ts
    end
  end
  # overwrite
  def dispose_spriteset
    pop_message_dispose_spriteset
    #@quack_msg_speech_bubble_sprites.each {|s| s.dispose}
    #@quack_msg_thought_bubble_sprites.each {|s| s.dispose}
    #return unless @bubble_tag_sprite || @thought_bubble_tag_sprite
    #@bubble_tag_sprite.dispose
    #@thought_bubble_tag_sprite.dispose
  end
  # alias
  #alias quack_msg_dispose_all_windows dispose_all_windows
  #def dispose_all_windows
  #  @quack_msgs.each {|m| m.dispose}
  #  quack_msg_dispose_all_windows
  #end
end

#==============================================================================
# ?! Scene_Battle
#==============================================================================
class Scene_Battle
  alias quack_update_basic update_basic
  def update_basic
    quack_update_basic
    @quack_msgs.each {|m|
      m.update
      if m.open?
        m.update_placement
      end
    }
  end
  
  alias yse_pop_create_message_window create_message_window
  def create_message_window
    yse_pop_create_message_window
    @face_window = Window_Message_Face.new
    @face_window.message_window = @message_window
    if YSE::POP_MESSAGE::EFFECT[:use_bubble_tag]
      @bubble_tag_sprite = Sprite.new
      @bubble_tag_sprite.visible = false
      @bubble_tag_sprite.bitmap = Cache.system(YSE::POP_MESSAGE::EFFECT2[:bubble_tag_name])
      @bubble_tag_sprite.src_rect.set(0, 0, @bubble_tag_sprite.width, @bubble_tag_sprite.height / 2)
      @message_window.speech_bubble_tag = @bubble_tag_sprite
      
      @thought_bubble_tag_sprite = Sprite.new
      @thought_bubble_tag_sprite.visible = false
      @thought_bubble_tag_sprite.bitmap = Cache.system(YSE::POP_MESSAGE::EFFECT2[:thought_bubble_tag_name])
      @thought_bubble_tag_sprite.src_rect.set(0, 0, @thought_bubble_tag_sprite.width, @thought_bubble_tag_sprite.height / 2)
      @message_window.thought_bubble_tag = @thought_bubble_tag_sprite

    end
    @message_window.face_window = @face_window
   
    quack_create_message_window
  end
  
  def quack_create_message_window
    @quack_msgs = []
    @quack_msg_speech_bubble_sprites = []
    @quack_msg_thought_bubble_sprites = []
    QUACK::MSG::MAX_MSGS.times do |i|
      qm = Window_Quack_Message.new($game_message.quack_msgs, 200-QUACK::MSG::MAX_MSGS+i)
      @quack_msgs.push(qm)
      ss = Sprite.new
      ss.visible = false
      ss.bitmap = Cache.system(YSE::POP_MESSAGE::EFFECT2[:bubble_tag_name])
      ss.src_rect.set(0, 0, ss.width, ss.height / 2)
      qm.speech_bubble_tag = ss
      ts = Sprite.new
      ts.visible = false
      ts.bitmap = Cache.system(YSE::POP_MESSAGE::EFFECT2[:thought_bubble_tag_name])
      ts.src_rect.set(0, 0, ts.width, ts.height / 2)
      qm.thought_bubble_tag = ts
    end
  end
  
  alias yse_pop_dispose_spriteset dispose_spriteset
  def dispose_spriteset
    yse_pop_dispose_spriteset
    @quack_msg_speech_bubble_sprites.each {|s| s.dispose}
    @quack_msg_thought_bubble_sprites.each {|s| s.dispose}
    return unless @bubble_tag_sprite || @thought_bubble_tag_sprite
    @bubble_tag_sprite.dispose
    @thought_bubble_tag_sprite.dispose
  end
  
  alias quack_msg_dispose_all_windows dispose_all_windows
  def dispose_all_windows
    @quack_msgs.each {|m| m.dispose}
    quack_msg_dispose_all_windows
  end
end

#==============================================================================
# ?! Game_Interpreter
#==============================================================================
class Game_Interpreter
  def command_101
    item = $data_items[20]
    if $imported["YEA-MessageSystem"]
      wait_for_message
      $game_message.face_name = @params[0]
      $game_message.face_index = @params[1]
      $game_message.background = @params[2]
      $game_message.position = @params[3]
      
      startindex = @index+1
      textline = @list[startindex].parameters[0].dup
      chatdur = 0
      textline.gsub!(/<cm:([^<>]*)>/i) { chatdur = $1.to_i;"" }
      $game_message.prepare_msg(chatdur) if chatdur != 0
      while continue_message_string?
        @index += 1
        if @list[@index].code == 401
          textline = @list[@index].parameters[0] unless @index == startindex
          if chatdur != 0; $game_message.add_chatter(textline)
          else; $game_message.add(textline)
          end
        end
        break if $game_message.texts.size >= Variable.message_rows
      end
      case next_event_code
      when 102
        @index += 1
        setup_choices(@list[@index].parameters)
      when 103
        @index += 1
        setup_num_input(@list[@index].parameters)
      when 104
        @index += 1
        setup_item_choice(@list[@index].parameters)
      end
      $game_message.fin_msg if chatdur != 0
      wait_for_message
    else
      wait_for_message
      $game_message.face_name = @params[0]
      $game_message.face_index = @params[1]
      $game_message.background = @params[2]
      $game_message.position = @params[3]
      
      startindex = @index+1
      textline = @list[startindex].parameters[0].dup
      chatdur = 0
      textline.gsub!(/<cm:([^<>]*)>/i) { chatdur = $1.to_i;"" }
      $game_message.prepare_msg(chatdur) if chatdur != 0
      
      while next_event_code == 401       # Text data
        @index += 1
        textline = @list[@index].parameters[0] unless @index == startindex
        if chatdur != 0; $game_message.add_chatter(textline)
        else; $game_message.add(textline)
        end
      end
      case next_event_code
      when 102  # Show Choices
        @index += 1
        setup_choices(@list[@index].parameters)
      when 103  # Input Number
        @index += 1
        setup_num_input(@list[@index].parameters)
      when 104  # Select Item
        @index += 1
        setup_item_choice(@list[@index].parameters)
      end
      $game_message.fin_msg if chatdur != 0
      wait_for_message
    end
  end
  # new
  def clear_chatter
    $game_message.clear_chatter
  end
end

#==============================================================================
#
# ?\ End of File
#
#==============================================================================








RUBY 代码复制
  1. =begin
  2. #==============================================================================
  3.  * Qonvenience - v1.0e
  4.   Author: Quack
  5. #==============================================================================
  6.  
  7. What it is and what does it do?
  8. -------------------------------------------------------------------------------
  9. -Code that I have made for my own conveniece and use for some of my scripts.
  10.  Other than needing it if you plan to use certain scripts I've written it
  11.  adds some functionality others might be interested in listed below:
  12.  
  13. -Adds event self variables.
  14.  Usage: (event_id should be a number and key can be what you want. Usually a
  15.           number or a string)
  16.   -Set var: L[event_id,key] = "a_value"  OR   event.tset(key,"a_value")
  17.   -Get var: somevar = L[event_id,key]    OR   somevar = event.tget(key)
  18.  
  19. -Can access event self switches similar to self vars.
  20.  Usage:
  21.   -Set switch: SS[event_id,"A"] = true   OR   event.sset("B",false)
  22.   -Get switch: somevar = SS[event_id,"A"] OR  event.sget("C")
  23.  
  24. -Game variables and game switches can also be accessed with shorter commands
  25.  using V[23] = 200, somevar = V[2] for game variables and S[4] = true,
  26.  somevar = S[5] for game switches.
  27.  
  28. -Adds map local variables. That is variables that are unique to that map.
  29.  Usage:
  30.   -Set var: M[key] = 123
  31.   -Get var: somevar = M[key]
  32.  
  33. -Adds Temporary variables that reset on map chage. There exists both map wide
  34.  and event self temporary variables.
  35.  Usage:
  36.  -To set or get a normal temp var you do this:
  37.     TMP["a_key"] = 9999   OR  TMP[7] = "some_value"
  38.     somevar = TMP["another_key"]  OR  somevar = TMP[13]
  39.  -To set or get an event self tmp var:
  40.     event.tset("a_key","a_value")
  41.     event.tget("a_key")
  42.     TMP[event.id,"a_key"] = "a_value"  # works too
  43.     
  44. -Adds a functionality for enemy respawning. It doesn't do anything unless you
  45.  actually use it. I would have taken it out and put it a separate script but I
  46.  didn't feel like it. A bunch of extra methods aliases and waste of time.
  47.  If you have no interest in this just skip to the next point instead.
  48.  I use visible enemies that chase you in my game. When an enemy dies I set it's
  49.  self A switch to ON to make it stay dead. I did this because I didn't want
  50.  them to respawn everytime I went into the room. But I didn't want them stay
  51.  dead forever either. What I did was add a counter to each map that is set to
  52.  a certain value (depends on a game variable, which variable you decide in the
  53.  config area below). Whenever you change map that value is reduced by 1 for all
  54.  maps. When the value gets to 0 all events with the tag <en> in their name on
  55.  that map gets their 'A' self switch set to OFF so they will respawn. So if you
  56.  set the variable to 2 you have to walk at least 2 maps away from a certain map
  57.  for that maps enemies to respawn. It is also possible you might want all
  58.  enemies to stay dead in a dungeon until you leave that dungeon. To do this
  59.  you would set the game variable to a really high value so the enemies will
  60.  never respawn from you walking to other maps upon entering the dungeon. And
  61.  when you leave you set it back and also do this script call:
  62.    $game_respawnVars.clear
  63.  So to use this all your respawnable enemies would have to use the self switch
  64.  'A' as ON to make it dead and they also need to have the tag <en> in their
  65.  event name.
  66.     
  67. -Some things for Move routes.
  68.  -Designate event to move via code evaluation by setting the first command in
  69.   a move route to script call starting with '[v]' followed by code that can
  70.   be evaluated to a number like: '[v]20-5' OR '[v]V[12]'
  71.  
  72. -Like with move routes you can now using jump to label designate a label to
  73.  jump to via code evaluation by setting the label name in the jump to label
  74.  command to '[v]' followed by code that can be evaluated to a string.
  75.   Like so: '[v]"my label"' OR '[v]V[34]' OR '[v]"my label" + M[2]'
  76.  
  77. -Call an event page like you would call a common event using this method in
  78.  a script call: call_event(event_id, page_number)
  79.  
  80. -Support for editor suffixes.
  81.   Have you ever had multiple versions of the same skill, all with same name?
  82.   Or wanted to add a comment to an enemy's name to help you remember exactly
  83.   what that enemy is and/or does just by seeing it in the list rather than
  84.   having to click it and check it's details?
  85.   Then this is it. With this script active any text following and including
  86.   the first '(' in a database object's name will get removed in-game.
  87.   For example let's say I have a couple of key items which are all for a
  88.   certain sidequest, lets call it the "Pink Elephant" quest. Therefore I add
  89.   '(Pink Elephant)' to the name of each of those key items so they are easy to
  90.   spot in the list. So lets say one of these key items is the "Golden Peanut".
  91.   That item now has the name "Golden Peanut(Pink Elephant)" in the editor.
  92.   But in-game it still has the name "Golden Peanut" because the pink elephant
  93.   part gets removed.
  94.  
  95. Requirements:
  96. None
  97.  
  98. Instructions/Install notes:
  99. Paste it below Materials like you would any other script.
  100.  
  101. Terms of Use:
  102. Use it however you wish (yes, that does include commercial projects), as long
  103. as you do not claim it as your own code. I would also prefer you mention me in
  104. your credits if you do decide to use it.
  105.  
  106. Bugs:
  107. dunno
  108.  
  109. History:
  110. 13/01/2016 - Added comments, cleaned code and uploaded it since my Chatter
  111.              Messages script requires it.
  112.  
  113. =end
  114.  
  115. $imported = {} if $imported.nil?
  116. $imported["Qonvenience"] = true
  117.  
  118. #==============================================================================
  119. # CONFIG
  120. #==============================================================================
  121. module QUACK
  122.  
  123.   # 在切换地图时自动改变BGM的开关
  124.   TURN_OFF_AUTO_BGM_PLAY_SWITCH = 20
  125.  
  126.   # 变量,设定从当前地图离开后,再经过多少地图,敌人会重生。
  127.   RESPAWN_ROOM_COUNT = 12
  128.  
  129. end
  130. #==============================================================================
  131. # SCRIPT START
  132. #==============================================================================
  133.  
  134. #==============================================================================
  135. # DataManager - Local variables & item names
  136. # -----------------------------------------------------------------------------
  137. # Adds hashes for new variables and removes text from all database item names
  138. # from the first encountered '('. Useful in for example when you have several
  139. # versions of the same skill (a levelable skill perhaps) and want them all to
  140. # have the same name but still be able to easily tell them apart in the editor.
  141. #==============================================================================
  142. module DataManager
  143.   class << self
  144.  
  145.     #--------------------------------------------------------------------------
  146.     # alias: Create Game Objects
  147.     #--------------------------------------------------------------------------
  148.     alias local_create_game_objects create_game_objects
  149.     def create_game_objects
  150.       local_create_game_objects
  151.       $game_selfVars = {}#Simple_Matrix.new
  152.       $game_mapVars = {}
  153.       $game_respawnVars = {}
  154.       $game_tempVars = {}
  155.       #$game_database = Database.finalize
  156.     end
  157.  
  158.     #--------------------------------------------------------------------------
  159.     # alias: Make Save Contents
  160.     #--------------------------------------------------------------------------
  161.     alias local_make_save_contents make_save_contents
  162.     def make_save_contents
  163.       contents = local_make_save_contents
  164.       contents[:self_vars] = $game_selfVars
  165.       contents[:map_vars] = $game_mapVars
  166.       contents[:respawn_vars] = $game_respawnVars
  167.       contents[:tmp_vars] = $game_tempVars
  168.       contents
  169.     end
  170.  
  171.     #--------------------------------------------------------------------------
  172.     # alias: Extract Save Contents
  173.     #--------------------------------------------------------------------------
  174.     alias local_extract_save_contents extract_save_contents
  175.     def extract_save_contents(contents)
  176.       local_extract_save_contents(contents)
  177.       $game_selfVars = contents[:self_vars]
  178.       $game_mapVars = contents[:map_vars]
  179.       $game_tempVars = contents[:tmp_vars]
  180.       $game_respawnVars = contents[:respawn_vars]
  181.       #$game_database = Database.finalize
  182.      end
  183.  
  184.     #--------------------------------------------------------------------------
  185.     # alias: Load database
  186.     #--------------------------------------------------------------------------
  187.     alias load_database_item_names load_database
  188.     def load_database
  189.       load_database_item_names
  190.       load_item_names
  191.       load_notetags_type_tags
  192.     end
  193.  
  194.     #--------------------------------------------------------------------------
  195.     # new: Load Type Tags
  196.     #--------------------------------------------------------------------------
  197.     def load_notetags_type_tags
  198.       for obj in $data_states
  199.         next if obj.nil?
  200.         obj.load_notetags_type_tags
  201.       end
  202.       for obj in $data_skills
  203.         next if obj.nil?
  204.         obj.load_notetags_type_tags
  205.       end
  206.       for obj in $data_items
  207.         next if obj.nil?
  208.         obj.load_notetags_type_tags
  209.       end
  210.       for obj in $data_weapons
  211.         next if obj.nil?
  212.         obj.load_notetags_type_tags
  213.       end
  214.       for obj in $data_armors
  215.         next if obj.nil?
  216.         obj.load_notetags_type_tags
  217.       end
  218.       for obj in $data_actors
  219.         next if obj.nil?
  220.         obj.load_notetags_type_tags
  221.       end
  222.       for obj in $data_enemies
  223.         next if obj.nil?
  224.         obj.load_notetags_type_tags
  225.       end
  226.     end
  227.  
  228.     #--------------------------------------------------------------------------
  229.     # new: Remove Editor suffixes from items
  230.     #--------------------------------------------------------------------------
  231.     def load_item_names
  232.       for actor in $data_actors
  233.         next if actor.nil?
  234.         actor.name = actor.name.partition("(")[0]
  235.       end
  236.       for clas in $data_classes
  237.         next if clas.nil?
  238.         clas.name = clas.name.partition("(")[0]
  239.       end
  240.       for item in $data_items
  241.         next if item.nil?
  242.         item.name = item.name.partition("(")[0]
  243.       end
  244.       for weapon in $data_weapons
  245.         next if weapon.nil?
  246.         weapon.name = weapon.name.partition("(")[0]
  247.       end
  248.       for armor in $data_armors
  249.         next if armor.nil?
  250.         armor.name = armor.name.partition("(")[0]
  251.       end
  252.       for skill in $data_skills
  253.         next if skill.nil?
  254.         skill.name = skill.name.partition("(")[0]
  255.       end
  256.       for state in $data_states
  257.         next if state.nil?
  258.         state.name = state.name.partition("(")[0]
  259.       end
  260.       for enemy in $data_enemies
  261.         next if enemy.nil?
  262.         enemy.name = enemy.name.partition("(")[0]
  263.       end
  264.     end
  265.   end
  266. end
  267.  
  268. class RPG::BaseItem
  269.   attr_accessor :type_tags
  270.  
  271.   def has_tag?(tag)
  272.     return @type_tags.include?(tag)
  273.   end
  274.  
  275.   def load_notetags_type_tags
  276.     @type_tags = self.note =~ /<TAGS:([^<>]*)>/i ? $1 : ""
  277.   end
  278. end # RPG::BaseItem
  279.  
  280. #==============================================================================
  281. # TEMPORARY VARIABLES (reset on map change)
  282. #==============================================================================
  283. class TMP
  284.   class << self
  285.     def [](*arg)#id)
  286.       case arg.length
  287.         when 1
  288.           return 0 if $game_tempVars[[arg[0]]].nil?
  289.           return $game_tempVars[[arg[0]]]
  290.         when 2
  291.           return 0 if $game_tempVars[[arg[0], arg[1]]].nil?
  292.           return $game_tempVars[[arg[0], arg[1]]]
  293.       end
  294.     end
  295.  
  296.     def []=(*arg)#id, val)
  297.       case arg.length
  298.         when 2; $game_tempVars[[arg[0]]] = arg[1]
  299.         when 3; $game_tempVars[[arg[0],arg[1]]] = arg[2]
  300.       end
  301.       $game_map.need_refresh = true
  302.     end  
  303.  
  304.     def clear
  305.       $game_tempVars.clear
  306.     end
  307.   end
  308. end
  309. class T
  310.   class << self
  311.     def [](*arg)
  312.       case arg.length
  313.         when 1
  314.           return 0 if $game_tempVars[[arg[0]]].nil?
  315.           return $game_tempVars[[arg[0]]]
  316.         when 2
  317.           return 0 if $game_tempVars[[arg[0], arg[1]]].nil?
  318.           return $game_tempVars[[arg[0], arg[1]]]
  319.       end
  320.     end
  321.  
  322.     def []=(*arg)
  323.       case arg.length
  324.         when 2; $game_tempVars[[arg[0]]] = arg[1]
  325.         when 3; $game_tempVars[[arg[0],arg[1]]] = arg[2]
  326.       end
  327.       $game_map.need_refresh = true
  328.     end
  329.  
  330.     def clear
  331.       $game_tempVars.clear
  332.     end
  333.   end
  334. end
  335.  
  336. #==============================================================================
  337. # MAP LOCAL VARIABLES
  338. #==============================================================================
  339. class M
  340.   class << self
  341.     def [](var_id)
  342.       return 0 if $game_mapVars[[$game_map.map_id,var_id]].nil?
  343.       return $game_mapVars[[$game_map.map_id,var_id]]
  344.     end
  345.  
  346.     def []=(var_id, value)
  347.       $game_mapVars[[$game_map.map_id,var_id]] = value
  348.       $game_map.need_refresh = true
  349.     end
  350.   end
  351. end
  352.  
  353. #==============================================================================
  354. # EVENT LOCAL VARIABLES
  355. #==============================================================================
  356. class L
  357.   class << self
  358.     def [](eid, vid)
  359.       return 0 if $game_selfVars[[$game_map.map_id,eid,vid]].nil?
  360.       return $game_selfVars[[$game_map.map_id,eid,vid]]
  361.     end
  362.  
  363.     def []=(eid, vid, value)
  364.       $game_selfVars[[$game_map.map_id,eid,vid]] = value
  365.       $game_map.need_refresh = true
  366.     end
  367.   end
  368. end
  369.  
  370. #==============================================================================
  371. # SELF SWITCHES
  372. #==============================================================================
  373. class SS
  374.   class << self
  375.     def [](eid, vid)
  376.       return false if $game_self_switches[[$game_map.map_id, eif, vid]].nil?
  377.       return $game_self_switches[[$game_map.map_id, eif, vid]]
  378.     end
  379.  
  380.     def []=(eid, vid, value)
  381.       $game_self_switches[[$game_map.map_id,eid,vid]] = value
  382.       $game_map.need_refresh = true
  383.     end
  384.   end
  385. end
  386.  
  387. #==============================================================================
  388. # GLOBAL VARIABLES
  389. #==============================================================================
  390. class V
  391.   class << self
  392.     def [](id)
  393.       return 0 if id < 1
  394.       return $game_variables[id]
  395.     end
  396.  
  397.     def []=(id, value)
  398.       $game_variables[id] = value
  399.     end
  400.   end
  401. end
  402.  
  403. #==============================================================================
  404. # GLOBAL SWITCHES
  405. #==============================================================================
  406. class S
  407.   class << self
  408.     def [](id)
  409.       return false if id < 1
  410.       return $game_switches[id]
  411.     end
  412.  
  413.     def []=(id, value)
  414.       $game_switches[id] = value
  415.     end
  416.   end
  417. end
  418.  
  419. #==============================================================================
  420. #==============================================================================
  421.  
  422. class Game_Battler < Game_BattlerBase
  423.   #--------------------------------------------------------------------------
  424.   # new: Check if battler has that tag
  425.   #--------------------------------------------------------------------------
  426.   def has_tag?(tag)
  427.     return $data_enemies[@enemy_id].has_tag?(tag)
  428.   end
  429.  
  430.   #--------------------------------------------------------------------------
  431.   # new: Check if battler has state with that tag
  432.   #--------------------------------------------------------------------------
  433.   def tagged_state?(tag)
  434.     for state in states
  435.       return true if state.type_tags.include?(tag)
  436.     end
  437.     return false
  438.   end
  439.  
  440.   #--------------------------------------------------------------------------
  441.   # new: Remove states with specified tag
  442.   #--------------------------------------------------------------------------
  443.   def remove_tagged_states(tag)
  444.     rstates = []
  445.     s = states
  446.     for state in s
  447.       if state.type_tags.include?(tag)
  448.         remove_state(state.id)
  449.         rstates.push(state)
  450.       end
  451.     end
  452.     return rstates
  453.   end
  454.  
  455.   #--------------------------------------------------------------------------
  456.   # new: Return all states battler has with specified tag
  457.   #--------------------------------------------------------------------------
  458.   def states_with_tags(tag)
  459.     s = []
  460.     for state in states
  461.       s.push(state.id) if state.type_tags.include?(tag)
  462.     end
  463.     return s
  464.   end
  465. end
  466.  
  467. class Game_Actor < Game_Battler
  468.   #--------------------------------------------------------------------------
  469.   # new: Check if battler has that tag
  470.   #--------------------------------------------------------------------------
  471.   def has_tag?(tag)
  472.     return actor.has_tag?(tag)
  473.   end
  474. end
  475.  
  476. class RPG::Troop::Page
  477.   attr_reader :note_tags
  478.   attr_reader :custom_condition
  479.  
  480.   def setup_notetags
  481.     @note_tags = ""
  482.     return if !@list || @list.size <= 0
  483.     # build note tags
  484.     @list.each {|i|
  485.       @note_tags += i.parameters[0] if i && (i.code == 108 || i.code == 408)
  486.     }
  487.     # find page custom condition if there is one
  488.     @custom_condition = @note_tags =~ /<CC>(.*)<\/CC>/i ? $1 : nil
  489.   end
  490. end
  491.  
  492. class Game_Troop
  493.   # METHODS FOR CUSTOM EVENT CONDITIONS
  494.   alias quack_qon_setup setup
  495.   def setup(troop_id)
  496.     quack_qon_setup(troop_id)
  497.     troop.pages.each{|p| p.setup_notetags }
  498.   end
  499.  
  500.   alias quack_qon_conditions_met conditions_met?
  501.   def conditions_met?(page)
  502.     r = quack_qon_conditions_met(page)
  503.     return false if has_custom_cond?(page) && custom_cond_fail(page)
  504.     return r
  505.   end
  506.  
  507.   def has_custom_cond?(page)
  508.     !page.custom_condition.nil?
  509.   end
  510.  
  511.   def custom_cond_fail(page)
  512.     return !eval(page.custom_condition)
  513.   end
  514. end
  515.  
  516. class Game_Map
  517.   attr_reader   :map_id
  518.  
  519.   #--------------------------------------------------------------------------
  520.   # alias: Autoplay
  521.   # Switch for turning off bgm auto starting new song when entering map
  522.   #--------------------------------------------------------------------------
  523.   alias quack_qon_autoplay autoplay
  524.   def autoplay
  525.     if S[QUACK::TURN_OFF_AUTO_BGM_PLAY_SWITCH]
  526.       @map.bgs.play if @map.autoplay_bgs
  527.     else
  528.       quack_qon_autoplay
  529.     end
  530.   end
  531.  
  532.   #--------------------------------------------------------------------------
  533.   # alias: Setup
  534.   # Clear TMP vars, clear event name tags & update enemy respawn
  535.   #--------------------------------------------------------------------------
  536.   alias qack_qon_setup setup
  537.   def setup(map_id)
  538.     TMP.clear
  539.     @q_name_tags = {}
  540.     qack_qon_setup(map_id)
  541.     if get_respawn(map_id) == 0
  542.       e = all_event_tag('en')
  543.       e.each {|ev| ev.sset("A",false) } unless e.nil?
  544.     end
  545.     for key in $game_respawnVars.keys
  546.       $game_respawnVars[key] -= 1
  547.     end
  548.     $game_respawnVars[map_id] = V[QUACK::RESPAWN_ROOM_COUNT]
  549.     $game_respawnVars.delete_if {|k,v| v <= 0 }
  550.   end
  551.  
  552.   #--------------------------------------------------------------------------
  553.   # new: Add Event Tags
  554.   # Used for event name tags
  555.   #--------------------------------------------------------------------------
  556.   def add_event_tags(ev, pt)
  557.     u = []
  558.     # name tags
  559.     t = ev.name.scan(/<([^<>]*)>/i)
  560.     return if t.nil? || t.length < 1
  561.     t.each {|s|
  562.       if @q_name_tags.has_key?(s[0])
  563.         @q_name_tags[s[0]].push(ev)
  564.       else
  565.         @q_name_tags[s[0]] = [ev]
  566.       end
  567.       ev.add_name_tag(s[0])
  568.       u.push(s[0])
  569.     }
  570.     # page tags
  571.     pt.each{|p|
  572.       p.each{|pagtag|
  573.         next if u.include?(pagtag)
  574.         u.push(pagtag)
  575.         if @q_name_tags.has_key?(pagtag)
  576.           @q_name_tags[pagtag].push(ev)
  577.         else
  578.           @q_name_tags[pagtag] = [ev]
  579.         end
  580.       }
  581.     }
  582.   end
  583.  
  584.   #--------------------------------------------------------------------------
  585.   # new: Delete Event Tags
  586.   # Used for event name tags
  587.   #--------------------------------------------------------------------------
  588.   def delete_event_tags(ev)
  589.     ev.name_tags.each{|s|
  590.       @q_name_tags[s].delete(ev)
  591.     }
  592.   end
  593.  
  594.   #--------------------------------------------------------------------------
  595.   # new: First Event With Tag
  596.   # First event on map with specified tag
  597.   #--------------------------------------------------------------------------
  598.   def first_event_tag(tag)
  599.     return nil unless @q_name_tags.has_key?(tag)
  600.     #return @q_name_tags[tag][0]
  601.     @q_name_tags[tag].each{|e|
  602.       return e if e.has_name_tag?(tag)
  603.     }
  604.     return nil
  605.   end
  606.   #--------------------------------------------------------------------------
  607.   # new: Last Event With Tag
  608.   # Last event on map with specified tag
  609.   #--------------------------------------------------------------------------
  610.   def last_event_tag(tag)
  611.     return nil unless @q_name_tags.has_key?(tag)
  612.     #return @q_name_tags[tag][@q_name_tags[tag].length-1]
  613.     @q_name_tags[tag].reverse_each{|e|
  614.       return e if e.has_name_tag?(tag)
  615.     }
  616.   end
  617.   #--------------------------------------------------------------------------
  618.   # new: All Events With Tag
  619.   # All events on map with specified tag
  620.   #--------------------------------------------------------------------------
  621.   def all_event_tag(tag)
  622.     return nil unless @q_name_tags.has_key?(tag)
  623.     #return @q_name_tags[tag]
  624.     return @q_name_tags[tag].select{|e| e.has_name_tag?(tag) }
  625.   end
  626.  
  627.   #--------------------------------------------------------------------------
  628.   # new: get respawn
  629.   # get respawn var
  630.   #--------------------------------------------------------------------------
  631.   def get_respawn(id)
  632.     return $game_respawnVars[id] if $game_respawnVars.has_key?(id)
  633.     return 0
  634.   end
  635.  
  636. end
  637.  
  638.  
  639. class Game_Character < Game_CharacterBase
  640.   #--------------------------------------------------------------------------
  641.   # alias: process_move_command
  642.   #--------------------------------------------------------------------------
  643.   alias process_move_command_movement_cmds_alias process_move_command
  644.   def process_move_command(command)
  645.     case command.code
  646.       when ROUTE_SCRIPT
  647.         return if command.parameters[0].include? '[v]'
  648.     end
  649.     process_move_command_movement_cmds_alias(command)
  650.   end
  651.  
  652.   MOVE_SYMBOL_CODE = {
  653.   :UP    => ROUTE_MOVE_UP,
  654.   :DOWN  => ROUTE_MOVE_DOWN,
  655.   :LEFT  => ROUTE_MOVE_LEFT,
  656.   :RIGHT => ROUTE_MOVE_RIGHT,
  657.   :FORWARD => ROUTE_MOVE_FORWARD,
  658.   :BACKWARD => ROUTE_MOVE_BACKWARD,
  659.   :TOWARD => ROUTE_MOVE_TOWARD,
  660.   :AWAY => ROUTE_MOVE_AWAY,
  661.   }
  662.  
  663.   #--------------------------------------------------------------------------
  664.   # new method: opacity_tween
  665.   #--------------------------------------------------------------------------
  666.   def opacity_tween(opacity, duration)
  667.     crnt_opacity = @opacity
  668.     i = (opacity - crnt_opacity).to_f / duration
  669.     for x in (0..duration)
  670.       @move_route.list.insert(@move_route_index + x + 1, RPG::MoveCommand.new(ROUTE_CHANGE_OPACITY, [crnt_opacity.to_i]))
  671.       crnt_opacity += i
  672.       crnt_opacity = opacity if x == (duration-1)
  673.     end
  674.     @move_route.list.delete_at(@move_route_index)
  675.   end
  676.  
  677.   #--------------------------------------------------------------------------
  678.   # new method: move
  679.   #--------------------------------------------------------------------------
  680.   def move(dir, steps)
  681.     dir = MOVE_SYMBOL_CODE[dir] if dir.is_a?(Symbol)
  682.     for x in (1..steps)
  683.       @move_route.list.insert(@move_route_index + x, RPG::MoveCommand.new(dir))
  684.     end
  685.     @move_route.list.delete_at(@move_route_index)
  686.   end
  687.  
  688.   def gotoxy(x,y)
  689.     @x = x
  690.     @y = y
  691.   end
  692.  
  693.   def moveto2(x, y)
  694.     @x = x % $game_map.width
  695.     @y = y % $game_map.height
  696.     @real_x = @x
  697.     @real_y = @y
  698.   end
  699.  
  700.   def moveto2_d(l, d)
  701.     @y -= l if d == 8
  702.     @y += l if d == 2
  703.     @x -= l if d == 4
  704.     @x += l if d == 6
  705.     @real_x = @x
  706.     @real_y = @y
  707.   end
  708.  
  709.   def set_move_speed(val)
  710.     @move_speed = val
  711.   end
  712.  
  713.   def clear_move_route
  714.     @move_route = nil
  715.     @move_route_index = 0
  716.     @wait_count = 0
  717.   end
  718.  
  719.   def turn_left
  720.     set_direction(4)
  721.   end
  722.   def turn_right
  723.     set_direction(6)
  724.   end
  725.   def turn_up
  726.     set_direction(8)
  727.   end
  728.   def turn_down
  729.     set_direction(2)
  730.   end
  731. end
  732.  
  733. class Game_Player < Game_Character
  734.   alias init_alias initialize
  735.   def initialize
  736.     init_alias
  737.     @move_input_enabled = true
  738.   end
  739.  
  740.   def disable_move_input
  741.     @move_input_enabled = false
  742.   end
  743.  
  744.   def enable_move_input
  745.     @move_input_enabled = true
  746.   end
  747.  
  748.   def in_control?
  749.     return @move_input_enabled
  750.   end
  751.  
  752.   alias qon_movable movable?
  753.   def movable?
  754.     return false if !@move_input_enabled
  755.     qon_movable
  756.   end
  757.  
  758.   #alias move_by_input_alias move_by_input
  759.   #def move_by_input
  760.   #  return if !@move_input_enabled
  761.   #  move_by_input_alias
  762.   #end
  763. end
  764.  
  765. class RPG::Event::Page
  766.   attr_reader :page_tags
  767.   attr_reader :note_tags
  768.   attr_reader :custom_condition
  769.  
  770.   def setup_notetags
  771.     @note_tags = ""
  772.     @page_tags = []
  773.     return if !@list || @list.size <= 0
  774.     # build note tags
  775.     @list.each {|i|
  776.       @note_tags += i.parameters[0] if i && (i.code == 108 || i.code == 408)
  777.     }
  778.     # find page custom condition if there is one
  779.     @custom_condition = note_tags =~ /<CC>(.*)<\/CC>/i ? $1 : nil
  780.  
  781.     # get page tags from note tags
  782.     t = @note_tags.scan(/<t:([^<>]*)>/i)
  783.     return if t.nil? || t.length < 1
  784.     t.each{|pt|
  785.       @page_tags.push(pt[0])
  786.     }
  787.   end
  788. end
  789.  
  790. class Game_Event < Game_Character
  791.  
  792.   #--------------------------------------------------------------------------
  793.   # alias: initialize
  794.   # For event name tags.
  795.   #--------------------------------------------------------------------------
  796.   alias quack_qon_init initialize
  797.   def initialize(map_id, event)
  798.     quack_qon_init(map_id, event)
  799.     pt = []
  800.     @event.pages.each {|p|
  801.       p.setup_notetags
  802.       pt.push(p.page_tags)
  803.     }
  804.     $game_map.add_event_tags(self, pt)
  805.   end
  806.   #--------------------------------------------------------------------------
  807.   # new: Add name tag
  808.   # For event name tags.
  809.   #--------------------------------------------------------------------------
  810.   def add_name_tag(tag)
  811.     if @name_tags.nil?
  812.       @name_tags = [tag]
  813.     else
  814.       @name_tags.push(tag)
  815.     end
  816.   end
  817.   def name_tags
  818.     return [] if @name_tags.nil?
  819.     return @name_tags
  820.   end
  821.   def has_name_tag?(tag)
  822.     unless @name_tags.nil?
  823.       return true if @name_tags.include?(tag)
  824.     end
  825.     return false if @page.nil? || @page.page_tags.nil?
  826.     return true if @page.page_tags.include?(tag)
  827.     return false
  828.   end
  829.   #--------------------------------------------------------------------------
  830.   # new: Return event's name
  831.   # For event name tags.
  832.   #--------------------------------------------------------------------------
  833.   def name
  834.     return @event.name
  835.   end
  836.  
  837.   def page_tags
  838.     return @page.page_tags
  839.   end
  840.  
  841.   def notetags_page
  842.     return @page.note_tags
  843.   #  return "" if !@page || [email protected] || @page.list.size <= 0
  844.   #  return @notetags_page if @notetags_page
  845.   #  @notetags_page = ""
  846.   #  l = []
  847.   #  @page.list.each {|i|
  848.   #    @notetags_page += i.parameters[0] if i && (i.code == 108 || i.code == 408)
  849.   #  }
  850.   #  return @notetags_page
  851.   end  
  852.   def notetags
  853.     return @notetags unless @notetags.nil?
  854.     @notetags = ""
  855.     @event.pages.each {|p|
  856.       next if !p || !p.list || p.list.size <= 0
  857.       @notetags += p.note_tags
  858.     }
  859.     return @notetags
  860.   end
  861.  
  862.   # METHODS FOR CUSTOM EVENT CONDITIONS
  863.  
  864.   alias quack_qon_conditions_met conditions_met?
  865.   def conditions_met?(page)
  866.     r = quack_qon_conditions_met(page)
  867.     return false if has_custom_cond?(page) && custom_cond_fail(page)
  868.     return r
  869.   end
  870.  
  871.   def has_custom_cond?(page)
  872.     !page.custom_condition.nil?
  873.   end
  874.  
  875.   def custom_cond_fail(page)
  876.     return !eval(page.custom_condition)
  877.   end
  878.  
  879.   # METHODS FOR ACCESSING THE EVENTS LOCAL VARIABLES AND SWITCHES
  880.  
  881.   #--------------------------------------------------------------------------
  882.   # new: Get self var
  883.   #--------------------------------------------------------------------------
  884.   def lget(id)
  885.     L[@id,id]
  886.   end
  887.   #--------------------------------------------------------------------------
  888.   # new: Set self var
  889.   #--------------------------------------------------------------------------
  890.   def lset(id,val)
  891.     $game_selfVars[[@map_id,@id,id]] = val
  892.     $game_map.need_refresh = true
  893.   end
  894.  
  895.   #--------------------------------------------------------------------------
  896.   # new: Get self switch
  897.   #--------------------------------------------------------------------------
  898.   def sget(id)
  899.     L[@id,id]
  900.   end
  901.   #--------------------------------------------------------------------------
  902.   # new: Set self switch
  903.   #--------------------------------------------------------------------------
  904.   def sset(id,val)
  905.     $game_self_switches[[@map_id,@id,id]] = val
  906.     $game_map.need_refresh = true
  907.   end
  908.  
  909.   #--------------------------------------------------------------------------
  910.   # new: Get self temp var
  911.   #--------------------------------------------------------------------------
  912.   def tget(id)
  913.     return TMP[@id,id]
  914.   end
  915.   #--------------------------------------------------------------------------
  916.   # new: Set self temp var
  917.   #--------------------------------------------------------------------------
  918.   def tset(id,val)
  919.     $game_tempVars[[@id,id]] = val
  920.     $game_map.need_refresh = true
  921.   end
  922.  
  923.   #--------------------------------------------------------------------------
  924.   # new: Get Page
  925.   # Needed for event page call
  926.   #--------------------------------------------------------------------------
  927.   def get_page(index)
  928.     return @event.pages[index]
  929.   end
  930. end
  931.  
  932. class Game_Interpreter
  933.   #--------------------------------------------------------------------------
  934.   # * Self Vars
  935.   #--------------------------------------------------------------------------
  936.  
  937.   #--------------------------------------------------------------------------
  938.   # new: lget
  939.   # get self var
  940.   #--------------------------------------------------------------------------
  941.   def lget(*arguments)
  942.     result = 0
  943.     case arguments.length
  944.       when 1; result = $game_selfVars[[@map_id, @event_id, arguments[0]]]
  945.       when 2; result = $game_selfVars[[@map_id, arguments[0], arguments[1]]]
  946.       when 3; result = $game_selfVars[[arguments[0], arguments[1], arguments[2]]]
  947.     end
  948.     return result
  949.   end
  950.   #--------------------------------------------------------------------------
  951.   # new: lset
  952.   # set self var
  953.   #--------------------------------------------------------------------------
  954.   def lset(*arguments)
  955.     case arguments.length
  956.       when 2; $game_selfVars[[@map_id, @event_id, arguments[0]]] = arguments[1]
  957.       when 3; $game_selfVars[[@map_id, arguments[0], arguments[1]]] = arguments[2]
  958.       when 4; $game_selfVars[[arguments[0], arguments[1], arguments[2]]] = arguments[3]
  959.     end
  960.     $game_map.need_refresh = true
  961.   end
  962.   #--------------------------------------------------------------------------
  963.   # * Self Switches
  964.   #--------------------------------------------------------------------------
  965.  
  966.   #--------------------------------------------------------------------------
  967.   # new: sget
  968.   # get self switch
  969.   #--------------------------------------------------------------------------
  970.   def sget(*arguments)
  971.     result = false
  972.     case arguments.length
  973.       when 1; result = $game_self_switches[[@map_id, @event_id, arguments[0]]]
  974.       when 2; result = $game_self_switches[[@map_id, arguments[0], arguments[1]]]
  975.       when 3; result = $game_self_switches[[arguments[0], arguments[1], arguments[2]]]
  976.     end
  977.     return result
  978.   end
  979.   #--------------------------------------------------------------------------
  980.   # new: sset
  981.   # set self switch
  982.   #--------------------------------------------------------------------------
  983.   def sset(*arguments)
  984.     case arguments.length
  985.       when 2; $game_self_switches[[@map_id, @event_id, arguments[0]]] = arguments[1]
  986.       when 3; $game_self_switches[[@map_id, arguments[0], arguments[1]]] = arguments[2]
  987.       when 4; $game_self_switches[[arguments[0], arguments[1], arguments[2]]] = arguments[3]
  988.     end
  989.     $game_map.need_refresh = true
  990.   end
  991.  
  992.   #--------------------------------------------------------------------------
  993.   # * Respawn Vars
  994.   #--------------------------------------------------------------------------
  995.  
  996.   #--------------------------------------------------------------------------
  997.   # new: get respawn
  998.   # get respawn var
  999.   #--------------------------------------------------------------------------
  1000.   def get_respawn(id)
  1001.     return $game_respawnVars[id] if $game_respawnVars.has_key?(id)
  1002.     return 0
  1003.   end
  1004.   #--------------------------------------------------------------------------
  1005.   # new: set respawn
  1006.   # set respawn var
  1007.   #--------------------------------------------------------------------------
  1008.   def set_respawn(id, value)
  1009.     $game_respawnVars[id] = value
  1010.   end
  1011.  
  1012.   #--------------------------------------------------------------------------
  1013.   # * Easier to remember fade commands
  1014.   #--------------------------------------------------------------------------
  1015.   def fade_in(duration)
  1016.     screen.start_fadein(duration)
  1017.   end
  1018.   def fade_out(duration)
  1019.     screen.start_fadeout(duration)
  1020.   end
  1021.  
  1022.   #--------------------------------------------------------------------------
  1023.   # alias: Temporarily Erase Event
  1024.   # For event name tags
  1025.   #--------------------------------------------------------------------------
  1026.   alias quack_qon_command_214 command_214
  1027.   def command_214
  1028.     $game_map.delete_event_tags($game_map.events[@event_id])
  1029.     quack_qon_command_214
  1030.   end
  1031.  
  1032.   #--------------------------------------------------------------------------
  1033.   # overwrite method: command_205 (Set Move Route)
  1034.   # ---------------------------------------------------
  1035.   # By making the first command in a move route a script call which starts
  1036.   # with '[v]' the rest of the script call be evaluated to an integer which
  1037.   # is used as character id to chose which event the move route pertains to.
  1038.   #--------------------------------------------------------------------------
  1039.   def command_205 # COMMAND SET MOVE ROUTE
  1040.     $game_map.refresh if $game_map.need_refresh
  1041.     character = get_character(@params[0])
  1042.     cmd = @params[1].list[0]
  1043.     if cmd.code == 45 # 45 = SCRIPT COMMAND
  1044.       if cmd.parameters[0].include? '[v]'
  1045.         @params[0] = eval(cmd.parameters[0][3..cmd.parameters[0].length])
  1046.         character = get_character(@params[0])
  1047.         #@params[1].list.delete_at(0)
  1048.       end
  1049.     end
  1050.     if character
  1051.       character.force_move_route(@params[1].dup)
  1052.       Fiber.yield while character.move_route_forcing if @params[1].wait
  1053.     end
  1054.   end
  1055.  
  1056.   #==========================================================================
  1057.   # * Jump to Label (edited to allow to jump to a label using a variable)
  1058.   #==========================================================================
  1059.   def command_119
  1060.     label_name = @params[0]
  1061.     if label_name.include? '[v]'
  1062.       label_name = eval(label_name[3..label_name.length])
  1063.     end
  1064.     @list.size.times do |i|
  1065.       if @list[i].code == 118 && @list[i].parameters[0] == label_name
  1066.         @index = i
  1067.         return
  1068.       end
  1069.     end
  1070.   end
  1071.  
  1072.   #==========================================================================
  1073.   # * Call event page
  1074.   #==========================================================================
  1075.   def call_event(event_id, page_id)
  1076.     qq = Game_Interpreter.new(@depth + 1)
  1077.     page = evs[event_id].get_page(page_id)
  1078.     qq.setup(page.list, event_id)
  1079.     qq.run
  1080.   end
  1081.  
  1082.   def ev; @event_id; end
  1083.   def evs; $game_map.events; end
  1084.   def events; $game_map.events; end
  1085.   def me; evs[ev]; end
  1086.   def pl; $game_player; end
  1087.   def player; $game_player; end
  1088.   def char(id); get_character(id); end
  1089.   def map; return $game_map; end
  1090.   def set_move_speed(char_id, val)
  1091.     get_character(char_id).set_move_speed(val)
  1092.   end
  1093.  
  1094.   def move_to_point(id,x,y,wait=false)
  1095.     c = char(id)
  1096.     c.move_to_point(x,y)
  1097.     Fiber.yield while c.move_route_forcing if wait
  1098.   end
  1099.  
  1100.   #--------------------------------------------------------------------------
  1101.   # new: First event with tag
  1102.   #--------------------------------------------------------------------------
  1103.   def first_event_tag(tag)
  1104.     $game_map.first_event_tag(tag)
  1105.   end
  1106.   #--------------------------------------------------------------------------
  1107.   # new: Last event with tag
  1108.   #--------------------------------------------------------------------------
  1109.   def last_event_tag(tag)
  1110.     $game_map.last_event_tag(tag)
  1111.   end
  1112.   #--------------------------------------------------------------------------
  1113.   # new: All events with tag
  1114.   #--------------------------------------------------------------------------
  1115.   def all_event_tag(tag)
  1116.     $game_map.all_event_tag(tag)
  1117.   end
  1118.   #--------------------------------------------------------------------------
  1119.   # new: Find all events with all the specified tags
  1120.   #--------------------------------------------------------------------------
  1121.   def find_events(*args)
  1122.     result = []
  1123.     evs.keys.each {|k|
  1124.       unless evs[k].name_tags.nil?
  1125.         if (args - evs[k].name_tags).empty?
  1126.           result.push(evs[k])
  1127.         end
  1128.       end
  1129.     }
  1130.     return result
  1131.   end
  1132.  
  1133.   def diff(val1, val2)
  1134.     return (val1 - val2).abs
  1135.   end
  1136.  
  1137.   def pos_diff(c1, c2)
  1138.     xd = c1.x - c2.x
  1139.     yd = c1.y - c2.y
  1140.     xd *= xd
  1141.     yd *= yd
  1142.     return Math.sqrt(xd+yd)
  1143.   end
  1144.  
  1145.   #returns true if the distance between char1 and char2 is greater than dist
  1146.   def distance_gt(ev1,ev2,dist)#id1, id2, dist)
  1147.     #xd = char(id1).x - char(id2).x
  1148.     #yd = char(id1).y - char(id2).y
  1149.     xd = ev1.x - ev2.x
  1150.     yd = ev1.y - ev2.y
  1151.     xd *= xd
  1152.     yd *= yd
  1153.     return (xd + yd) > dist * dist
  1154.   end
  1155.  
  1156.   # returns true if the difference between val1 and val2 is greater than i.
  1157.   def diff_gt(val1, val2, i)
  1158.     if val1 < val2 - i; return true; end
  1159.     if val1 > val2 + i; return true; end
  1160.     return false
  1161.   end
  1162.  
  1163.   # returns true if the position1 is equal to position2
  1164.   def pos_is?(*arg)
  1165.     case arg.length
  1166.       when 1
  1167.         c = arg[0]#get_character(arg[0])
  1168.         return c.x == me.x && c.y == me.y
  1169.       when 2
  1170.         c1 = arg[0]#get_character(arg[0])
  1171.         c2 = arg[1]#get_character(arg[1])
  1172.         return c1.x == c2.x && c1.y == c2.y
  1173.       when 3
  1174.         c1 = arg[0]#get_character(arg[0])
  1175.         return c1.x == arg[1] && c2.y == arg[2]
  1176.       when 4
  1177.         return arg[0] == arg[2] && arg[1] == arg[3]
  1178.     end
  1179.     return false
  1180.   end
  1181.  
  1182.   # Returns in which of the 4 directions char2 is related to char1
  1183.   def ev_dir(char1, char2)
  1184.     if diff(char1.x, char2.x) > diff(char1.y,char2.y)
  1185.       if char1.x < char2.x
  1186.         return 6
  1187.       else
  1188.         return 4
  1189.       end
  1190.     else
  1191.       if char1.y < char2.y
  1192.         return 2
  1193.       else
  1194.         return 8
  1195.       end
  1196.     end
  1197.   end
  1198.  
  1199.   def wait_rnd(min_dur, max_dur)
  1200.     duration = min_dur + rnd(max_dur - min_dur).to_i
  1201.     duration.times { Fiber.yield }
  1202.   end
  1203.  
  1204.   def break_loop #becuz who can remember that 113 = break?
  1205.     command_113
  1206.   end
  1207.  
  1208.   # Prepare for cutscene
  1209.   def prep_scene
  1210.     $game_system.menu_disabled = true
  1211.     $game_system.save_disabled = true
  1212.     pl.disable_move_input
  1213.   end
  1214.  
  1215.   #end cutscene
  1216.   def end_scene
  1217.     $game_system.menu_disabled = false
  1218.     $game_system.save_disabled = false
  1219.     pl.enable_move_input
  1220.   end
  1221. end







我使用脚本的范例工程

https://rpg.blue/thread-405406-1-1.html

QQ截图20180210120241.png (21.27 KB, 下载次数: 26)

QQ截图20180210120241.png

QQ图片20180210122704.png (19.42 KB, 下载次数: 28)

这是放在新的工程里的

这是放在新的工程里的

Lv2.观梦者

梦石
0
星屑
789
在线时间
115 小时
注册时间
2017-12-2
帖子
74
2
 楼主| 发表于 2018-2-10 12:16:27 | 只看该作者
我又重新排除了一下插件脚本里的脚本是否冲突,发现并不是它们的原因,难道是上面的脚本出问题了???。。。。。。。。
会不会是我以前弄过忘记了
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
789
在线时间
115 小时
注册时间
2017-12-2
帖子
74
3
 楼主| 发表于 2018-2-10 12:18:06 | 只看该作者
总是会这样子。。。。。。。。。。。。。。。。。。。。

QQ截图20180210121517.png (17.42 KB, 下载次数: 29)

QQ截图20180210121517.png
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
789
在线时间
115 小时
注册时间
2017-12-2
帖子
74
4
 楼主| 发表于 2018-2-10 13:20:26 | 只看该作者
该怎么办怎么办怎么办。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
1
星屑
14790
在线时间
2106 小时
注册时间
2017-9-28
帖子
662
5
发表于 2018-2-10 15:25:08 | 只看该作者
qonvenience是核心脚本,需要放在气泡框插件插件的上面...........
顺序参考帖子里的范例

点评

建议核心脚本/基础模块等脚本放的越上越好....  发表于 2018-2-10 15:26
VA外站脚本汉化群:226308173   |    部分远古文件备份:https://wwzv.lanzoue.com/b02rac5pc  密码:acgm
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
789
在线时间
115 小时
注册时间
2017-12-2
帖子
74
6
 楼主| 发表于 2018-2-10 15:58:30 | 只看该作者
Nil2018 发表于 2018-2-10 15:25
qonvenience是核心脚本,需要放在气泡框插件插件的上面...........
顺序参考帖子里的范例 ...

放了。。没用。。。。。。。。。。。。。。。

点评

你放在下面了,不是"上面"  发表于 2018-2-10 17:27
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
789
在线时间
115 小时
注册时间
2017-12-2
帖子
74
7
 楼主| 发表于 2018-2-10 17:41:59 | 只看该作者
Nil2018 发表于 2018-2-10 15:25
qonvenience是核心脚本,需要放在气泡框插件插件的上面...........
顺序参考帖子里的范例 ...

我重新放在下面过了,不是一楼的那个顺序【那是之前的】
可还是没有用。。。。
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
789
在线时间
115 小时
注册时间
2017-12-2
帖子
74
8
 楼主| 发表于 2018-2-10 21:38:56 | 只看该作者
没有人吗。。。。。。。。。。。。。。。。。。
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
789
在线时间
115 小时
注册时间
2017-12-2
帖子
74
9
 楼主| 发表于 2018-2-11 12:14:26 | 只看该作者
大家新年快乐。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
789
在线时间
115 小时
注册时间
2017-12-2
帖子
74
10
 楼主| 发表于 2018-2-13 17:18:01 | 只看该作者
没人能回答了吗。。。。。。。。。。。。。。。。。。。。。。。
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-17 09:29

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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