So, I'm using a script I found here, and it works well enough, absolutely gets the job done, but I'm wondering if there's a way to allow it to use multiple sounds or pitches of the same sound instead of just one sound per variable count. I would also accept the use of another script, since I do know about and have downloaded modern algebra's Advanced Text System. Thanks in advance!
Edit Text Sound Script to Use Multiple Sounds/Pitches???
RGSS3 Script RequestsHow do you want it to work?
Randomly pick a sound by making it an array? (all the same sound but you change the pitch)
Using extra variables for the pitch or volume?
Some other way?
This would probably be the best solution, since I could use that to have some arrays that just use different sounds as well.
Didn't work as an array, made it a hash instead.
Ruby:
#==============================================================================
# Text Sound Effect (version 3)
# NEW FEATURE: randomly pick a sound
#------------------------------------------------------------------------------
# by Zerbu
#==============================================================================
module Text_Sound_Effect
#--------------------------------------------------------------------------
# Options
#--------------------------------------------------------------------------
# The sound effect to play
MESSAGE_SOUND = {
0 => {0 => RPG::SE.new("Knock", 70, 80),
1 => RPG::SE.new("Knock", 70, 90),
},
1 => {0 => RPG::SE.new("Cursor1", 70, 80),
1 => RPG::SE.new("Cursor1", 70, 90),
},
2 => {0 => RPG::SE.new("Cursor2", 70, 80),
1 => RPG::SE.new("Cursor2", 70, 90),
},
}
# ID of the Variable that stores the current sound
SOUND_VAR = 1
# The number of characters to display before each time the sound plays
# The default is 3, it's recommended you keep it as this unless you
# know what you're doing
MESSAGE_SOUND_FRAMES = 3
# Switch to disable sound effect
# If you need to turn off the sound effect for any part of the game,
# turn this switch on
MESSAGE_SOUND_DISABLE = 2
end
class Window_Base < Window
include Text_Sound_Effect
#--------------------------------------------------------------------------
# alias method: process_characer
#--------------------------------------------------------------------------
alias textsound_process_character_normal process_character
def process_character(c, text, pos)
if !$game_switches[MESSAGE_SOUND_DISABLE]
#---
if !defined?(@sound_frames)
@sound_frames = 0
end
#---
if @sound_frames == 0
r = rand(MESSAGE_SOUND[$game_variables[SOUND_VAR]].size)
MESSAGE_SOUND[$game_variables[SOUND_VAR]][r].play
end
#---
@sound_frames+=1
#---
if @sound_frames == MESSAGE_SOUND_FRAMES
@sound_frames = 0
end
#---
end
textsound_process_character_normal(c, text, pos)
end
#---
end
I think that works like a charm! Thanks a lot!
Original thread: https://forums.rpgmakerweb.com/threads/edit-text-sound-script-to-use-multiple-sounds-pitches.173441/