# Add Text and Call Message Window
$game_message.add(%q(sText))
# Example :
$game_message.add(%q("Hi, this is my message." said Dude.))
# Variable Message Example A :
sTextA = %q("Hi, this is my message." said Dude.) + "\f"
sTextB = %q("This is like, my message, man" said Dude.) + "\f"
sMessage = sTextA if $game_variables[5] == 1
sMessage = sTextB if $game_variables[5] == 2
$game_message.add(sMessage)
# Variable Message Example B :
$game_variables[5] = 15
$game_message.add(%q("Hi, this is my message." said Dude. "You're) + "\n" + %q(one of ) + $game_variables[5].to_s + %q( who have read it.") + "\f")
The '%q()' automatically escapes any characters that might otherwise blow up the script (ie - slashes, apostrophes, pound symbol, etc). So, you don't have to worry about manually escaping any dangerous characters (trust me, huge headache).
To fit large messages, insert a 'Set Move Route' event, then create a 'Script' command. The script command within a 'Set Move Route' event may only be one line, but you can fit well over two-thousand characters into the text field. Seriously, you could write a novel in there.
Unfortunately, since you only have one line, you will need to squish all of the commands together with a semi-colon, like so :
# Squished Variable Message Example :
sTextA = %q("Hi, this is my message." said Dude.); sTextB = %q("This is like, my message, man" said Dude.); sMessage = sTextA if $game_variables[5] == 1; sMessage = sTextB if $game_variables[5] == 2; $game_message.add(sMessage)
Also, you may want to measure out how long your lines of text are, where text gets cut off and so on. Whenever you need to drop to a new line, use '\n'. Always place an '\f' at the end of your message, or other messages further along the might interrupt your current message.
sTextA = %q("Hi, this is my message." said Dude. "But, my) + "\n" + %q(message is going to be really, really big. Like,) + "\n" + %q(huge. So huge I'll have to, like, cut it off or) + "\n" + %q(something.") + "\f"
Need to add a face, and such? No problem, there are script calls for that, too.
$game_message.face_name = 'fName'
$game_message.face_index = fIndex
$game_message.background = fBG
$game_message.position = fPos
$game_message.add("Text")
# fName - Name of file containing desired face. Also automatically searches
# files included in RGSS-RTP. File extensions may be omitted.
# fIndex - Numerical identifier of face (0 is the first face).
# fBG - [0] Normal, [1] Faded, [2] Transparent
# fPos - [0] Top, [1] Middle, [2] Bottom
One final word of warning. Unlike using the normal method for displaying a message window, '$game_message.add' does not pause the script until the viewer closes the window. So, remember to place the following code in a 'Script' command underneath of a script-called message.
Fiber.yield while $game_message.busy?