Simple Game Message
By: FamilyGamer7
By: FamilyGamer7
Introduction
Features
Screenshot(s)
Script
Ruby:
#==============================================================================
# Title: Simple Game Message
# Author: FamilyGamer7 (FG7)
# Version: 1.1
# Engine: RPG Maker VX Ace
#==============================================================================
# ** Change Log |
# ---------------
# 1.0 => Created script
# 1.1 => Added in window adjustments for graphic screen resize purposes
#==============================================================================
# ** Description |
# ----------------
# The easiest way to implement an a change in the $game_message system. This
# provides a few options like the choices inside the $game_message and making
# the $game_message text speed able to be instant vs normal.
#==============================================================================
# ** Terms of Use |
# -----------------
# * Free to use in non-commercial projects and commercial projects
# * Feel free to modify and improve the script. Credit is still required.
# * Credit FamilyGamer7
#==============================================================================
# ** Usage |
# ----------
# * ALMOST Plug & Play (See "Setup" section for more information)
#==============================================================================
# ** Setup |
# ----------
# To set the Game Message text speed to "instant"
# Script call: $game_system.instant_message_text = true
#
# To set the Game Message text speed to "normal"
# Script call: $game_system.instant_message_text = false
#
# -----------------------------------------------------------------------------
#
# To properly show the "new" game message in your game, you will new to create
# the event similar to the example below.
#
# *Note: The actor name will always go up top and you will only have 3 lines
# to work with with this script change.
#
# ------------------------------
# | Game Message Event Example |
# -------------------------------------------------------------
# | Text: 'Actor7', 7, Normal, Bottom |
# | : \c[6]Richard |
# | : \c[0]This is to test Simple Game Message to ensure |
# | : all looks good as well as the choice list is |
# | : properly added without an issue. |
# -------------------------------------------------------------
#
# To properly show the game choices within the window, you will need to create
# a "fake" game message before your choice list in the event. See example below.
#
# ------------------------------
# | Game Choices Event Example |
# -----------------------------------------------------
# | Text: 'Actor7', 7, Normal, Bottom |
# | : \c[6]Richard |
# | Show Choices: |
# | When [I don't know what to do] |
# | @> |
# | When [Leave me alone please...] |
# | @> |
# | When [Okay okay..] |
# | @> |
# | Branch End |
# -----------------------------------------------------
#
# *Note: The idea is to ask your question before the choice list and then you
# will setup the game choice event after to make a smooth transition.
#
# - Feel free to use your own color codes in the game message like normal.
#
# -----------------------------------------------------------------------------
#
# For the "X" and "Y" modules, you can use a value like "30" or "-30" which is
# to add/subtract to the existing "x" coordinate placement of the scene. The
# same applies for the "y" coordinate placement. See examples below.
#
# - Ex: Message_X_Horizontal = 30 - moves message window to the right
# - Ex: Message_X_Horizontal = -30 - moves message window to the left
# (Default is 0)
#
# - Ex: Message_Y_Vertical = 30 - moves message window to the bottom
# - Ex: Message_Y_Vertical = -30 - moves message window to the top
# (Default is 0)
#
# For the "Message_Window_Width", you can use a value like "30" which is to add
# to the existing window width of the game message.
#
# - Ex: Message_Window_Width = 30 - extends message window to the right
#
# *Note: You do not want to do a add a negative value in the window width as it
# will make the game message not appear properly.
#==============================================================================
# ** WARNING! |
# ------------
# Due to the changes in the way the $game_message behaves with the script, the
# game message & choice list will not be able to extend to "4" total. You will
# only be able to use "3" lines at a time.
#==============================================================================
#==============================================================================
# ** Module: FG7::Simple_Game_Message
#------------------------------------------------------------------------------
# This modules creates a static variable to be used within the script.
#==============================================================================
module FG7
module Simple_Game_Message
#==============================================================================
# -------------------- ALLOWED TO EDIT BELOW THIS LINE ---------------------- #
#==============================================================================
# Sets the value for the $game_switch used for the instant message text
Message_Text_Switch = 11
# Sets the value for the face window width - if game has long actor names
Face_Name_Window_Width = 140
# Sets the value to change the "x" coordinate for the game message.
# (This is needed if screen is resized higher - For flexibility)
Message_X_Horizontal = 0
# Sets the value to change the "y" coordinate for the game message.
# (This is needed if screen is resized higher - For flexibility)
Message_Y_Vertical = 0
# Sets the value to change the window width for the game message.
# (This is needed if screen is resized higher - For flexibility)
Message_Window_Width = 0
#==============================================================================
# ---------- DO NOT EDIT BELOW THIS LINE (FOR ADVANCED USERS) --------------- #
#==============================================================================
end
end
#==============================================================================
# ** Game_System
#------------------------------------------------------------------------------
# This class handles system data. It saves the disable state of saving and
# menus. Instances of this class are referenced by $game_system.
#==============================================================================
class Game_System
#--------------------------------------------------------------------------
# * New Method: instant_message_text (Flag to make text instant)
#--------------------------------------------------------------------------
def instant_message_text=(string)
@instant_message_text = string
$game_switches[FG7::Simple_Game_Message::Message_Text_Switch] = @instant_message_text
end
end
#==============================================================================
# ** Window_ChoiceList
#------------------------------------------------------------------------------
# This window is used for the event command [Show Choices].
#==============================================================================
class Window_ChoiceList < Window_Command
#--------------------------------------------------------------------------
# * Alias Method: Update Window Position
#--------------------------------------------------------------------------
alias :fg7_simple_game_message_update_placement :update_placement
def update_placement
fg7_simple_game_message_update_placement
# Reupdates corrdinate placement values
self.opacity = 0
self.z = 1000
self.x = 17 + FG7::Simple_Game_Message::Message_X_Horizontal
self.y = 306 + FG7::Simple_Game_Message::Message_Y_Vertical
end
#--------------------------------------------------------------------------
# * Alias Method: Get Maximum Width of Choices
#--------------------------------------------------------------------------
alias :fg7_simple_game_message_max_choice_width :max_choice_width
def max_choice_width
# Adds in the new max width for the choice(s)
return 473 + FG7::Simple_Game_Message::Message_Window_Width
fg7_simple_game_message_max_choice_width
end
end
#==============================================================================
# ** Window_Message
#------------------------------------------------------------------------------
# This message window is used to display text.
#==============================================================================
class Window_Message < Window_Base
#--------------------------------------------------------------------------
# * Alias Method: Clear Flag
#--------------------------------------------------------------------------
alias :fg7_simple_game_message_clear_flags :clear_flags
def clear_flags
fg7_simple_game_message_clear_flags
# Added change to control the game message text speed (Instant or Normal)
@show_fast = $game_switches[FG7::Simple_Game_Message::Message_Text_Switch]
end
#--------------------------------------------------------------------------
# * Alias Method: Get Number of Lines to Show
#--------------------------------------------------------------------------
alias :fg7_simple_game_message_visible_line_number :visible_line_number
def visible_line_number
# Changes the visible line number - more room for adjustments
return 12.5
fg7_simple_game_message_visible_line_number
end
#--------------------------------------------------------------------------
# * Alias Method: Create All Windows
#--------------------------------------------------------------------------
alias :fg7_simple_game_message_create_all_windows :create_all_windows
def create_all_windows
fg7_simple_game_message_create_all_windows
# Creates all new windows for the game message (all background windows)
x = 10 + FG7::Simple_Game_Message::Message_X_Horizontal
y = 302 + FG7::Simple_Game_Message::Message_Y_Vertical
window_width = 524 + FG7::Simple_Game_Message::Message_Window_Width
@message_bg_window = Window_Base.new(x, y, window_width, 104)
@message_bg_window.openness = 0
x2 = 10 + FG7::Simple_Game_Message::Message_X_Horizontal
y2 = 260 + FG7::Simple_Game_Message::Message_Y_Vertical
face_width = FG7::Simple_Game_Message::Face_Name_Window_Width
@face_name_window = Window_Base.new(x2, y2, face_width, 42)
@face_name_window.openness = 0
end
#--------------------------------------------------------------------------
# * Alias Method: Main Processing of Fiber
#--------------------------------------------------------------------------
alias :fg7_simple_game_message_fiber_main :fiber_main
def fiber_main
# Opens created message background windows
@message_bg_window.openness += 255
@face_name_window.openness += 255
fg7_simple_game_message_fiber_main
# Closes created message background windows
@face_name_window.openness -= 255
@message_bg_window.openness -= 255
end
#--------------------------------------------------------------------------
# * Alias Method: Update Window Background
#--------------------------------------------------------------------------
alias :fg7_simple_game_message_update_background :update_background
def update_background
fg7_simple_game_message_update_background
# Removes currnet game message opacity (replacing with new window)
self.opacity = 0
end
#--------------------------------------------------------------------------
# * Alias Method: Update Window Position
#--------------------------------------------------------------------------
alias :fg7_simple_game_message_update_placement :update_placement
def update_placement
fg7_simple_game_message_update_placement
# This shifts the window to properly place the continue "flag" (arrow)
self.y = 79 + FG7::Simple_Game_Message::Message_Y_Vertical
end
#--------------------------------------------------------------------------
# * Alias Method: New Page
#--------------------------------------------------------------------------
alias :fg7_simple_game_message_new_page :new_page
def new_page(text, pos)
fg7_simple_game_message_new_page(text, pos)
# Clears existing method with new override/alias method
contents.clear
draw_face($game_message.face_name, $game_message.face_index, 22, 73)
reset_font_settings
pos[:x] = 20
pos[:y] = 157
pos[:new_x] = 20
pos[:height] = calc_line_height(text) + 45
clear_flags
end
end
#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
# This class performs the map screen processing.
#==============================================================================
class Scene_Map < Scene_Base
#--------------------------------------------------------------------------
# * Alias Method: Create Message Window
#--------------------------------------------------------------------------
alias :fg7_simple_game_message_create_message_window :create_message_window
def create_message_window
fg7_simple_game_message_create_message_window
# Removes current game message opacity (replacing with new window)
@message_window.opacity = 0
end
end
How to Use
Terms of Use