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

Project1

 找回密码
 注册会员
搜索
查看: 2151|回复: 2

[已经解决] Yami气泡对话框插件报错

[复制链接]

Lv3.寻梦者

梦石
0
星屑
2289
在线时间
149 小时
注册时间
2009-1-7
帖子
4
发表于 2019-2-28 23:51:12 | 显示全部楼层 |阅读模式
20星屑
使用了汉化版的Yami气泡对话框增强插件,制作时场景内测试一切正常,开了剧情传送后对话报错。因为试过移除其他脚本,脚本冲突可能性不大,下载贴6楼也有朋友出现类似情况,想知道原因何在,谢谢!

未标题-1.jpg


RUBY 代码复制
  1. =begin
  2. #==============================================================================
  3.  * 闲谈对话框 (Yami 气泡对话框 的插件) - v1.3c
  4.   作者: Quack
  5.   翻译:nil2018(○┰○)
  6. #==============================================================================
  7. 效果:
  8. 1-允许你使用"闲谈对话框。和默认对话框区别为,闲谈对话框不会暂停游戏,也不会因为
  9.   玩家按下任何按键而关闭,取而代之的是为对话框设定一个计时器,时间到了会自动将
  10.   其关闭。还有一个特点是:可以同时显示多个闲谈对话框(有最大显示数量限制,默认
  11.   为7,你可以在下面的"MAX_MSGS"中调整最大数)
  12.  
  13.   将普通对话框“变成”闲谈对话框的方法为:在对话框中填入标志:'<cm:X>'
  14.   其中X为显示的时间,单位为秒(注意:这个标志必须放在对话框的第一行!!)
  15.   将X设定为负值时,对话框就不会消失了。你可以使用脚本来关闭所有闲谈对话框:
  16.   clear_chatter
  17.  
  18. 2-说话的气泡标志(bubble message)和原来一样,都是: \bm[x]
  19.   新添加了思考(bubble message thought)的气泡标志:  \bmt[x]
  20.  
  21. 3-气泡对话框可以在战斗中使用了。可以使用 \bm[x] 或 \bmt[x] 来显示气泡对话框。
  22.   如果你要在敌人头上显示气泡对话框,请将x替换为负值.
  23.   在战斗中:    \bm[1] 显示在1号敌人头上
  24.                 \bm[-1] 显示在1号角色头上
  25.   对于1号敌人,使用 \bm[1] ,4号敌人则使用 \bm[4]
  26.   同时,对于角色: 1号角色 = \bm[-1]
  27.  
  28.   然而,要想在战斗中在角色头上显示气泡对话框,需要你使用“显示角色战斗图”的
  29.   脚本。我不能保证我的脚本适用于所有该功能的脚本。但我可以保证和Jet's sideview
  30.   battlers 相兼容。
  31.  
  32.   有一个问题是,当战斗图的大小过大或过小时,对话框窗口会有些移位。
  33.   使用以下标志来调整对话框的位置:
  34.   \ox[X] - 调整气泡对话框的x坐标
  35.   \oy[X] - 调整气泡对话框的y坐标
  36.  
  37.   有一点需要注意的是,如果你还使用了Yanfly的核心脚本&Yanfly的文本系统,你需要将
  38.   核心脚本中的 FONT_NAME 和文本系统的i MESSAGE_WINDOW_FONT_NAME 设定相匹配(两
  39.   个地方都要设定相同的字体)否则两个脚本的设定结合起来,有时会使文本的宽度计算
  40.   错误。这个问题不大,可是在气泡对话框中,会改变气泡对话框的窗口宽度,这就是个
  41.   大问题了(yanfly两个脚本中,关于字体的其他设定例如是否加粗是否斜体等,也最好
  42.   设定得一模一样)
  43.  
  44. 版本 1.1 更新功能:
  45.  
  46. 1-添加文本打字音效,你可以在 TEXT_SOUNDS 的哈希表中设定(在下面查看更多地介绍)
  47.   使用标志:
  48.   <ts:x>   文章打字音x,x为存在于 TEXT_SOUNDS 哈希表中的打字音效名字.
  49.  
  50. 2-添加对话框背景色调的功能。你可以在 WINDOW_TONES 哈希表中预设色调种类
  51.   使用标志: <bc:x> ,其中x为存在于 WINDOW_TONES 哈希表中的色调名字.
  52.  
  53. 3-有时,你需要在同一个对话框中显示不同的字体,可能会使对话框变得过大或过小。Sometimes you might want to change font size in your message, multiple times,
  54.   使用标志: <pms:x,y> 可以调整气泡对话框的大小.x为宽度变化,y为高度变化
  55.   例如,你使用了标志<pms:20,-10> ,则对话框的宽度会增加20,高度会减少10.
  56.  
  57. 4-如果你和我一样,被记忆事件id、书写一大堆标志而困扰,以下功能会帮到你。
  58.  
  59.   仅使用一个标志<bt:x> (对于谈话气泡) 或 <btt:x> (对于思考气泡)
  60.   就可以让该事件使用你设定的背景颜色和文本打字音效。
  61.  
  62.   那原理是什么?
  63.   举个例子,我有一个作为队伍角色的事件,她叫Emil.在事件名中填入了标志: <emil>.
  64.   然后,当我使用了标志: <bt:emil> 或 <btt:emil> 气泡对话框会自动显示到该事件的
  65.   头上(如果有多个事件名为<emil>的事件,也会只显示一个对话框),且使用
  66.   WINDOW_TONES 中的'emil'作为窗口色调,使用TEXT_SOUNDS中的'emil'作为文本打字音效
  67.   但不能用于btt,因为思考中还会有打字音效不是太奇怪了吗?
  68.  
  69.  
  70.   这也会在你检查事件时,更清楚地明白哪个事件是'emil',而不是去找哪个事件是某某id
  71.  
  72.   如果你想指定用于角色(player) 的话,使用标志'pl',例如:
  73.   <bt:pl>
  74.   这样就可以使设定窗口色调和打字音效的"打包"设定同时应用于角色了。
  75.   或许在队员变化大的情况下不怎么实用,但是我仍然添加了此功能。
  76.  
  77.   如果你很好奇为什么我新添加的标志和以前的不一样...因为!Consistence is overrated
  78.   anyway, who needs it?  (0.0)
  79.  
  80.   使用标志(<bt:x> & <btt:x>) 需要你安装脚本 Qonvenience (你也许会叫它做
  81.   我的'核心' 脚本,类似其他人的 (Yanfly,
  82.   Victor, Yami, etc).
  83.   你可以在下面的'使用条件'部分找到下载地址.
  84.  
  85. 版本 1.2 更新功能:
  86.  
  87. - 显示选项时,会根据你使用的是气泡对话框还是普通的对话框而显示不同的样子。
  88.   使用默认对话框时,选项的外貌不变。使用气泡对话框时选项会变得更大,且显示在对
  89.   话框窗口中.
  90.  
  91. 版本 1.3更新功能:
  92.  
  93. - 修复了一些肖像图和名称窗口的问题。问题并没有完全解决,因为我自己的工程里并
  94.  没有使用名称窗口或肖像图,所以本人并不是很感兴趣去花时间到这些地方。
  95.  
  96. -和窗口色调、打字音效一样,你现在可以使用标志来显示名称窗口了。
  97.  
  98. ==============================================================================
  99. 安装注释:
  100. 需要脚本 Yami气泡对话框.
  101. 将本脚本放在其之下.
  102.  
  103. ==============================================================================
  104. 使用条件:
  105. 需要Yami气泡对话框脚本,你可以在这里下载:
  106. ​[url]https://github.com/suppayami/rmvxa-collection/blob/master/yami-script-ace/10%20-%20Pop%20Message.txt[/url]
  107. 同时还需要我的 Qonvenience脚本 ,如果你想使用:<bt:x> 和 <btt:x>的话
  108. 在这里下载:
  109. [url]http://pastebin.com/J6haUy5T[/url]
  110.  
  111. ==============================================================================
  112. Credits:
  113. Yami 为 气泡对话框的作者.
  114.  
  115. ==============================================================================
  116. 使用条款:
  117. 随意使用(没错,包括商业游戏),只要你不声明这个脚本是你自己写的。
  118. 同时我也希望你能在使用此脚本时,属名我为脚本的作者。
  119. 请记住本脚本必须和Yami的气泡对话框同时使用,其也有自己的使用条款.
  120.  
  121. ==============================================================================
  122. Bugs:
  123. 不懂
  124.  
  125. ==============================================================================
  126. History:
  127. 11/10/2016 - Fixed some problems added some minor feature.
  128. 19/01/2016 - Fixed some bugs, changes to choices when a pop message is used.
  129. 14/01/2016 - Chatter messages now last forever if you set the duration to a
  130.              negative number. Also added method for clearing all chatter
  131.              to use in script calls. Also squashed some bugs.
  132. 13/01/2016 - Pretty big update. Added more functionality.
  133. 10/01/2016 - Proper release since Absurdiness found the original script so I
  134.              could separate the addon from the original.
  135. 08/01/2016 - Initial release
  136.  
  137. =end
  138.  
  139. $imported = {} if $imported.nil?
  140. $imported["Chatter_Messages"] = true
  141.  
  142. #==============================================================================
  143. # * 设定
  144. #==============================================================================
  145.  
  146. module YSE
  147.   module POP_MESSAGE
  148.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  149.     # - 视觉设定 -
  150.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  151.  
  152.     EFFECT2 = { # 开始.
  153.       :bubble_tag_name => "BubbleTag_Speech",
  154.       :thought_bubble_tag_name => "BubbleTag_Thought",
  155.     } # 结束.
  156.   end
  157. end
  158.  
  159. module QUACK
  160.   module MSG
  161.  
  162.     # 闲谈窗口同时显示的最大数量。
  163.     # 太少会限制了你的选择,太多会使画面杂乱。
  164.     MAX_MSGS = 7
  165.  
  166.     # 在这里设定窗口颜色。
  167.     # 格式:
  168.     # '名称' => Tone.new(红,绿,蓝,灰度)
  169.     # 名称为字符,红绿蓝为数字,范围是 -255~255
  170.     # 灰度的范围是 0 到 255. 灰度为可选值,不一定非要写。
  171.     WINDOW_TONES = {
  172.       #在下面手动添加设定
  173.       '土黄' => Tone.new(154,137,108),
  174.       '偏红' => Tone.new(85,44,51),
  175.       '杰克' => Tone.new(-34,85,102),
  176.       '狂人' => Tone.new(68,68,68,10),
  177.       '普尔' => Tone.new(102,34,-34),
  178.       '爱丽丝' => Tone.new(102,34,51),
  179.       # 自己设定更多的
  180.     }
  181.  
  182.     # 在这里设定文本打字音效
  183.     # 格式:
  184.     # '名称' => ["文件名",音量, 最低音调, 最高音调],
  185.     # 名称为字符,文件名为音效文件名
  186.     # 音量音调为数字,范围是 0-100.
  187.     TEXT_SOUNDS = {
  188.       #在下面手动添加设定
  189.       '0' => nil, # 无任何打字音效的默认值!
  190.       '1' => ["Cursor1", 80, 70, 100],
  191.       '2' => ["Cursor1", 80, 90, 120],
  192.       '3' => ["Knock", 80, 50, 75],
  193.       '杰克' => ["Cursor1", 80, 90, 120],
  194.       '狂人' => ["Cursor1", 80, 45, 70],
  195.       '普尔' => ["Cursor1", 80, 70, 100],
  196.       '爱丽丝' => ["Cursor1", 70, 110, 140],
  197.       # And above this line
  198.     }
  199.  
  200.     NAMES = {
  201.       # 设定名称
  202.       '1' => "冒险家杰克",
  203.       '2' => "疯狂实验员"
  204.     }
  205.  
  206.     # 每X个字符播放一次打字音效.
  207.     SOUND_PLAY_FREQUENCY = 3
  208.  
  209.     # 气泡对话框是否在使用选项时随着文本显示而逐渐增大,还是立刻显示为最大尺寸
  210.     POP_CHOICE_GROW = true
  211.  
  212.   end
  213. end
  214.  
  215. #==============================================================================
  216. # * SCRIPT START
  217. #==============================================================================
  218.  
  219. #==============================================================================
  220. # ?! DataManager
  221. #==============================================================================
  222. module DataManager
  223.   class << self
  224.     alias quack_msg_create_game_objects create_game_objects
  225.     def create_game_objects
  226.       quack_msg_create_game_objects
  227.       if !$imported["YSE-PopMessage"]
  228.         msgbox(sprintf("This script(Chatter Messages) requires Yami's Pop Messages to function", "ChatterMessages", 1))
  229.         exit
  230.       end
  231.       $game_message.quack_msg_make
  232.     end
  233.   end
  234. end
  235.  
  236. #==============================================================================
  237. # ?! Game_Message
  238. #==============================================================================
  239. class Game_Message
  240.   attr_accessor :quack_msgs
  241.   attr_accessor :ev_id
  242.  
  243.   # new
  244.   def quack_msg_make
  245.     @quack_msgs = []
  246.     QUACK::MSG::MAX_MSGS.times {@quack_msgs.push(Game_Message.new)}
  247.     @quack_msg_ttl = 0
  248.     @c_msg = 0
  249.   end
  250.   # new
  251.   def set_ttl(ttl)
  252.     @quack_msg_ttl = ttl
  253.   end
  254.   # new
  255.   def ttl_sub
  256.     @quack_msg_ttl -= 1 if @quack_msg_ttl > 0
  257.   end
  258.   # new
  259.   def expire?
  260.     return false if @quack_msg_ttl < 0
  261.     @quack_msg_ttl == 0
  262.   end
  263.   # new
  264.   def prepare_msg(duration)
  265.     @quack_msg_ttl = (duration * 60).to_i
  266.   end
  267.   # new
  268.   def fin_msg
  269.     @quack_msg_ttl = 0
  270.     @c_msg = (@c_msg + 1) % QUACK::MSG::MAX_MSGS
  271.   end
  272.   # new
  273.   def add_chatter(text)
  274.     m = @quack_msgs[@c_msg]
  275.     m.add(text)
  276.     m.face_name = face_name
  277.     m.face_index = face_index
  278.     m.set_ttl(@quack_msg_ttl)
  279.   end
  280.   # new
  281.   def clear_chatter
  282.     @quack_msgs.each {|m| m.set_ttl(0) }
  283.   end
  284.  
  285.   # new
  286.   def clear_chatter_event(e)
  287.     # Find any chatter attached to certain event id and close the chatter
  288.     @quack_msgs.each {|m| m.set_ttl(0) if m.ev_id == e }
  289.   end
  290. end
  291.  
  292. #==============================================================================
  293. # ?! Window_Message
  294. #==============================================================================
  295.  
  296. class Window_Message < Window_Base
  297.  
  298.   # new
  299.   def chatter?
  300.     false
  301.   end
  302.   # new
  303.   def source
  304.     $game_message
  305.   end
  306.   # overwrite
  307.   def standard_padding
  308.     return 8
  309.   end
  310.   # alias
  311.   alias quack_chatter_init initialize
  312.   def initialize
  313.     @msg_tone = $game_system.window_tone
  314.     @snd_f = 0
  315.     #@name_text = ""
  316.     quack_chatter_init
  317.   end
  318.   # new
  319.   def speech_bubble_tag=(sprite)
  320.     @speech_bubble_tag = sprite
  321.   end
  322.   # new
  323.   def thought_bubble_tag=(sprite)
  324.     @thought_bubble_tag = sprite
  325.   end
  326.   # new
  327.   def set_offset_x(x)
  328.     @ox = x
  329.     return ""
  330.   end
  331.   # new
  332.   def set_offset_y(y)
  333.     @oy = y
  334.     return ""
  335.   end
  336.   # overwrite
  337.   def cal_width_line(text)
  338.     result = 0
  339.     text.each_line { |line|
  340.       result = text_size(line).width if result < text_size(line).width
  341.     }
  342.     return result
  343.   end
  344.   # alias
  345.   alias quack_chatter_process_character process_character
  346.   def process_character(c, text, pos)
  347.     if @snd_f == 0 && !@show_fast && !@text_sound.nil?
  348.       Audio.se_play("Audio/SE/"+@text_sound[0],@text_sound[1],@text_sound[2]+rand(@text_sound[3]-@text_sound[2]))
  349.     end
  350.     @snd_f += 1
  351.     @snd_f = 0 if @snd_f == QUACK::MSG::SOUND_PLAY_FREQUENCY
  352.     quack_chatter_process_character(c,text,pos)
  353.   end
  354.   # overwrite
  355.   def update_tone
  356.     self.tone.set(@msg_tone)
  357.   end
  358.   # overwrite
  359.   def message_escape_characters_pop_message(result)
  360.     @msg_tone = $game_system.window_tone
  361.     @event_pop_id = nil
  362.     set_offset_x(0)
  363.     set_offset_y(0)
  364.     @text_sound = QUACK::MSG::TEXT_SOUNDS['0']
  365.     @msg_size_x = 0
  366.     @msg_size_y = 0
  367.     reset_font_settings
  368.  
  369.     result.gsub!(/<BT:([^<>]*)>/i) { event_pop_message_setup2($1, false) }
  370.     result.gsub!(/<BTT:([^<>]*)>/i) { event_pop_message_setup2($1, true) }
  371.     result.gsub!(/\eOX\[([-+]?\d+)\]/i) { set_offset_x($1.to_i) }
  372.     result.gsub!(/\eOY\[([-+]?\d+)\]/i) { set_offset_y($1.to_i) }
  373.     result.gsub!(/\eBM\[([-+]?\d+)\]/i) { event_pop_message_setup($1.to_i, false) }
  374.     result.gsub!(/\eBMT\[([-+]?\d+)\]/i) { event_pop_message_setup($1.to_i, true) }
  375.     result.gsub!(/\eBMF\[(\d+)\]/i) { event_pop_message_setup($1.to_i, false, true) }
  376.     result.gsub!(/\eCBM/i) { event_pop_message_setup(nil, false) }
  377.     result.gsub!(/<BC:([^<>]*)>/i) { @msg_tone = QUACK::MSG::WINDOW_TONES[$1] ;""}
  378.     result.gsub!(/<TS:([^<>]*)>/i) { @text_sound = QUACK::MSG::TEXT_SOUNDS[$1]; ""}
  379.     result.gsub!(/<PMS:([-+]?\d+),([-+]?\d+)>/i) { @msg_size_x = $1.to_i ;@msg_size_y = $2.to_i; ""}
  380.     result
  381.   end
  382.   # new
  383.   def event_pop_message_setup2(tag, thought = false)
  384.     if SceneManager.scene_is?(Scene_Battle)
  385.       if tag.include?('act')
  386.         ev_id = tag[3].to_i
  387.         ev_id = (1+$game_party.members.index($game_actors[ev_id])) * -1
  388.         @msg_tone = QUACK::MSG::WINDOW_TONES[tag] if QUACK::MSG::WINDOW_TONES.has_key?(tag)
  389.         @text_sound = QUACK::MSG::TEXT_SOUNDS[tag] if !thought && QUACK::MSG::TEXT_SOUNDS.has_key?(tag)
  390.       else
  391.         msgbox(sprintf("无任何事件使用标志: '" + tag + "'.","Chatter Messages",1))
  392.       end
  393.       return event_pop_message_setup(ev_id, thought)
  394.     end
  395.     msgbox(sprintf("使用此标志需要你安装Qonvenience.","Chatter Messages",1)) if !$imported["Qonvenience"]
  396.     if tag == 'pl'
  397.       ev_id = 0
  398.     else
  399.       ev_id = $game_map.first_event_tag(tag).id
  400.       msgbox(sprintf("无任何事件使用标志: '" + tag + "'.","Chatter Messages",1)) if ev_id.nil?
  401.     end
  402.     @msg_tone = QUACK::MSG::WINDOW_TONES[tag] if QUACK::MSG::WINDOW_TONES.has_key?(tag)
  403.     @text_sound = QUACK::MSG::TEXT_SOUNDS[tag] if !thought && QUACK::MSG::TEXT_SOUNDS.has_key?(tag)
  404.     namewindow(QUACK::MSG::NAMES[tag], 1) if $imported["YEA-MessageSystem"] && QUACK::MSG::NAMES.has_key?(tag) && @name_text == ""
  405.     return event_pop_message_setup(ev_id, thought)
  406.   end
  407.   # overwrite
  408.   def event_pop_message_setup(event_id, thought = false, follower = false)
  409.     start_name_window if $imported["YEA-MessageSystem"]
  410.     if follower && $game_player.followers[event_id].nil?
  411.       @event_pop_id = nil
  412.       @event_pop_follower = false
  413.       return ""
  414.     end
  415.     if thought # THOUGHT
  416.       @speech_bubble_tag.visible = false
  417.       @bubble_tag = @thought_bubble_tag
  418.     else # SPEECH
  419.       @thought_bubble_tag.visible = false
  420.       @bubble_tag = @speech_bubble_tag
  421.     end
  422.     @event_pop_follower = follower
  423.     @event_pop_id = event_id
  424.     # close any chatter message currently attached to this event
  425.     $game_message.clear_chatter_event(event_id)
  426.     source.ev_id = event_id
  427.     return ""
  428.   end
  429.   # overwrite
  430.   def set_face_position
  431.     #return unless SceneManager.scene_is?(Scene_Map)
  432.     return unless @event_pop_id
  433.     return unless @face_window
  434.     contents.clear
  435.     @face_window.set_face
  436.     return unless $imported["YEA-MessageSystem"]
  437.     return if @face_window.close?
  438.     #@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)
  439.   end
  440.   # overwrite
  441.   def close
  442.     pop_message_close
  443.     #return unless SceneManager.scene_is?(Scene_Map)
  444.     return unless @event_pop_id
  445.     @event_pop_follower = false
  446.     @face_window.hide_face
  447.     return unless YSE::POP_MESSAGE::EFFECT[:use_bubble_tag]
  448.     @speech_bubble_tag.visible = false if @speech_bubble_tag
  449.     @thought_bubble_tag.visible = false if @thought_bubble_tag
  450.     source.ev_id = nil
  451.   end
  452.   # overwrite
  453.   def process_all_text
  454.     @event_pop_id = nil
  455.     @name_text = ""
  456.     txt = convert_escape_characters($game_message.all_text)
  457.     update_placement
  458.     adjust_pop_message(txt)#$game_message.all_text)
  459.     pop_message_process_all_text
  460.   end
  461.   # overwrite
  462.   def update_placement
  463.     if SceneManager.scene_is?(Scene_Map)
  464.       if @event_pop_id.nil?
  465.         fix_default_message
  466.         event_pop_message_update_placement
  467.       elsif @event_pop_id == 0
  468.         character = $game_player
  469.         self.y = character.screen_y + @oy - self.height + YSE::POP_MESSAGE::POSITION[:y_buffer]
  470.         self.x = character.screen_x + @ox - self.width / 2 + YSE::POP_MESSAGE::POSITION[:x_buffer]
  471.         fix_position_bubble(character)
  472.         set_bubble_tag(character)
  473.         @name_window.update_pos if $imported["YEA-MessageSystem"] && @name_window.open?
  474.         @face_window.set_position if !chatter? && @face_window.open?
  475.       elsif @event_pop_id > 0
  476.         hash = @event_pop_follower ? $game_player.followers : $game_map.events
  477.         character = hash[@event_pop_id]
  478.         self.y = character.screen_y + @oy - self.height + YSE::POP_MESSAGE::POSITION[:y_buffer]
  479.         self.x = character.screen_x + @ox - self.width / 2 + YSE::POP_MESSAGE::POSITION[:x_buffer]
  480.         fix_position_bubble(character)
  481.         set_bubble_tag(character)
  482.         @name_window.update_pos if $imported["YEA-MessageSystem"] && @name_window.open?
  483.         @face_window.set_position if !chatter? && @face_window.open?
  484.       end
  485.     else
  486.       # IF IN BATTLE
  487.       #event_pop_message_update_placement
  488.       if @event_pop_id.nil?
  489.         fix_default_message
  490.         event_pop_message_update_placement
  491.       elsif @event_pop_id < 0
  492.         battler = $game_party.members[(@event_pop_id * -1)-1]
  493.         self.y = battler.screen_y + @oy - self.height + YSE::POP_MESSAGE::POSITION[:y_buffer]
  494.         self.x = battler.screen_x + @ox - self.width / 2 + YSE::POP_MESSAGE::POSITION[:x_buffer]
  495.         fix_position_bubble(battler)
  496.         set_bubble_tag(battler)
  497.         @name_window.update_pos if $imported["YEA-MessageSystem"] && @name_window.open?
  498.         @face_window.set_position if !chatter? && @face_window.open?
  499.       elsif @event_pop_id > 0
  500.         battler = $game_troop.members[@event_pop_id-1]
  501.         self.y = battler.screen_y + @oy - self.height + YSE::POP_MESSAGE::POSITION[:y_buffer]
  502.         self.x = battler.screen_x + @ox - self.width / 2 + YSE::POP_MESSAGE::POSITION[:x_buffer]
  503.         fix_position_bubble(battler)
  504.         set_bubble_tag(battler)
  505.         @name_window.update_pos if $imported["YEA-MessageSystem"] && @name_window.open?
  506.         @face_window.set_position if !chatter? && @face_window.open?
  507.       end
  508.     end
  509.   end
  510.   # overwrite
  511.   def fix_default_message
  512.     self.width = window_width
  513.     self.height = window_height
  514.     self.x = 0
  515.     @face_window.hide_face if @face_window
  516.     #create_contents
  517.     return unless YSE::POP_MESSAGE::EFFECT[:use_bubble_tag]
  518.     @speech_bubble_tag.visible = false if @speech_bubble_tag
  519.     @thought_bubble_tag.visible = false if @thought_bubble_tag
  520.   end
  521.   # overwrite
  522.   def fix_position_bubble(character)
  523.     end_x = self.x + self.width
  524.     end_y = self.y + self.height
  525.     self.x = 0 if self.x < 0
  526.     self.y = character.screen_y + @oy if self.y < 0
  527.     self.y = -99 if self.y < 0
  528.     self.x = Graphics.width - self.width if end_x > Graphics.width
  529.     self.y = Graphics.height - self.height if end_y > Graphics.height
  530.   end
  531.   # overwrite
  532.   def set_bubble_tag(character)
  533.     return unless YSE::POP_MESSAGE::EFFECT[:use_bubble_tag]
  534.     return unless @bubble_tag
  535.     up = self.y == character.screen_y + @oy
  536.     if self.y == -99
  537.       self.y = 0
  538.       up = true
  539.     end
  540.     self.y += up ? @bubble_tag.height / 2 : -@bubble_tag.height / 2
  541.     @bubble_tag.x = character.screen_x + @ox - @bubble_tag.width / 2
  542.     if up
  543.       @bubble_tag.src_rect.set(0, @bubble_tag.height, @bubble_tag.width, @bubble_tag.height)
  544.       @bubble_tag.y = self.y - @bubble_tag.height - YSE::POP_MESSAGE::POSITION[:tag_y_buffer]
  545.     else
  546.       @bubble_tag.src_rect.set(0, 0, @bubble_tag.width, @bubble_tag.height)
  547.       @bubble_tag.y = self.y + self.height + YSE::POP_MESSAGE::POSITION[:tag_y_buffer]
  548.     end
  549.     @bubble_tag.z = self.z + 1000
  550.   end
  551.   # overwrite
  552.   def adjust_pop_message(text = " ")
  553.     #return unless SceneManager.scene_is?(Scene_Map)
  554.     unless @event_pop_id
  555.       if $imported["YEA-MessageSystem"]
  556.         #adjust_message_window_size
  557.       end
  558.       return
  559.     end
  560.     n_line = cal_number_line(text)
  561.     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]
  562.     @real_lines = n_line
  563.     self.height = fitting_height(n_line)
  564.     self.height += @msg_size_y
  565.     self.width = cal_width_line(text) + 10
  566.     self.width += @msg_size_x
  567.     self.width += new_line_x
  568.     if self.width > YSE::POP_MESSAGE::LIMIT[:limit_width] && YSE::POP_MESSAGE::LIMIT[:limit_width] > 0
  569.       self.width = YSE::POP_MESSAGE::LIMIT[:limit_width]
  570.     end
  571.     if $game_message.choice? && !QUACK::MSG::POP_CHOICE_GROW
  572.       dy = fitting_height($game_message.choices.size) - 16
  573.       self.y -= dy - 16
  574.       self.height += dy - 16
  575.       @face_window.y -= dy - 16
  576.       @name_window.y -= dy - 16 if $imported["YEA-MessageSystem"]
  577.     end
  578.     # If a chatter message with face graphic, force height to be at least big enough to show the face.
  579.     if chatter? && !source.face_name.empty?
  580.       self.height = [self.height, 86].max
  581.     end
  582.  
  583.     create_contents
  584.     update_placement
  585.   end
  586.   # alias
  587.   alias yse_pop_dispose dispose
  588.   def dispose
  589.     @speech_bubble_tag.visible = false if @speech_bubble_tag
  590.     @thought_bubble_tag.visible = false if @thought_bubble_tag
  591.     yse_pop_dispose
  592.   end
  593.   # alias
  594.   alias chatter_msg_input_choice input_choice
  595.   def input_choice
  596.     if !close? && pop_message? && QUACK::MSG::POP_CHOICE_GROW
  597.       f = Fiber.new { add_room_for_choices }
  598.       @choice_window.visible = false
  599.       @choice_window.set_fiber(f)
  600.       f.resume
  601.     end
  602.     chatter_msg_input_choice
  603.   end
  604.   # new
  605.   def add_room_for_choices
  606.     q = fitting_height($game_message.choices.size) - 16
  607.     i = 0
  608.     while true
  609.       i += 4
  610.       self.y -= 4
  611.       self.height += 4
  612.       @face_window.y -= 4
  613.       @name_window.y -= 4 if $imported["YEA-MessageSystem"]
  614.       break if i >= q
  615.       Fiber.yield
  616.     end
  617.     @choice_window.visible = true
  618.     @choice_window.set_fiber(nil)
  619.   end
  620.   # new
  621.   def pop_message?
  622.     @event_pop_id
  623.   end
  624. end
  625.  
  626. #==============================================================================
  627. # ?! Window_ChoiceList
  628. #==============================================================================
  629. class Window_ChoiceList < Window_Command
  630.   # alias
  631.   alias chatter_msg_init initialize
  632.   def initialize(message_window)
  633.     chatter_msg_init(message_window)
  634.     self.opacity = 0
  635.     self.z = 20070
  636.   end
  637.   # new
  638.   def set_fiber(fiber)
  639.     @fiber = fiber
  640.   end
  641.   # alias
  642.   alias chatter_msg_update update
  643.   def update
  644.     chatter_msg_update
  645.     @fiber.resume if @fiber
  646.   end
  647.   # alias
  648.   alias chatter_msg_update_placement update_placement
  649.   def update_placement
  650.     if @message_window.pop_message?
  651.       self.opacity = 0
  652.       self.width = @message_window.width-26 + padding * 2
  653.       self.width = [width, Graphics.width].min
  654.       self.height = fitting_height($game_message.choices.size)
  655.       self.x = @message_window.x
  656.       self.y = @message_window.y+@message_window.height-self.height+6
  657.     else
  658.       self.opacity = 255
  659.       chatter_msg_update_placement
  660.     end
  661.   end
  662. end
  663.  
  664. class Window_NameMessage < Window_Base
  665.   #def hide_me
  666.   #  self.x = 99999
  667.   #  self.y = 99999
  668.   #end
  669. end
  670.  
  671. #==============================================================================
  672. # ■ Window_NameMessage
  673. #==============================================================================
  674. class Window_NameMessage < Window_Base
  675.   # alias
  676.   alias quack_msg_name_init initialize
  677.   def initialize(message_window)
  678.     quack_msg_name_init(message_window)
  679.     self.z += 2
  680.   end
  681.   # new
  682.   def update_pos
  683.     set_x_position(1)
  684.     #set_y_position
  685.     self.y = @message_window.y - self.height / 1.25
  686.     self.y = 0 if self.y < 0
  687.   end
  688.   # overwrite
  689.       #  self.y = @message_window.height
  690.       #  self.y -= YEA::MESSAGE::NAME_WINDOW_Y_BUFFER
  691.       #else
  692.       #  self.y = @message_window.y - self.height / 1.25
  693.       #  self.y += YEA::MESSAGE::NAME_WINDOW_Y_BUFFER
  694.       #end
  695. end
  696.  
  697. #==============================================================================
  698. # ¡ Window_Message_Face
  699. #==============================================================================
  700.  
  701. class Window_Message_Face < Window_Base
  702.   alias quack_msg_face_pos set_position
  703.   def set_position
  704.     quack_msg_face_pos
  705.     self.y -= 4
  706.   end
  707. end
  708.  
  709. #==============================================================================
  710. # ?! Window_Quack_Message
  711. #==============================================================================
  712. class Window_Quack_Message < Window_Message
  713.   attr_accessor :active
  714.  
  715.   # overwrite
  716.   def initialize(msg_source, zz)
  717.     super()
  718.     self.z = zz
  719.     @quack_msg_source = msg_source
  720.     @active = false
  721.     @background = 0
  722.     self.opacity = 255
  723.     self.visible = false
  724.     clear_name_window if $imported["YEA-MessageSystem"]
  725.   end
  726.   # overwrite
  727.   def chatter?
  728.     true
  729.   end
  730.   # overwrite
  731.   def source
  732.     @quack_msg_source
  733.   end
  734.   # overwrite
  735.   def update
  736.     if @quack_msg_source.busy?
  737.       if @quack_msg_source.expire?
  738.         close
  739.       else
  740.         self.visible = true if !self.visible
  741.         @quack_msg_source.ttl_sub
  742.       end
  743.     end
  744.     self.visible = false if self.visible && close?
  745.     super
  746.   end
  747.   # overwrite
  748.   def update_placement
  749.     return if @closing
  750.     super
  751.   end
  752.   # overwrite
  753.   def update_show_fast
  754.     return false
  755.   end
  756.   # overwrite
  757.   def process_all_text
  758.     @event_pop_id = nil
  759.     text = convert_escape_characters(@quack_msg_source.all_text)
  760.     update_placement
  761.     adjust_pop_message(text)
  762.     open_and_wait
  763.     #text = convert_escape_characters(@quack_msg_source.all_text)
  764.     pos = {}
  765.     new_page(text, pos)
  766.     process_character(text.slice!(0, 1), text, pos) until text.empty? || close?
  767.   end
  768.   # overwrite
  769.   def close
  770.     pop_message_close #super
  771.     return unless @event_pop_id
  772.     return unless YSE::POP_MESSAGE::EFFECT[:use_bubble_tag]
  773.     @speech_bubble_tag.visible = false if @speech_bubble_tag
  774.     @thought_bubble_tag.visible = false if @thought_bubble_tag
  775.     source.ev_id = nil
  776.     @name_text = ""
  777.   end
  778.   # overwrite
  779.   def input_pause
  780.     self.pause = true
  781.     wait(10)
  782.     Fiber.yield until close?
  783.     self.pause = false
  784.   end
  785.   # overwrite
  786.   def update_fiber
  787.     if @fiber
  788.       @fiber.resume
  789.     elsif @quack_msg_source.busy?
  790.       @fiber = Fiber.new { fiber_main }
  791.       @fiber.resume
  792.     else
  793.       @quack_msg_source.visible = false
  794.     end
  795.   end
  796.   def fiber_main
  797.     @quack_msg_source.visible = true
  798.     #update_background
  799.     update_placement
  800.     loop do
  801.       process_all_text if @quack_msg_source.has_text?
  802.       process_input
  803.       @quack_msg_source.clear
  804.       @name_window.start_close if $imported["YEA-MessageSystem"]
  805.       Fiber.yield
  806.       break unless text_continue?
  807.     end
  808.     close_and_wait
  809.     @quack_msg_source.visible = false
  810.     @fiber = nil
  811.   end
  812.   #def update_background
  813.   #  @background = @quack_msg_source.background
  814.   #  self.opacity = @background == 0 ? 255 : 0
  815.   #end
  816.   def process_input
  817.     input_pause unless @pause_skip
  818.   end
  819.   def text_continue?
  820.     @quack_msg_source.has_text?# && !settings_changed?
  821.   end
  822.   def settings_changed?
  823.     #@background != $game_message.background ||
  824.     #@position != @quack_msg_source.position
  825.     false
  826.   end
  827.   def new_page(text, pos)
  828.     contents.clear
  829.     draw_face(@quack_msg_source.face_name, @quack_msg_source.face_index, 0, 0)
  830.     reset_font_settings
  831.     pos[:x] = new_line_x
  832.     pos[:y] = 0
  833.     pos[:new_x] = new_line_x
  834.     pos[:height] = calc_line_height(text)
  835.     clear_flags
  836.   end
  837.   def new_line_x
  838.     @quack_msg_source.face_name.empty? ? 0 : 112
  839.   end
  840.   # overwrite
  841.   def input_pause
  842.     #self.pause = true
  843.     wait(10)
  844.     Fiber.yield until @quack_msg_source.expire? #Input.trigger?(:B) || Input.trigger?(:C)
  845.     #Input.update
  846.     #self.pause = false
  847.   end
  848.  
  849.   # overwrite
  850.   def create_all_windows
  851.     @name_window = Window_NameMessage.new(self) if $imported["YEA-MessageSystem"]
  852.   end
  853.   # overwrite
  854.   def dispose_all_windows
  855.     @name_window.dispose if $imported["YEA-MessageSystem"]
  856.   end
  857.   # overwrite
  858.   def update_all_windows
  859.     if $imported["YEA-MessageSystem"]
  860.       @name_window.update
  861.       @name_window.back_opacity = self.back_opacity
  862.       @name_window.opacity = self.opacity
  863.     end
  864.   end
  865.   # overwrite
  866.   def event_pop_message_update_placement
  867.   end
  868.   # overwrite
  869.   def all_close?
  870.     close? && (!$imported["YEA-MessageSystem"] || @name_window.close?)
  871.   end
  872.  
  873.   if $imported["YEA-MessageSystem"]
  874.     def close_and_wait
  875.       @name_window.force_close
  876.       window_message_close_and_wait_ams
  877.     end
  878.   end
  879. end
  880.  
  881. #==============================================================================
  882. # ?! Scene_Map
  883. #==============================================================================
  884.  
  885. class Scene_Map < Scene_Base
  886.   # alias
  887.   alias quack_msg_update update
  888.   def update
  889.     @quack_msgs.each {|m|
  890.       m.update
  891.       if m.open?
  892.         m.update_placement
  893.       end
  894.     }
  895.     @message_window.update_placement if @message_window.open?
  896.     quack_msg_update
  897.   end
  898.   # overwrite
  899.   def create_message_window
  900.     yse_pm_create_message_window
  901.     @face_window = Window_Message_Face.new
  902.     @face_window.message_window = @message_window
  903.     if @bubble_tag_sprite || @thought_bubble_tag_sprite
  904.     @bubble_tag_sprite.dispose
  905.     @thought_bubble_tag_sprite.dispose
  906.     end
  907.     if YSE::POP_MESSAGE::EFFECT[:use_bubble_tag]
  908.       @bubble_tag_sprite = Sprite.new
  909.       @bubble_tag_sprite.visible = false
  910.       @bubble_tag_sprite.bitmap = Cache.system(YSE::POP_MESSAGE::EFFECT2[:bubble_tag_name])
  911.       @bubble_tag_sprite.src_rect.set(0, 0, @bubble_tag_sprite.width, @bubble_tag_sprite.height / 2)
  912.       @message_window.speech_bubble_tag = @bubble_tag_sprite
  913.  
  914.       @thought_bubble_tag_sprite = Sprite.new
  915.       @thought_bubble_tag_sprite.visible = false
  916.       @thought_bubble_tag_sprite.bitmap = Cache.system(YSE::POP_MESSAGE::EFFECT2[:thought_bubble_tag_name])
  917.       @thought_bubble_tag_sprite.src_rect.set(0, 0, @thought_bubble_tag_sprite.width, @thought_bubble_tag_sprite.height / 2)
  918.       @message_window.thought_bubble_tag = @thought_bubble_tag_sprite
  919.     end
  920.     @message_window.face_window = @face_window
  921.  
  922.     quack_msg_create_msg
  923.   end
  924.   # new
  925.   def quack_msg_create_msg
  926.     unless @quack_msgs.nil?
  927.       @quack_msgs.each {|m| m.dispose}
  928.       @quack_msg_speech_bubble_sprites.each {|s| s.dispose}
  929.       @quack_msg_thought_bubble_sprites.each {|s| s.dispose}
  930.     end
  931.     @quack_msgs = []
  932.     @quack_faces = []
  933.     @quack_msg_speech_bubble_sprites = []
  934.     @quack_msg_thought_bubble_sprites = []
  935.     QUACK::MSG::MAX_MSGS.times do |i|
  936.       qm = Window_Quack_Message.new($game_message.quack_msgs[i], 200-QUACK::MSG::MAX_MSGS+i)
  937.       @quack_msgs.push(qm)
  938.       ss = Sprite.new
  939.       ss.visible = false
  940.       ss.bitmap = Cache.system(YSE::POP_MESSAGE::EFFECT2[:bubble_tag_name])
  941.       ss.src_rect.set(0, 0, ss.width, ss.height / 2)
  942.       qm.speech_bubble_tag = ss
  943.       ts = Sprite.new
  944.       ts.visible = false
  945.       ts.bitmap = Cache.system(YSE::POP_MESSAGE::EFFECT2[:thought_bubble_tag_name])
  946.       ts.src_rect.set(0, 0, ts.width, ts.height / 2)
  947.       qm.thought_bubble_tag = ts
  948.     end
  949.   end
  950.   # overwrite
  951.   def dispose_spriteset
  952.     pop_message_dispose_spriteset
  953.     #@quack_msg_speech_bubble_sprites.each {|s| s.dispose}
  954.     #@quack_msg_thought_bubble_sprites.each {|s| s.dispose}
  955.     #return unless @bubble_tag_sprite || @thought_bubble_tag_sprite
  956.     #@bubble_tag_sprite.dispose
  957.     #@thought_bubble_tag_sprite.dispose
  958.   end
  959.   # alias
  960.   #alias quack_msg_dispose_all_windows dispose_all_windows
  961.   #def dispose_all_windows
  962.   #  @quack_msgs.each {|m| m.dispose}
  963.   #  quack_msg_dispose_all_windows
  964.   #end
  965. end
  966.  
  967. #==============================================================================
  968. # ?! Scene_Battle
  969. #==============================================================================
  970. class Scene_Battle
  971.   alias quack_update_basic update_basic
  972.   def update_basic
  973.     quack_update_basic
  974.     @quack_msgs.each {|m|
  975.       m.update
  976.       if m.open?
  977.         m.update_placement
  978.       end
  979.     }
  980.   end
  981.  
  982.   alias yse_pop_create_message_window create_message_window
  983.   def create_message_window
  984.     yse_pop_create_message_window
  985.     @face_window = Window_Message_Face.new
  986.     @face_window.message_window = @message_window
  987.     if YSE::POP_MESSAGE::EFFECT[:use_bubble_tag]
  988.       @bubble_tag_sprite = Sprite.new
  989.       @bubble_tag_sprite.visible = false
  990.       @bubble_tag_sprite.bitmap = Cache.system(YSE::POP_MESSAGE::EFFECT2[:bubble_tag_name])
  991.       @bubble_tag_sprite.src_rect.set(0, 0, @bubble_tag_sprite.width, @bubble_tag_sprite.height / 2)
  992.       @message_window.speech_bubble_tag = @bubble_tag_sprite
  993.  
  994.       @thought_bubble_tag_sprite = Sprite.new
  995.       @thought_bubble_tag_sprite.visible = false
  996.       @thought_bubble_tag_sprite.bitmap = Cache.system(YSE::POP_MESSAGE::EFFECT2[:thought_bubble_tag_name])
  997.       @thought_bubble_tag_sprite.src_rect.set(0, 0, @thought_bubble_tag_sprite.width, @thought_bubble_tag_sprite.height / 2)
  998.       @message_window.thought_bubble_tag = @thought_bubble_tag_sprite
  999.  
  1000.     end
  1001.     @message_window.face_window = @face_window
  1002.  
  1003.     quack_create_message_window
  1004.   end
  1005.  
  1006.   def quack_create_message_window
  1007.     @quack_msgs = []
  1008.     @quack_msg_speech_bubble_sprites = []
  1009.     @quack_msg_thought_bubble_sprites = []
  1010.     QUACK::MSG::MAX_MSGS.times do |i|
  1011.       qm = Window_Quack_Message.new($game_message.quack_msgs[i], 200-QUACK::MSG::MAX_MSGS+i)
  1012.       @quack_msgs.push(qm)
  1013.       ss = Sprite.new
  1014.       ss.visible = false
  1015.       ss.bitmap = Cache.system(YSE::POP_MESSAGE::EFFECT2[:bubble_tag_name])
  1016.       ss.src_rect.set(0, 0, ss.width, ss.height / 2)
  1017.       qm.speech_bubble_tag = ss
  1018.       ts = Sprite.new
  1019.       ts.visible = false
  1020.       ts.bitmap = Cache.system(YSE::POP_MESSAGE::EFFECT2[:thought_bubble_tag_name])
  1021.       ts.src_rect.set(0, 0, ts.width, ts.height / 2)
  1022.       qm.thought_bubble_tag = ts
  1023.     end
  1024.   end
  1025.  
  1026.   alias yse_pop_dispose_spriteset dispose_spriteset
  1027.   def dispose_spriteset
  1028.     yse_pop_dispose_spriteset
  1029.     @quack_msg_speech_bubble_sprites.each {|s| s.dispose}
  1030.     @quack_msg_thought_bubble_sprites.each {|s| s.dispose}
  1031.     return unless @bubble_tag_sprite || @thought_bubble_tag_sprite
  1032.     @bubble_tag_sprite.dispose
  1033.     @thought_bubble_tag_sprite.dispose
  1034.   end
  1035.  
  1036.   alias quack_msg_dispose_all_windows dispose_all_windows
  1037.   def dispose_all_windows
  1038.     @quack_msgs.each {|m| m.dispose}
  1039.     quack_msg_dispose_all_windows
  1040.   end
  1041. end
  1042.  
  1043. #==============================================================================
  1044. # ?! Game_Interpreter
  1045. #==============================================================================
  1046. class Game_Interpreter
  1047.   def command_101
  1048.     item = $data_items[20]
  1049.     if $imported["YEA-MessageSystem"]
  1050.       wait_for_message
  1051.       $game_message.face_name = @params[0]
  1052.       $game_message.face_index = @params[1]
  1053.       $game_message.background = @params[2]
  1054.       $game_message.position = @params[3]
  1055.  
  1056.       startindex = @index+1
  1057.       textline = @list[startindex].parameters[0].dup
  1058.       chatdur = 0
  1059.       textline.gsub!(/<cm:([^<>]*)>/i) { chatdur = $1.to_i;"" }
  1060.       $game_message.prepare_msg(chatdur) if chatdur != 0
  1061.       while continue_message_string?
  1062.         @index += 1
  1063.         if @list[@index].code == 401
  1064.           textline = @list[@index].parameters[0] unless @index == startindex
  1065.           if chatdur != 0; $game_message.add_chatter(textline)
  1066.           else; $game_message.add(textline)
  1067.           end
  1068.         end
  1069.         break if $game_message.texts.size >= Variable.message_rows
  1070.       end
  1071.       case next_event_code
  1072.       when 102
  1073.         @index += 1
  1074.         setup_choices(@list[@index].parameters)
  1075.       when 103
  1076.         @index += 1
  1077.         setup_num_input(@list[@index].parameters)
  1078.       when 104
  1079.         @index += 1
  1080.         setup_item_choice(@list[@index].parameters)
  1081.       end
  1082.       $game_message.fin_msg if chatdur != 0
  1083.       wait_for_message
  1084.     else
  1085.       wait_for_message
  1086.       $game_message.face_name = @params[0]
  1087.       $game_message.face_index = @params[1]
  1088.       $game_message.background = @params[2]
  1089.       $game_message.position = @params[3]
  1090.  
  1091.       startindex = @index+1
  1092.       textline = @list[startindex].parameters[0].dup
  1093.       chatdur = 0
  1094.       textline.gsub!(/<cm:([^<>]*)>/i) { chatdur = $1.to_i;"" }
  1095.       $game_message.prepare_msg(chatdur) if chatdur != 0
  1096.  
  1097.       while next_event_code == 401       # Text data
  1098.         @index += 1
  1099.         textline = @list[@index].parameters[0] unless @index == startindex
  1100.         if chatdur != 0; $game_message.add_chatter(textline)
  1101.         else; $game_message.add(textline)
  1102.         end
  1103.       end
  1104.       case next_event_code
  1105.       when 102  # Show Choices
  1106.         @index += 1
  1107.         setup_choices(@list[@index].parameters)
  1108.       when 103  # Input Number
  1109.         @index += 1
  1110.         setup_num_input(@list[@index].parameters)
  1111.       when 104  # Select Item
  1112.         @index += 1
  1113.         setup_item_choice(@list[@index].parameters)
  1114.       end
  1115.       $game_message.fin_msg if chatdur != 0
  1116.       wait_for_message
  1117.     end
  1118.   end
  1119.   # new
  1120.   def clear_chatter
  1121.     $game_message.clear_chatter
  1122.   end
  1123. end
  1124.  
  1125. #==============================================================================
  1126. #
  1127. # ?\ End of File
  1128. #
  1129. #==============================================================================




原脚本下载链接在此
[url= http://rpg.blue/forum.php?mod=vi ... 6&fromuid=13864 (出处: Project1)[/url]

最佳答案

查看完整内容

粗略看了一下,475-478行 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][/pre] 我觉得可能是$game_player.followers为空或者是事件数量不同导致了这个错误 试一下在478行前面加一行 return unless character[/pre] ...

Lv5.捕梦者

梦石
10
星屑
39440
在线时间
1914 小时
注册时间
2010-11-14
帖子
3315

R考场第七期纪念奖

发表于 2019-2-28 23:51:13 | 显示全部楼层
本帖最后由 KB.Driver 于 2019-3-1 11:57 编辑

粗略看了一下,475-478行
RUBY 代码复制
  1. elsif @event_pop_id > 0
  2.         hash = @event_pop_follower ? $game_player.followers : $game_map.events
  3.         character = hash[@event_pop_id]
  4.         self.y = character.screen_y + @oy - self.height + YSE::POP_MESSAGE::POSITION[:y_buffer]

我觉得可能是$game_player.followers为空或者是事件数量不同导致了这个错误
试一下在478行前面加一行
RUBY 代码复制
  1. return unless character

评分

参与人数 1+1 收起 理由
RMVXA + 1 塞糖

查看全部评分

用头画头像,用脚写脚本
回复

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
2289
在线时间
149 小时
注册时间
2009-1-7
帖子
4
 楼主| 发表于 2019-3-1 21:57:50 | 显示全部楼层
问题解决,感谢大佬!
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-3-28 21:18

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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