MSS Text SE

mobychan

CodeMaster
Veteran
Joined
Mar 23, 2012
Messages
297
Reaction score
44
First Language
German
Primarily Uses



Text SE - V1.0

Last Update: 2012.07.23


Updates:

  • N/A

Script Description:

This Script plays a SE you define in the module at the top every x letters.

These settings can be made in a module:

  • SE File Name
  • Pitch Range
  • Volume
  • Interval(x)

List of methods:

Overridden methods:
  • None

Aliased methods:

  • class Window_Message
    - initialize
    - process_normal_character
    - process_new_page

New methods:

  • module Sound
    - play_text_se
Compatible Scripts:

Should be compatible to nearly everything, if you have problems try putting this script below every other script you have.

Screenshots:

Sound is kinda hard to capture in a screenshot ;)

It is setup to play the RTP Cursor1 sound, so just put it in your project and test it out ^^

Script:

Script

Credits:

  • mobychan
  • Hyde for requesting it

FAQ:

Any questions?

Just ask here or per mail(mobychan@gmx.de)

Want to commission something?

Please look here
 
Last edited by a moderator:

hyde9318

RMC Coordinator
Veteran
Joined
Apr 1, 2012
Messages
2,593
Reaction score
680
First Language
English
Primarily Uses
RMMV
Awesome script Moby, truly useful. It always spices up text alot to have it play a sound during it. And, although most of them were VX, not many scripts that do this, do it with as many options as yours. They usually just let you set a sound and move on. Yours lets them pick a sound, choose an interval, set a random range for the sounds (which is useful for when you want the illusion of voices), and even lets you set the volume. Couldn't ask for a better script.
 

Nybras

Veteran
Veteran
Joined
Jul 13, 2012
Messages
36
Reaction score
0
First Language
Danish
Primarily Uses
Great work. I was wondering if there is any way to bind a uniqe sound and/or pitch to a specific actor and/or npc? So all characters in the game don't "talk" the same way?
 

Bird Eater

Boredom is just another thing you want to avoid
Veteran
Joined
Mar 22, 2012
Messages
272
Reaction score
27
First Language
Dutch
Primarily Uses
Hi, made that modification a while ago for someone on the IRC.

You can modify it to your likes, it's really not hard.

Code:
################################################################################
# Made by mobychan, slightly edited by Bird Eater.
# Give mobychan the cookies.
# http://forums.rpgmakerweb.com/index.php?/topic/3463-mss-text-se/
#
#
# INSTRUCTIONS:
# Place above 'Main' in the scripts section but below 'Materials'.
# Change things in module TSE to your liking to vary the sound, pitch and volume
# of the SE played. These correspond with the value VARIABLE 5 has. Make sure
# variable 5 has a value between 1 and 7. HAVE FUN.
#
# So if variable 5 is equal to 5,
# SE5 will be played
# Pitch5 will be used
# With a volume of Volume5
################################################################################
module TSE

# The name of the file that will be played, must be placed in Audio/SE
# CHANGE THESE TO ALTHER THE SOUND PLAYED DURING THE MESSAGE
SE1 = "Cursor1"
SE2 = "Cursor1"
SE3 = "Cursor1"
SE4 = "Cursor1"
SE5 = "Cursor1"
SE6 = "Cursor1"
SE7 = "Cursor1"

# The pitch range of the file being played, change them however you like
# [start_pitch, end_pitch]
# start and end pitch can be the same to have a static pitch
# CHANGE THESE TO ALTER THE DIFFERENT PITCHES!
Pitch1 = [50, 60]
Pitch2 = [70, 90]
Pitch3 = [90, 110]
Pitch4 = [120, 130]
Pitch5 = [130, 140]
Pitch6 = [140, 150]
Pitch7 = [150, 160]

# The volume of the file being played
Volume1 = 90
Volume2 = 100
Volume3 = 100
Volume4 = 100
Volume5 = 100
Volume6 = 100
Volume7 = 110

# The interval at which the sound is being played, every x characters
Interval = 4
end
#==============================================================================
# ** Sound
#==============================================================================
module Sound
# System Sound Effect
def self.play_text_se
#puts $game_variables[5]
if $game_variables[5] == 1
	 file = "Audio/SE/" + TSE::SE1
	 pitch = rand(TSE::Pitch1[1] - TSE::Pitch1[0]) + TSE::Pitch1[0]
	 Audio.se_play(file, TSE::Volume1, pitch)
elsif $game_variables[5] == 2
	 file = "Audio/SE/" + TSE::SE2
	 pitch = rand(TSE::Pitch2[1] - TSE::Pitch2[0]) + TSE::Pitch2[0]
	 Audio.se_play(file, TSE::Volume2, pitch)
elsif $game_variables[5] == 3
	 file = "Audio/SE/" + TSE::SE3
	 pitch = rand(TSE::Pitch3[1] - TSE::Pitch3[0]) + TSE::Pitch3[0]
	 Audio.se_play(file, TSE::Volume3, pitch)
elsif $game_variables[5] == 4
	 file = "Audio/SE/" + TSE::SE4
	 pitch = rand(TSE::Pitch4[1] - TSE::Pitch4[0]) + TSE::Pitch4[0]
	 Audio.se_play(file, TSE::Volume4, pitch)
elsif $game_variables[5] == 5
	 file = "Audio/SE/" + TSE::SE5
	 pitch = rand(TSE::Pitch5[1] - TSE::Pitch5[0]) + TSE::Pitch5[0]
	 Audio.se_play(file, TSE::Volume5, pitch)
elsif $game_variables[5] == 6
	 file = "Audio/SE/" + TSE::SE6
	 pitch = rand(TSE::Pitch6[1] - TSE::Pitch6[0]) + TSE::Pitch6[0]
	 Audio.se_play(file, TSE::Volume6, pitch)
elsif $game_variables[5] == 7
	 file = "Audio/SE/" + TSE::SE7
	 pitch = rand(TSE::Pitch7[1] - TSE::Pitch7[0]) + TSE::Pitch7[0]
	 Audio.se_play(file, TSE::Volume7, pitch)
else
	 #puts "Your variable number 9 isn't 1-7, change it!"
end
end
end
#==============================================================================
# ** Window_Message
#==============================================================================
class Window_Message < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias tse_init initialize unless $@
def initialize
	 tse_init
	 @character = 0
end
#--------------------------------------------------------------------------
# * Normal Character Processing
#--------------------------------------------------------------------------
alias tse_process_normal_character process_normal_character unless $@
def process_normal_character(c, pos)
	 tse_process_normal_character(c, pos)
	 Sound.play_text_se if @character % TSE::Interval == 0 && !@line_show_fast
	 #p @character if @character % TSE::Interval == 0 && !@line_show_fast
	 @character += 1
end
alias tse_process_new_page process_new_page unless $@
#--------------------------------------------------------------------------
# * New Page Character Processing
#--------------------------------------------------------------------------
def process_new_page(text, pos)
	 tse_process_new_page(text, pos)
	 @character = 0
end
end
 
Last edited by a moderator:

Nybras

Veteran
Veteran
Joined
Jul 13, 2012
Messages
36
Reaction score
0
First Language
Danish
Primarily Uses
Thanks for your reply :)

I just started out with RPG maker ace, so I'm a bit off a script noob. I cannot see how to "bind" a sound/pitch to a certain actor from the script you posted but I will take a closer look when I get home from work.

Eg. I would like the skinny girl in the party to alway talk with a high pitch and the buffed warrior a low pitch and different sound. Just like the old classic Sega RPG game Shining in the darkness :)
 

Nosleinad

Storyteller
Veteran
Joined
Dec 12, 2012
Messages
351
Reaction score
28
First Language
Portuguese
Primarily Uses
(I hope this is not considered necroposting, as this is the official script topic)

 I am using this script, it really adds a nice feeling to the messages and it's very easy to use. There's just one thing that's a bit annoying: everytime a player press enter during a message, there's a 1 sec delay for the entire message to show up, and all the SE will be played at once. I am sure the lag is due to the ammount of SE playing at once, so i'd like to ask if it's hard to implement a "no text SE will be played when pressing enter on messages".

 Thanks in advance!!
 
Last edited by a moderator:

Oriceles

0 + a.atk * 4 - b.def * 2
Veteran
Joined
Apr 4, 2012
Messages
384
Reaction score
72
First Language
Spanish
Primarily Uses
RMMV
Moby I want a similar request as the one of Nosleinad. Fenifyrex has a very similar script to yours but he has more options like adding sounds to new lines and pages, It is just that his script lacks of interval on character sound so it's pretty annoying. I was wondering if you can add lines and pages sounds too on the next version please? :D
 

RadDevVan101

Devin Manning
Member
Joined
Jun 30, 2014
Messages
24
Reaction score
2
First Language
English
Primarily Uses
Is it possible to change the sound on the fly? Like having specific character have specific sounds for their messages?

If not then it would be a nice feature
 

Pumamori

Veteran
Veteran
Joined
Oct 29, 2012
Messages
109
Reaction score
21
First Language
German
Primarily Uses
RMMV
Bird Eater posted a script to do just that. From what I can tell, all you have to do is change your fifth variable to any number from 1-7 that you defined in the header. 

But it's in the instructions anyway, just give it a shot, I know I will! :) 
 

kae

Warper
Member
Joined
Jul 11, 2016
Messages
1
Reaction score
0
First Language
english
Primarily Uses
I have the script placed above the main.. but.. how do I use it?


With an event or something? None of my NPCs are making a sound..?
 

xismage

Warper
Member
Joined
Nov 2, 2016
Messages
1
Reaction score
0
First Language
Portuguese
Primarily Uses
Hi, made that modification a while ago for someone on the IRC.


You can modify it to your likes, it's really not hard.


Hidden Content
I used this script, tidily pasted into "(insert here)" from Materials, but still didn't get what i wanted, to each character play a unique sound in their dialogue.
In fact, when i tried, i couldn't get Any sound to play...


I'm such a noob, excuse my ignorance, but... sigh... What exactly do i do?
 

Kakis

Villager
Member
Joined
Dec 20, 2018
Messages
13
Reaction score
0
First Language
English
Primarily Uses
RMXP
I'm also struggling with using this script. Any guidance for using variables for this? I'd like to be able to give characters different voice pitches for male and female characters.

I've tested out the script and it works fine, but I just want to know how I can change a characters pitch, as I'm not really familiar with variables. Do you have to create an event for a character for this? How is this done?
 

ZirconStorms

VX & VX Ace Scripts
Veteran
Joined
Dec 22, 2014
Messages
349
Reaction score
111
First Language
English
Primarily Uses
RMVXA
I'm also struggling with using this script. Any guidance for using variables for this? I'd like to be able to give characters different voice pitches for male and female characters.

I've tested out the script and it works fine, but I just want to know how I can change a characters pitch, as I'm not really familiar with variables. Do you have to create an event for a character for this? How is this done?
In the module, make something like

Code:
SE_CUSTOM_1 = "Sound name goes here"
Pitch_CUSTOM_1 = [50,100]
Then you could do something like this:

Code:
module Sound

  # System Sound Effect
  def self.play_text_se
    file = "Audio/SE/" + TSE::SE if $game_variables[VARIABLE HERE] == 0
    file = "Audio/SE/" + TSE::SE_CUSTOM_1 if $game_variables[VARIABLE HERE] == 1
    ##more can be added here
    pitch = rand(TSE::Pitch[1] - TSE::Pitch[0]) + TSE::Pitch[0] if $game_variables[VARIABLE HERE] == 0
    pitch = rand(TSE::Pitch_CUSTOM_1[1] - TSE::Pitch_CUSTOM_1[0]) + TSE::Pitch[0] if $game_variables[VARIABLE HERE] == 1
    Audio.se_play(file, TSE::Volume, pitch)
  end
end
[VARIABLE HERE] can be anything. You can also set up one variable for pitch and one for the sound if you want.
Manually adjust the selected variable through events to change pitch; this can work for actors or random NPCs.
 

Kakis

Villager
Member
Joined
Dec 20, 2018
Messages
13
Reaction score
0
First Language
English
Primarily Uses
RMXP
In the module, make something like

Code:
SE_CUSTOM_1 = "Sound name goes here"
Pitch_CUSTOM_1 = [50,100]
Then you could do something like this:

Code:
module Sound

  # System Sound Effect
  def self.play_text_se
    file = "Audio/SE/" + TSE::SE if $game_variables[VARIABLE HERE] == 0
    file = "Audio/SE/" + TSE::SE_CUSTOM_1 if $game_variables[VARIABLE HERE] == 1
    ##more can be added here
    pitch = rand(TSE::Pitch[1] - TSE::Pitch[0]) + TSE::Pitch[0] if $game_variables[VARIABLE HERE] == 0
    pitch = rand(TSE::Pitch_CUSTOM_1[1] - TSE::Pitch_CUSTOM_1[0]) + TSE::Pitch[0] if $game_variables[VARIABLE HERE] == 1
    Audio.se_play(file, TSE::Volume, pitch)
  end
end
[VARIABLE HERE] can be anything. You can also set up one variable for pitch and one for the sound if you want.
Manually adjust the selected variable through events to change pitch; this can work for actors or random NPCs.
Ok, thanks!
So I followed what you said and put it under module in script editor.


So then I can now create an event for a character to change pitch?
I'm still a little confused on how this works. I noticed when creating an event, under "conditions" it has variables listed. But when I try to add a number to that, nothing's happening.

What do I do here? Or am I looking at it wrong? Is it because in the script, I need to put a number where [VARIABLE HERE] is? Sorry, all of this is pretty new to me.
 

Attachments

Kes

Global Moderators
Global Mod
Joined
Aug 3, 2012
Messages
21,578
Reaction score
10,916
First Language
English
Primarily Uses
RMVXA
No. Put it under Materials. That is where all custom scripts must go.
 

Kakis

Villager
Member
Joined
Dec 20, 2018
Messages
13
Reaction score
0
First Language
English
Primarily Uses
RMXP
No. Put it under Materials. That is where all custom scripts must go.
Oh, ok. I did that but it gave me an error and said there was something wrong with line 8.
 

ZirconStorms

VX & VX Ace Scripts
Veteran
Joined
Dec 22, 2014
Messages
349
Reaction score
111
First Language
English
Primarily Uses
RMVXA
Oh, ok. I did that but it gave me an error and said there was something wrong with line 8.
You need to put all that new stuff inside of Moby's script under it's appropriate sections, not under a new page like that.

Code:
module TSE
  # The name of the file that will be played, must be placed in Audio/SE
  SE = "Cursor1"
  SE_CUSTOM_1 = "Cursor2" ##sound file name goes here
  # The pitch range of the file being played
  # [start_pitch, end_pitch]
  # start and end pitch can be the same to have a static pitch
  Pitch = [150, 175]
  Pitch_CUSTOM_1 = [50, 100] #Adjust this accordingly
  # The volume of the file being played
  Volume = 100
  # The interval at which the sound is being played, every x characters
  Interval = 4
end
Code:
module Sound

  # System Sound Effect
  def self.play_text_se
    file = "Audio/SE/" + TSE::SE if $game_variables[1] == false
    file = "Audio/SE/" + TSE::SE if $game_variables[1] == true
    pitch = rand(TSE::Pitch[1] - TSE::Pitch[0]) + TSE::Pitch[0] if $game_variables[1] == false
    pitch = rand(TSE::Pitch_CUSTOM_1[1] - TSE::Pitch_CUSTOM_1[0]) + TSE::Pitch_CUSTOM_1[0] if $game_variables[1] == true
    Audio.se_play(file, TSE::Volume, pitch)
  end
end
Also, you need to put a number where [VARIABLE HERE] is written. In this case, I put variable 1. Same for "Sound file goes here"; put an actual sound file, not what I wrote.
 
Last edited:

Kakis

Villager
Member
Joined
Dec 20, 2018
Messages
13
Reaction score
0
First Language
English
Primarily Uses
RMXP
You need to put all that new stuff inside of Moby's script under it's appropriate sections, not under a new page like that.

Code:
module TSE
  # The name of the file that will be played, must be placed in Audio/SE
  SE = "Cursor1"
  SE_CUSTOM_1 = "Cursor2" ##sound file name goes here
  # The pitch range of the file being played
  # [start_pitch, end_pitch]
  # start and end pitch can be the same to have a static pitch
  Pitch = [150, 175]
  Pitch_CUSTOM_1 = [50, 100] #Adjust this accordingly
  # The volume of the file being played
  Volume = 100
  # The interval at which the sound is being played, every x characters
  Interval = 4
end
Code:
module Sound

  # System Sound Effect
  def self.play_text_se
    file = "Audio/SE/" + TSE::SE if $game_variables[1] == false
    file = "Audio/SE/" + TSE::SE if $game_variables[1] == true
    pitch = rand(TSE::Pitch[1] - TSE::Pitch[0]) + TSE::Pitch[0] if $game_variables[1] == false
    pitch = rand(TSE::Pitch_CUSTOM_1[1] - TSE::Pitch_CUSTOM_1[0]) + TSE::Pitch_CUSTOM_1[0] if $game_variables[1] == true
    Audio.se_play(file, TSE::Volume, pitch)
  end
end
Also, you need to put a number where [VARIABLE HERE] is written. In this case, I put variable 1. Same for "Sound file goes here"; put an actual sound file, not what I wrote.
Ok, thanks!
So whereabouts would i put the audio file I'd be using? Would it be here?
Audio.se_play(file, TSE::Volume, pitch)
end
Because I noticed when I used Moby's script, it already had sound added to it.
 

ZirconStorms

VX & VX Ace Scripts
Veteran
Joined
Dec 22, 2014
Messages
349
Reaction score
111
First Language
English
Primarily Uses
RMVXA
Ok, thanks!
So whereabouts would i put the audio file I'd be using? Would it be here?
Audio.se_play(file, TSE::Volume, pitch)
end
Because I noticed when I used Moby's script, it already had sound added to it.
No, you don't tamper with that line of code. Change this line of code that should be in the module: SE_CUSTOM_1 = "Cursor2"

As a general rule, Modules for a lot of RPG Maker scripts are where you go and customize stuff. That's why you see a lot of "don't edit below unless you know what you're doing!" warnings once the module section ends.
 

Shytoad

May never find a good Avatar
Member
Joined
Dec 12, 2018
Messages
15
Reaction score
1
First Language
English
Primarily Uses
RMVXA
I keep getting this message? upload_2019-5-27_17-8-38.png
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

tfw, after your game being intensively played by many people, after 5 years, patch after patch released, suddenly an innocent person reported another bug.
"Never let a sense of morals/
Prevent me from doing what is right"
- Clutch
OMFG. I had typed \fiPhilosophia Hermetica\fi in a forum post and didn't notice it for AN HOUR.

(Anyone else ever catch themselves doing this?)
Stream will be live shortly with a guest stream! Feel free to drop by and listen to whatever weird stories we're telling~
fighting game fans might really enjoy my game battle wise, and I feel non fighting fans might learn some stuff. thanks row system. pokes, neutral, and zoning time...

Forum statistics

Threads
94,252
Messages
919,413
Members
123,969
Latest member
TsuruharaYuki
Top