Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

To Samot: Your Message Back Script [*Request Finished*]

I lost the topic you posted this on, and I'm too lazy to search, but it works great! :thumb:

I even made a real quick simple module for you, be sure to read the instructions in the script :shades:

Code:
module Samot module Msg_Back
  Enabled     = true
  Image       = "Message_Back"
  Opacity     = 220
  Transition  = 5
end end

Quick update, now fades the image in and out. In this spot, just change Transition = 5 to whatever you want it to be, I think 5 is a pretty nice number though.


Code:
#===============================================================================
# ** Instructions **
#-------------------------------------------------------------------------------
#   Place this script below anything that *re-writes* Scene_Map.
#===============================================================================
# ** Customizable Module ;)
#-------------------------------------------------------------------------------
#   Enable/Disable the message back within this module, and pick the name of
#===============================================================================
module Samot module Msg_Back
  Enabled     = true
  Image       = "Message_Back"
  Opacity     = 220
  Transition  = 5
end end
#===============================================================================
# ** Scene_Map
#-------------------------------------------------------------------------------
#   Enhanced to show an image behind the message window.
#===============================================================================
class Scene_Map
  alias_method :kn_msgback_scene_map_main,    :main
  alias_method :kn_msgback_scene_map_update,  :update
  #-----------------------------------------------------------------------------
  # * Main Method (*Aliased*)
  #-----------------------------------------------------------------------------
  def main
    # Create Messageback image, by default its not visible
    @msg_back         = Sprite.new
    @msg_back.bitmap  = RPG::Cache.windowskin(Samot::Msg_Back::Image)
    @msg_back.opacity = 0
    @msg_back.z       = 1100
    @msg_back.visible = false
    # Aliased Method call for Scene_Map's "main" method.
    kn_msgback_scene_map_main
    # Then, after the loop do visible in origional method,
    # You must dispose of the Message Back image.
    @msg_back.dispose
  end
  #-----------------------------------------------------------------------------
  # * Update
  #-----------------------------------------------------------------------------
  def update
    # Aliased Method call for Scene_Map's "update" method.
    kn_msgback_scene_map_update
    # If Message Window is Showing, 
    if $game_temp.message_window_showing and Samot::Msg_Back::Enabled
      @msg_back.visible = true
      unless @msg_back.opacity == Samot::Msg_Back::Opacity
        @msg_back.opacity += Samot::Msg_Back::Transition
      end
    else
      unless @msg_back.opacity == 0
        @msg_back.opacity -= Samot::Msg_Back::Transition
      else
        @msg_back.visible = false
      end
    end
  end
end
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top