RMVX MessageBack Changer
#1
RMVX MessageBack Changer
Version: 1.2


Introduction
Made in roughly 15 to 20  minutes (not counting these instructions), this script allows you to change the background skin used in the RMVX message system... the one usually seen when displaying a message with a semi-transparent background.


Script
Code:
#==============================================================================
# ** Battlebacks VX
#------------------------------------------------------------------------------
#    by DerVVulfman
#    version 1.2
#    03-29-2008
#    RGSS2
#==============================================================================
#
#  INTRODUCTION:
#
#  This system reintroduces the use of 'Battleback' graphics into your pro-
#  jects, something that was sadly lacking in tbe RPGMaker VX system.
#
#------------------------------------------------------------------------------
#
#  SCRIPT CALLS:
#
#  There's only one script call that you need to know.
#
#  --Changing Battlebacks--
#  Given that this system allows you to use 'Battlebacks, you may find a need
#  to 'change' the battleback in-game. Unfortunately, this can't be done with
#  a pre-rendered map event, so I had to make a script call:
#
#           $game_system.battleback = "filename"
#
#  The filename is whatever is stored within the folder that you have speci-
#  fied in the configuration section (in the BATTLEBACK_DIR value).

#------------------------------------------------------------------------------
#
#  SCRIPT PLACEMENT:
#
#  As a core/re-insertion script, it returns the classic battle backgrounds
#  that many users became used to with other RPG gaming systems.
#
#  If this script is being used  with any other script that alters any dis-
#  played effect or any system in the battlesystem's spriteset window, then
#  those scripts will most likely be placed BELOW this script  as they will
#  most need access to the revised battle viewport.
#
#------------------------------------------------------------------------------
#
#  EDITS AND MODIFICATIONS:

#  This system Aliases the following methods:
#  * initialize                     (Game_System)
#  * create_battleback              (Spriteset_Battle)
#  * create_battlefloor             (Spriteset_Battle)
#
#  This system adds the following methods:
#  * battleback                     (Cache)
#
#------------------------------------------------------------------------------
#
#  THANKS:
#
#  To Fantasy at RPG RPG Revolution for noticing a bug when using the 'Battle
#  Test' feature.
#
#------------------------------------------------------------------------------
#  TERMS AND CONDITIONS:
#
#  Free to use, even in commercial projects.  Just note that I need some form
#  of due credit... even a mere mention in some end titles.
#
#==============================================================================

   #========================================================================
   #  **  C  O  N  F  I  G  U  R  A  T  I  O  N      S  Y  S  T  E  M  **  #
   #======================================================================== 
 
  # Name of directory (used in cache)
    BATTLEBACK_DIR = "Graphics/Parallaxes/"

  # List of battlebacks by Map ID.
  #                    MapID    Filename                   
    BATTLEBACK_LIST = {1    =>  "Ocean",
                       2    =>  "CloudySky"}
                       
  # The name of the battleback used
  # when using the Battle Test feature.
    BATTLEBACK_TEST = "Mountains"                       

                   
#==============================================================================
# ** Cache
#------------------------------------------------------------------------------
#  This module loads each of graphics, creates a Bitmap object, and retains it.
# To speed up load times and conserve memory, this module holds the created
# Bitmap object in the internal hash, allowing the program to return
# preexisting objects when the same bitmap is requested again.
#==============================================================================

module Cache
  #--------------------------------------------------------------------------
  # * Get Battleback Graphic
  #     filename : Filename
  #-------------------------------------------------------------------------- 
  def self.battleback(filename)
    load_bitmap(BATTLEBACK_DIR, filename)
  end
end



#==============================================================================
# ** Game_System
#------------------------------------------------------------------------------
#  This class handles system-related data. Also manages vehicles and BGM, etc.
# The instance of this class is referenced by $game_system.
#==============================================================================

class Game_System
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :battleback               # filename of battleback
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  alias bback_initialize initialize
  def initialize
    bback_initialize
    @battleback = nil
  end
end



#==============================================================================
# ** Spriteset_Battle
#------------------------------------------------------------------------------
#  This class brings together battle screen sprites. It's used within the
# Scene_Battle class.
#==============================================================================

class Spriteset_Battle
  #--------------------------------------------------------------------------
  # * Create Battleback Sprite
  #--------------------------------------------------------------------------
  alias bback_create_battleback create_battleback
  def create_battleback
    # Perform and exit for battletests
    if $BTEST
      if BATTLEBACK_TEST != nil
        # Create Battleback sprite
        @battleback_sprite = Sprite.new(@viewport1)
        # Load image from cache
        @battleback_sprite.bitmap = Cache.battleback(BATTLEBACK_TEST)
        return
      else
        bback_create_battleback
        return
      end
    end
    # If map used 'called' battleback. 
    if $game_system.battleback != nil
      # Create Battleback sprite
      @battleback_sprite = Sprite.new(@viewport1)
      # Load image from cache
      @battleback_sprite.bitmap = Cache.battleback($game_system.battleback)   
    # If map has assigned battleback
    elsif BATTLEBACK_LIST.key?($game_map.map_id)
      # Create Battleback sprite
      @battleback_sprite = Sprite.new(@viewport1)
      # Load image from cache
      @battleback_sprite.bitmap = Cache.battleback(BATTLEBACK_LIST[$game_map.map_id])
    # Otherwise, as normal
    else
      # Perform the original call
      bback_create_battleback
    end
  end 
  #--------------------------------------------------------------------------
  # * Create Battlefloor Sprite
  #-------------------------------------------------------------------------- 
  alias bback_create_battlefloor create_battlefloor
  def create_battlefloor
    # Disable battlefloor for existing battleback maps
    if BATTLEBACK_LIST.key?($game_map.map_id) or $game_system.battleback != nil
      @battlefloor_sprite = Sprite.new(@viewport1)
      return
    end
    # Disable for battletests with set battleback
    if $BTEST
      if BATTLEBACK_TEST != nil
        @battlefloor_sprite = Sprite.new(@viewport1)
        return
      end
    end
    # Perform the original call
    bback_create_battlefloor
  end
end


Instructions
Pretty simple to use.  Only one value to edit as described in the script.


Compatibility
Made for RPGMaker VX.


Author's Notes
Took up to 20 minutes to write, not including the instructions.  Punky requested it.


Terms and Conditions
Free, dude.  Use it in commercial games if you like.
Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   H-Mode7 maps in RMVX Ace MGC 5 41,149 12-29-2018, 05:04 PM
Last Post: Kamillo
   Soul Engine Ace – Altitude Changer SoulPour777 2 6,916 02-28-2014, 10:04 AM
Last Post: SoulPour777
   Importing FPLE maps in RMVX MGC 5 17,100 04-21-2012, 11:45 PM
Last Post: albertcprice
   H-Mode7 maps in RMVX MGC 1 14,565 03-11-2012, 02:25 AM
Last Post: scaldwellhu
   P's MessageBack Changer and Enhancer [Exclusive] PK8 0 5,835 07-02-2009, 04:28 PM
Last Post: PK8
   Tileset Changer syvkal 0 5,340 03-08-2008, 04:49 AM
Last Post: syvkal
   Resolution Changer VX syvkal 0 6,162 03-08-2008, 04:15 AM
Last Post: syvkal
   Party Changer Dargor 0 5,731 03-07-2008, 04:21 AM
Last Post: Dargor
   Windowskin Changer VX DerVVulfman 0 5,385 03-06-2008, 04:32 AM
Last Post: DerVVulfman



Users browsing this thread: 1 Guest(s)