对话框显示行数扩展脚本与下方脚本搭配使用,应该就是你要的效果了
[pre lang="ruby"]#简单文章打字音效 v1.0.1
#----------#
#功能: 让文章显示时播放不同音调的打字音效. 很棒!
#
#使用方法: 即插即用, 下面是可用脚本:
#
# message_freq(数值) - 改变频率
# message_se("文件名") - 改变打字音效
# message_volume(数值) - 改变音量
# message_pitch([最小值,最大值]) - 改变音调范围
# message_set(文件名,音量,音调) - 一次设定文件名音量和音调
# message_set(文件名,音量,音调,频率) - 同上,但是增加了频率
#
#----------#
#-- Script by: V.M of D.T
#
#- Questions or comments can be:
# posted on the thread for the script
# given by email: sumptuaryspade@live.ca
# provided on facebook: http://www.facebook.com/DaimoniousTailsGames
# All my other scripts and projects can be found here: http://daimonioustails.weebly.com/
#
#- Free to use in any project with credit given, donations always welcome!
alias mse_clear_instance_variables clear_instance_variables
def clear_instance_variables
mse_clear_instance_variables
@key_timer = 0
reset_se_variables
end
def reset_se_variables
@se = DEFAULT_AUDIO_SOUND
@volume = DEFAULT_AUDIO_VOLUME
@pitch = DEFAULT_AUDIO_PITCH
@freq = DEFAULT_SE_FREQ
end
def process_normal_character(c, pos)
super
if !$game_options.nil?
return wait_for_one_character unless $game_options.message_se
end
if @key_timer % @freq == 0
Audio.se_play("Audio/SE/" + @se, @volume, rand(@pitch[1]-@pitch[0]) + @pitch[0])
end
@key_timer += 1
wait_for_one_character
end
end
class Scene_Map
attr_accessor :message_window
end
class Game_Interpreter
def message_set(string, value, array, freq = -1)
message_se(string)
message_volume(value)
message_pitch(array)
message_freq(freq) if freq >= 0
end
def message_freq(value)
SceneManager.scene.message_window.freq = value
end
def message_se(string)
SceneManager.scene.message_window.se = string
end
def message_pitch(array)
SceneManager.scene.message_window.pitch = array
end
def message_volume(value)
SceneManager.scene.message_window.volume = value
end
def message_reset
SceneManager.scene.message_window.reset_se_variables
end
end[/pre]