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.

LAWS Message on Game Load

LAWS: Message on Game Load
By: TheLawG14 [aka. TheScripter]

Introduction

This is a pretty simple script, it was just based off a request I did for gRaViJa and I decided to release it to those that want it as well. What it does is show a message after loading a game file (for example: "Welcome Back!") and you can customize how long this message is shown and what is shown.

Features
  • Shows a message after loading a file
  • Can customize how long the message is shown and what the message says
  • Can exit out message more quickly with action button

Screenshots






Demo


None, it's a pretty simple script


Script

[rgss]#==============================================================================
# Title: Message on Game Load | Version 1.1
# Author: TheLawG14 [aka. TheScripter]
# Requester: gRaViJa [@ hbgames.org]
#==============================================================================
 
Text = "Welcome back, get ready!"
Wait_Time = 10000
 
#==============================================================================
# ** Scene_File
#------------------------------------------------------------------------------
#  This is a superclass for the save screen and load screen.
#==============================================================================
 
class Scene_File
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias scripter_scene_file_update update
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    @message_window = Window_LoadMessage.new
    # Make help window
    @help_window = Window_Help.new
    @help_window.set_text(@help_text)
    # Make save file window
    @savefile_windows = []
    for i in 0..3
      @savefile_windows.push(Window_SaveFile.new(i, make_filename(i)))
    end
    # Select last file to be operated
    @file_index = $game_temp.last_file_index
    @savefile_windows[@file_index].selected = true
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of windows
    @help_window.dispose
    @message_window.dispose
    for i in @savefile_windows
      i.dispose
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    @message_window.update
    scripter_scene_file_update
  end
end
 
 
#==============================================================================
# ** Scene_Load
#------------------------------------------------------------------------------
#  This class performs load screen processing.
#==============================================================================
 
class Scene_Load < Scene_File
  #--------------------------------------------------------------------------
  # * Decision Processing
  #--------------------------------------------------------------------------
  def on_decision(filename)    
    @wait_count = Wait_Time
    # If file doesn't exist
    unless FileTest.exist?(filename)
      # Play buzzer SE
      $game_system.se_play($data_system.buzzer_se)
      return
    end
    @message_window.visible = true
    # Play load SE
    $game_system.se_play($data_system.load_se)
    # Read save data
    file = File.open(filename, "rb")
    read_save_data(file)
    # Initialize loop count
    @loop_count = 0
    # Loop
    loop do
      Graphics.update
      Input.update
      # Add 1 to loop count
      @loop_count += 1
      # If 100 event commands ran
      if @loop_count > 100
        # Call Graphics.update for freeze prevention
        Graphics.update
        @loop_count = 0
      end
      if @wait_count > 0
        # Decrease wait count
        @wait_count -= 1
        if @wait_count == 0
          Graphics.freeze
          break
        end
      end
      break if Input.repeat?(Input::C)
    end
    file.close
    # Restore BGM and BGS
    $game_system.bgm_play($game_system.playing_bgm)
    $game_system.bgs_play($game_system.playing_bgs)
    # Update map (run parallel process event)
    $game_map.update
    # Switch to map screen
    $scene = Scene_Map.new
  end
end
 
 
#==============================================================================
# ** Window_LoadMessage
#------------------------------------------------------------------------------
#  This window displays the loading message
#==============================================================================
 
class Window_LoadMessage < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(320 - ((Text.length * 15) / 2), 208, Text.length * 15, 96)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
    self.visible = false
    self.z = 999
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text((self.width / 2) - ((Text.length * 15) / 2), 0,
    Text.length * 10, 64, Text, 2)
  end
 
end
 
#==============================================================================
#
# *** END OF SCRIPT ***
#
#==============================================================================
 
 
[/rgss]



Instructions

In the top of the script there are two Constant variables that you can edit. Just change them to your liking and the script does the rest.


Compatibility


There shouldn't be an compatibility issues, however if there are, please report them.


Credits and Thanks


Thanks to gRaViJa for the idea and request.


Terms and Conditions

Please just give me credit if you decide to use this script, thanks :D
 
Looks a really good add-on!
I am curious, though.
Doesn't the files on XP load right when you press the Comfirm button?
Is this only a aesthetical script? Meaning, it's only for appearance?
Or is it for games that need tie to load?
 
Thanks! And yea, this is only an visual script, it's for the appearance, it doesn't actually tie in to the loading of the file. It's just supposed to make it more professional looking, as RMXP loads games pretty quickly.
 
As far as I'm concerned, it's more professional to load a file immediately if possible, rather than forcing an unnecessary loading screen. Instead of mimicking disc-based systems that have to find the right spot on the disc and load it, which takes time, you're better off taking full advantage of the system you're on, which doesn't have to do that. To force the player to wait unnecessarily is not a professional thing to do, and anyone with experience in RM* games will know immediately that this is an artificial wait at best.
 
Well the person that requested this script probably didn't have that intention in mind, but I'm sure there are other ways you can use this script, like giving a message to the player before the game starts. I was just giving an example on a way this script can be used. And besides, not all games made here are supposed to be strictly designed for the RM community.
 
I approve of this script. It's something I would have done in my scripting days :p
Though, tbh, I do recommend a different example. As glitch pointed out, anyone who has played RM knows there's no loading time. Perhaps a SNES Super Mario styled "Mario Start!" or just "Welcome Back, \n[0]!"
All in all, I love it. I would clarify the title as "Message on Game Load" and change the example to anything other than Loading. You can always reply to a request and link to your thread if you don't think they'd find it under different pretenses - I've done that a dozen or so times, works well.

I'm glad to see an active scripter around, keep it up! :D
 
Thanks TheScripter for this script. And my intention was indeed to create some sort of a reminder message, it's not an artificial wait message.
 
@Theory: Thanks! And yea, I changed the title and the example, I guess I just misunderstood the point of the original request. And yea, I used to release scripts to RRR, and I've decided to release some more again, so I hope I can continue. Thanks for your comments :D

@gRaViJa: Ah yea, I see what you mean now, it was just a misunderstanding on my part. And I'm glad I could make this for you :)
 
Along with having the wait time, implement a small part where the user can press the action key to skip the message. Unless you can already do that, I just glanced at the code.
 
@game_guy: That's a nice idea, I didn't have that in yet, but I just updated the script to contain that feature. Thanks!

@Juan: Thanks! I hope it works well with your game!
 
:shock: Law, :biggrin: Cools, I thought someone else was posting your scripts there at first.

Great to see you around agian, and this is quite a nice little idea. I can sort of imagine it in use for either a futuristic game - as in the 'program' welcoming you back, or even in a mystical style. So yeah totally see where the requester was coming from.
 
Holder!!!! Woah, would have never thought I would see you again, man!! Wow, I'm in shock lol :biggrin: But, yea, I couldn't resist the temptation to come back to RM forums. The reason I didn't come back to RRR was because I knew I would become addicted again, and here at HBgames, I'm not as addicted for some reason lol (probably because of the less activity). But yea, I mainly came here to get better at scripting to put those skills to the new game I'm creating. And I'm glad you like the script :) Oh, and how's RRR been?
 

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