Project1
标题:
在脚本编辑器实现每出现一句对话就演奏一次效果音
[打印本页]
作者:
stella
时间:
2015-6-7 09:27
标题:
在脚本编辑器实现每出现一句对话就演奏一次效果音
本帖最后由 stella 于 2015-6-7 09:37 编辑
每出现一句对话的同时,演奏一次效果音,如果不在事件里设置,在脚本编辑器里设置,应该在哪里写?
作者:
芯☆淡茹水
时间:
2015-6-7 09:45
对话框一出现就播放SE
#==============================================================================
class Scene_Map
#--------------------------------------------------------------------------
alias old_update_xdrs update
def update
if @data_showing != $game_temp.message_window_showing
@data_showing = $game_temp.message_window_showing
Audio.se_play("Audio/SE/文件名", 100, 100) if @data_showing
end
old_update_xdrs
end
end
#==============================================================================
复制代码
作者:
stella
时间:
2015-6-7 13:51
本帖最后由 stella 于 2015-6-7 14:16 编辑
芯☆淡茹水 发表于 2015-6-7 09:45
对话框一出现就播放SE
那么能否用脚本实现在每句对话切换的间隙演奏一次音效
3.JPG
(35.16 KB, 下载次数: 31)
下载附件
保存到相册
2015-6-7 13:49 上传
作者:
芯☆淡茹水
时间:
2015-6-7 16:29
这个没试过
class Interpreter
#--------------------------------------------------------------------------
# ● 显示文章
#--------------------------------------------------------------------------
def command_101
# 另外的文章已经设置过 message_text 的情况下
if $game_temp.message_text != nil
# 结束
return false
end
Audio.se_play("Audio/SE/文件名", 100, 100) ####################
# 设置信息结束后待机和返回调用标志
@message_waiting = true
$game_temp.message_proc = Proc.new { @message_waiting = false }
# message_text 设置为 1 行
$game_temp.message_text = @list[@index].parameters[0] + "\n"
line_count = 1
# 循环
loop do
# 下一个事件指令为文章两行以上的情况
if @list[@index+1].code == 401
# message_text 添加到第 2 行以下
$game_temp.message_text += @list[@index+1].parameters[0] + "\n"
line_count += 1
# 事件指令不在文章两行以下的情况
else
# 下一个事件指令为显示选择项的情况下
if @list[@index+1].code == 102
# 如果选择项能收纳在画面里
if @list[@index+1].parameters[0].size <= 4 - line_count
# 推进索引
@index += 1
# 设置选择项
$game_temp.choice_start = line_count
setup_choices(@list[@index].parameters)
end
# 下一个事件指令为处理输入数值的情况下
elsif @list[@index+1].code == 103
# 如果数值输入窗口能收纳在画面里
if line_count < 4
# 推进索引
@index += 1
# 设置输入数值
$game_temp.num_input_start = line_count
$game_temp.num_input_variable_id = @list[@index].parameters[0]
$game_temp.num_input_digits_max = @list[@index].parameters[1]
end
end
# 继续
return true
end
# 推进索引
@index += 1
end
end
end
复制代码
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1