Project1

标题: 在脚本编辑器实现每出现一句对话就演奏一次效果音 [打印本页]

作者: stella    时间: 2015-6-7 09:27
标题: 在脚本编辑器实现每出现一句对话就演奏一次效果音
本帖最后由 stella 于 2015-6-7 09:37 编辑

每出现一句对话的同时,演奏一次效果音,如果不在事件里设置,在脚本编辑器里设置,应该在哪里写?
作者: 芯☆淡茹水    时间: 2015-6-7 09:45
对话框一出现就播放SE
  1. #==============================================================================
  2. class Scene_Map
  3.   #--------------------------------------------------------------------------
  4.   alias old_update_xdrs update
  5.   def update
  6.     if @data_showing != $game_temp.message_window_showing
  7.       @data_showing = $game_temp.message_window_showing
  8.       Audio.se_play("Audio/SE/文件名", 100, 100) if @data_showing
  9.     end
  10.     old_update_xdrs
  11.   end
  12. end
  13. #==============================================================================
复制代码

作者: stella    时间: 2015-6-7 13:51
本帖最后由 stella 于 2015-6-7 14:16 编辑
芯☆淡茹水 发表于 2015-6-7 09:45
对话框一出现就播放SE


那么能否用脚本实现在每句对话切换的间隙演奏一次音效


作者: 芯☆淡茹水    时间: 2015-6-7 16:29
这个没试过
  1. class Interpreter
  2.   #--------------------------------------------------------------------------
  3.   # ● 显示文章
  4.   #--------------------------------------------------------------------------
  5.   def command_101
  6.     # 另外的文章已经设置过 message_text 的情况下
  7.     if $game_temp.message_text != nil
  8.       # 结束
  9.       return false
  10.     end
  11.     Audio.se_play("Audio/SE/文件名", 100, 100) ####################
  12.     # 设置信息结束后待机和返回调用标志
  13.     @message_waiting = true
  14.     $game_temp.message_proc = Proc.new { @message_waiting = false }
  15.     # message_text 设置为 1 行
  16.     $game_temp.message_text = @list[@index].parameters[0] + "\n"
  17.     line_count = 1
  18.     # 循环
  19.     loop do
  20.       # 下一个事件指令为文章两行以上的情况
  21.       if @list[@index+1].code == 401
  22.         # message_text 添加到第 2 行以下
  23.         $game_temp.message_text += @list[@index+1].parameters[0] + "\n"
  24.         line_count += 1
  25.       # 事件指令不在文章两行以下的情况
  26.       else
  27.         # 下一个事件指令为显示选择项的情况下
  28.         if @list[@index+1].code == 102
  29.           # 如果选择项能收纳在画面里
  30.           if @list[@index+1].parameters[0].size <= 4 - line_count
  31.             # 推进索引
  32.             @index += 1
  33.             # 设置选择项
  34.             $game_temp.choice_start = line_count
  35.             setup_choices(@list[@index].parameters)
  36.           end
  37.         # 下一个事件指令为处理输入数值的情况下
  38.         elsif @list[@index+1].code == 103
  39.           # 如果数值输入窗口能收纳在画面里
  40.           if line_count < 4
  41.             # 推进索引
  42.             @index += 1
  43.             # 设置输入数值
  44.             $game_temp.num_input_start = line_count
  45.             $game_temp.num_input_variable_id = @list[@index].parameters[0]
  46.             $game_temp.num_input_digits_max = @list[@index].parameters[1]
  47.           end
  48.         end
  49.         # 继续
  50.         return true
  51.       end
  52.       # 推进索引
  53.       @index += 1
  54.     end
  55.   end
  56. end
复制代码





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