#===================================================
# ■ AMS - Advanced Message Script - R4 [Update #2]
#===================================================
# For more infos and update, visit:
#
www.dubealex.com (Creation Asylum)
#
# Edited, Fixed and Enhanced by: Dubealex
# Original Script Core by: XRXS Scripter (Jap Dudes)
# HTML Hexadecimal color feature from: Phylomorphis
#
# Special Thanks:
# Rabu: For enabling the Show Face feature in an encrypted project
#
# To found all my new features, search the following: #NEW
# To configure the button to skip the dialog, search: #SKIP_TEXT_CODE
#
# May 18, 2005
=begin
www.dubealex.com (Creation Asylum)
Instruction Manual:
Each of those "commands" are to be used in your message events.
Change the text color temporarly (Default):
\c[ColorID]
Insert the color ID of your choice. All colors are coded in Window_Base starting at line #39, 0 is white.
Change the text color temporarly (Hexadecimal):
\c[#000000]
Enter an Hexadecimal color code as in HTML in there. For example:
#000000 = black
#FFFFFF = white
Show the gold window:
\G
This will show a gold window in the top-right corner of the screen, with the amount of gold the player have in possesion.
Show the hero's name:
\n[HeroID]
Use the hero ID of the hero's name you want to display in the message box.
Show the monter's name:
\m[MonsterID]
Use the monster ID of the monster's name you want to display in the message box. This function was added by Dubealex.
Show an item's price:
\Price[ItemID]
Use the item ID of the item's price you want to display in the message box. This function was added by Dubealex.
Show the current map name:
\Map
This will show the name of the map you are currently on. This function was added by Dubealex.
Show a face graphic in your message box:
\f[FaceName]
FaceName must be the filename of a graphic file found in the directoyr Graphics\Pictures of your RPG Maker XP project. The file must be a PNG of 96X96 pixels. You do not need to write the file extention.
Show the class name of a character:
\Class[HeroID]
Use the hero ID of the hero's class name you want to display in the message box. This function was added by Dubealex.
Show variables, items, weapons, armor and skill names:
\v[xID]
You must replace the x by the first lettter of what you want to modify, it goes as follows:
Variable = Do not write anything, use the standard \v[VariableID]
Items = i + itemID --> \v[iID]
Armors = a + armorID --> \v[aID]
Weapons = w + weaponID --> \v[wID]
Skills = s + skillID --> \v[sID]
Show a name or other info in a name box:
\Name[text]
Use this to show a name box above the message box that will contains the text you specified. You can also use variable and other commands such as "Show hero name" in that name box. As the following example:
\Name[\v[12]] --> Will show the value of variable ID# 12 in the name box.
\Name[Dubealex] --> Will show "Dubealex" in the name box.
\Name[\n[1]] --> Will show the name of hero ID# 1 in the name box.
Modify the text opacity:
\o[Opacity]
Use this to modify the opacity of the text in the message box. Enter a number between 0 and 255, where 255 is fully opaque and 0 is fully transparent.
Modify the text speed:
\s[Speed]
Use this to modify the speed of the text in the message box. Enter a number between 1 and 19, where 19 is the slowest.
Modify the text size:
\h[Size]
Use this to modify the size of the text in the message box. Enter a number between 6 and 32, where 32 is the biggest.
Show the message box above player or events:
\p[Option]
Use this to set the window to appear whether above the player or any event present in your map. Use the following options:
\p[Event ID]
\P[0]
\p[-1]
Using "\p[Event ID]" will put the window on top of the specified event ID.
Using "\p[0]" will put the window on top of the player.
Using "\p[-1]" will make a window without background and without borders.
Add wait in message and other commands like that:
\| --> Wait for 1 second
\. --> Wait for .25 second
\~ --> Auto close window at last letter
\! --> Wait for key input from the player
\\ --> Will show the backslash \ character
Set the letter by letter ON/OFF temporarly:
\< --> Will set it ON
\> --> Will set it OFF
Change the font in a message box (permanent):
\t[FontName]
FontName must be a .TTF found in Windows\Fonts and must be case sensitive. The changes made to the font will be permanent. So remember to do another command to revert it to anything you want. This script now works with the parenthesis, new in R3... So no worry about that ! It's safe now. This feature was added by Dubealex.
Play an SE as the letter are shown (permanent):
\a[FileName]
File must be in directory Audio\SE
Remember to set that effect OFF when you dont need it anymore using \a[] Leaving the brackets empty, or else the SE will be heard on all window from this point on.
Display text as a superscript:
\[First]second
The "FIRST" will be at normal size, and "SECOND" will be a little bit higher on the line, as a superscript.
Allow / Disallow Text Skip button (permanent):
\%
Use this command to toggle the text skip button to whether enabled or disabled. It's useful if you want to control the flow of some stories and you don't want the player to be able to skip the text by himself. Remember that the changes are permanent, meaning that if you use it once to disable the text skip, it will stay like that. Remember to do it once again to revert the text skip to enabled for the rest of the game. Feature added by Dubealex.
Modify the text color of the name box (permanent):
\z[ColorID]
Use this as you use the normal color command \c[ColorID] - But this time it will set the color used in the name box; and the changes will be permanent. So remember to do it once again to change the color back. Feature added by Dubealex.
Change the color of the text in message box permanentatly:
\Color[ColorID]
Use this as you use the normal color command \c[ColorID] - But this time it will set the color used in the message box permanently; meaning you wont have to use a color command on each message event from now on. Remember to do another command like this to revert the color to something you want. Feature added by Dubealex.
Customize other aspects of the AMS:
In the first lines of the AMS, you can customize things.
Those lines help you configure the default you will use in the AMS; so you can now specify the font name and size for both message box and name box independatly, and set their windowskin; which will not affect any other windows as the menus.
You can also set the position and size of the name box, just play with the values and test it. The default are written in the comments aside each line so you cannot "mess" the script up.
I also created an object named $ams that hold all those values for you, and it saves them in your save files, and load them when you load a game. This means that if you changed the font in the middle of your game, save the game, and reload the game, the font will still be the one you specified in the middle of your game -- This would not have worked in any other message script.
You can also access those settings to read or write to them in your game using the ATTR_ACCESSOR I created.
=end
#===================================================
LETTER_BY_LETTER_MODE = true #Set the letter by letter mode ON/OFF
#===================================================
# ▼ CLASS AMS Begins
#===================================================
class AMS
attr_accessor :name_box_x_offset
attr_accessor :name_box_y_offset
attr_accessor :font_type
attr_accessor :name_font_type
attr_accessor :font_size
attr_accessor :name_font_size
attr_accessor :message_box_opacity
attr_accessor :name_box_skin
attr_accessor :name_box_text_color
attr_accessor :message_box_text_color
attr_accessor :message_box_skin
attr_accessor :name_box_width
attr_accessor :name_box_height
attr_accessor :message_width
attr_accessor :message_height
attr_accessor :message_x
attr_accessor :message_y_bottom
attr_accessor :message_y_middle
attr_accessor :message_y_top
attr_accessor :event_message_x_ofset
attr_accessor :event_message_y_ofset
def initialize
@name_box_x_offset = 0 #Choose the X axis offset of the name bos. default= 0
@name_box_y_offset = -10 #Choose the Y axis offset of the name bos. default= -10
@name_box_width = 8 #Choose the width of the Name Box. default= 8
@name_box_height = 26 #Choose the height of the Name Box. default= 26
@font_type = "Arial" #Choose the Font Name (Case Sensitive) for message box
@name_font_type = "Arial" #Choose the Font Name (Case Sensitive) for Name Box
@font_size = 24 #Choose the default Font Size for message box text
@name_font_size = 24 #Choose the deafault Font Size for Name Box text
@name_box_text_color=0 #Choose the Text Color of the Name Box
@message_box_text_color=0 #Choose the Text Color of the Message Box
@message_box_opacity = 160 #Choose the opacity of the message window. Default=160
@message_box_skin = "001-Blue01" #Choose the WindowSkin for the Message Box
@name_box_skin = "001-Blue01" #Choose the WindowSkin for the Name Box
@message_width = 420 #Choose the width size of the message box. Default=480
@message_height = 160 #Choose the height size of the message box. Default=160
@message_x = 120 #Choose the X position of the message box. Default=80
@message_y_bottom = 304 #Choose the Y bottom position of the message box. Default=304
@message_y_middle = 160 #Choose the Y middle position of the message box. Default=160
@message_y_top = 16 #Choose the Y top position of the message box. Default=16
@event_message_x_ofset = 0 #Choose the X position offset of the event message. Default=0
@event_message_y_ofset = 48 #Choose the Y position offset of the event message. Default=48
end
end
#===================================================
# ▲ CLASS AMS Ends
#===================================================
#===================================================
# ▼ Class Window_Message Begins
#===================================================
class Window_Message < Window_Selectable
alias xrxs9_initialize initialize
def initialize
@alex_skip = false
xrxs9_initialize
if $soundname_on_speak == nil then
$soundname_on_speak = ""
end
$gaiji_file = "./Graphics/Gaiji/sample.png"
if FileTest.exist?($gaiji_file)
@gaiji_cache = Bitmap.new($gaiji_file)
else
@gaigi_cache = nil
end
@opacity_text_buf = Bitmap.new(32, 32)
end
#--------------------------------------------------------------------------
alias xrxs9_terminate_message terminate_message
def terminate_message
if @name_window_frame != nil
@name_window_frame.dispose
@name_window_frame = nil
end
if @name_window_text != nil
@name_window_text.dispose
@name_window_text = nil
end
xrxs9_terminate_message
end