Jump to content
Sign in to follow this  
efeberk

Simple Pause Script

Recommended Posts

                                   Simple Pause Script for RGSS3

by efeberk

 

 

Introduction
 

 

It will enables player to pause in map or battle. All actions will be paused as you saw on screenshot #2.
 
- Set key, picture name in module.
 
Requires: Vlue's Special Keybind Script.
 
Get this script : HERE
 
Only for RPG Maker VX Ace.
 
Credit me or don't. It is your decision but credit Vlue.
 
Screenshots : 
 

34q7pmx.png
 
ama1vo.png

 
Script : 
 

#==============================================================================
#   Simple Pause Script for RGSS3
#   Developer: efeberk
#   Created: 13/05/2013
#   Version: 1.0
#==============================================================================
# Instructions
# -----------------------------------------------------------------------------
# It will enables player to pause in map or battle. 
# Set key, picture name in module.
#==============================================================================
# Requires: Vlue's Special Keybind Script.
# Get this script : http://www.rpgmakervxace.net/topic/7670-special-keybinds/
#==============================================================================
#  Only for RPG Maker VX Ace.
#==============================================================================
#  Credit me or don't. It is your decision but Credit Vlue.
#==============================================================================

module EFEBERK
  
  # Switch ID which will give permit to pause to player. 
  # If ON, player can pause. If OFF, player can't pause.
  # Set 0 to enable for all.
  PAUSE_POSSIBLE = 0
  
  
  # Image name in Graphics/System folder which will be shown when paused
  PAUSE_PICTURE = "PAUSE" 
  
  
  # The key which will pause the game.
  PAUSE_KEY = 
  
  # If you wanna stop time also, set true.
  PAUSE_TIME = true
  
end

class Scene_Map < Scene_Base
  alias efeberk_pause_scene_map_update update
  def update
    @viewport_efe = Viewport.new(0, 0, Graphics.width, Graphics.height)
    @viewport_efe.z = 9999999
    @sprite_efe = Sprite.new(@viewport_efe)
    if $game_switches[EFEBERK::PAUSE_POSSIBLE] || EFEBERK::PAUSE_POSSIBLE == 0
      if Keyboard_Input.press?(EFEBERK::PAUSE_KEY)
        @sprite_efe.bitmap = Cache.system(EFEBERK::PAUSE_PICTURE)
        efe = Graphics.frame_count
        while true
          if EFEBERK::PAUSE_TIME
            Graphics.frame_count = efe
          end
          Graphics.update
          Keyboard_Input.update
          if Keyboard_Input.press?(EFEBERK::PAUSE_KEY)
            @sprite_efe.dispose
            @sprite_efe = nil
            break
          end
        end
      end
    end
    efeberk_pause_scene_map_update
  end
end

class Scene_Battle < Scene_Base
  alias efeberk_pause_scene_battle_update update
  def update
    @viewport_efe = Viewport.new(0, 0, Graphics.width, Graphics.height)
    @viewport_efe.z = 9999999
    @sprite_efe = Sprite.new(@viewport_efe)
    if $game_switches[EFEBERK::PAUSE_POSSIBLE] || EFEBERK::PAUSE_POSSIBLE == 0
      if Keyboard_Input.press?(EFEBERK::PAUSE_KEY)
        @sprite_efe.bitmap = Cache.system(EFEBERK::PAUSE_PICTURE)
        efe = Graphics.frame_count
        while true
          if EFEBERK::PAUSE_TIME
            Graphics.frame_count = efe
          end
          Graphics.update
          Keyboard_Input.update
          if Keyboard_Input.press?(EFEBERK::PAUSE_KEY)
            @sprite_efe.dispose
            @sprite_efe = nil
            break
          end
        end
      end
    end
    efeberk_pause_scene_battle_update
  end
end

 

 

Edited by efeberk

Share this post


Link to post
Share on other sites

I hope this isn't violating rules by posting here after 3 months of inactivity on this post.

This is a great script! I am going to be using this in my game most likely! I have a question, would it be possible to make it so when the pause screen is brought up, a choice menu is pulled up too? Because I want people to be able to select from options like "Resume", "Options", "Help", "Quit", etc. If you or anyone could help that would be GREAT! :D 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted