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.

Closing windows after timer expires.

Hey guys, I feel like this should be easy to solve, but the solution is evading me. I want the message window and number input window to close (automatically) after the timer reaches 0. I don't know too much (or anything) regarding RGSS, but I expect it would have something to do with disposing those windows. (How to do that via Call, I have no idea.)

Help would be appreciated!
 

MicKo

Member

Try this, in a new script above Main:
[ruby]#==============================================================================
# ** Window_Message
#------------------------------------------------------------------------------
#  This message window is used to display text.
#==============================================================================
 
class Window_Message < Window_Selectable
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :input_number_window
end
 
#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
#  This class performs map screen processing.
#==============================================================================
 
class Scene_Map
  #--------------------------------------------------------------------------
  # * Terminate Message
  #--------------------------------------------------------------------------
  def terminate_message
    unless @message_window.nil?
      @message_window.terminate_message
      unless @message_window.input_number_window.nil?
        @message_window.input_number_window.dispose
        @message_window.input_number_window = nil
      end
    end
  end
end
[/ruby]
Now you just have to call $scene.terminate_message when the timer reaches 0.
 
UMS (Ccoa's Universal Message System) has a \w[#] escape sequence to dismiss the message window after # frames. However, it currently only dismisses the message window and choice window.
It could easily be modified to also dismiss the input number window.
 
Brewmeister":thywgh3j said:
UMS (Ccoa's Universal Message System) has a \w[#] escape sequence to dismiss the message window after # frames. However, it currently only dismisses the message window and choice window.
It could easily be modified to also dismiss the input number window.

That would be perfect... As I tried to dismiss the number input window with the \w[#] command (which failed).

MicKo, I'll try that out! Thanks.

EDIT : MicKo, THANK YOU! It works. :)
 

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