P's Pause Script v2.0.1 (Updated: July 5th, 2009) [Exclusive]
#1
Pause Script
Version: 2.0.1

Introduction
This script allows the player to temporarily stop the game and provides a pause screen. But, I wanted to make this script very customizable. (and much more customizable than my first pause script) for developers. This is by far the most customizable, in-depth pause script yet, packing in a great deal of features with unlimited graphical options to suit your needs of making the perfect pause screen for your game. You'll get to customize pretty much everything about the pause script including but not limited to music, graphics, transitions, audio settings, et cetera.

Features
  • Specify which maps disables pausing and specify which switch disables pausing if turned on.
  • Determine if pausing the game will stop the game's play time.
  • Set pause/unpause buttons, transitions (effect, duration, vague) and sound effects (file, volume, pitch).
  • Completely enable/disable pausing in maps and/or battles.
  • Lower volume of BGM/BGS during pause, give the pause screen a custom theme and/or pause the music altogether (this feature may not be perfect but that's all I can do).
  • Turn on/off a graphical element such as background tones, background images, graphics, rects, text and windows.
  • UNLIMITED GRAPHICAL OPTIONS. Add as many background tones, images, graphics, rects, text, windows as you like! Just don't overdose on this! :P
  • Set Z coordinates, tone, color, positioning, width and height of the background tones.
  • Set file, Z coordinates, tone, opacity, blend type, zoom, positioning(x/y), width/height and scrolling speed (x/y) of background images.
  • Set Windowskin, Z coordinates, wallpaper display method, opacity(window, background), positioning and width/height of windows.
  • Set file, Z coordinates, hue, tone, opacity, blend type, zoom, angle, mirror (flip horizontally) and x&y positioning of graphics.
  • Set text string, formatting, alignment, Z coordinates, opacity, blend type, zoom, angle, mirror and positioning of text.
  • Set Z coordinates, color, positioning, width/height, blend type and angle of rects.
Screenshots
[Image: 2djpcvm.png]

Downloads
Please copy-paste all of this into your script editor.

.txt   Pause 2 XP 1-5.txt (Size: 16.36 KB / Downloads: 21)
.txt   Pause 2 XP 2-5.txt (Size: 11.82 KB / Downloads: 16)
.txt   Pause 2 XP 3-5.txt (Size: 3.72 KB / Downloads: 17)
.txt   Pause 2 XP 4-5.txt (Size: 7.38 KB / Downloads: 16)
.txt   Pause 2 XP 5-5.txt (Size: 39.88 KB / Downloads: 19)

And place this into your project's Audio/ ME folder. It's a silent audio file. (Thanks SilentBackstabber!)
Paused.mp3

Add-ons Download Links Broken
Pause Disabled Sound Notifier (Requested by Yin)
Pause Random Background Tone/Color (Requested by Yin)
Pause Random Background Tone/Color Alternate Version (Requested by Yin)
Pause Random Background Image

Instructions
You can customize the pause screen to your liking in pages 3 and 4.

FAQ
I know the script and setting it up might confuse people so go ahead and ask away.

Compatibility
Aliases the update methods in both Scene_Map and Scene_Battle.

Credits and Thanks
  • DerVVulfman: Helped me out with a number of things, whenever I had asked for support and such. I forgot what exactly I needed help with but he helped out. *
  • MyOwnFriend: Convincing me to make a full-on script of the original pause script. *
  • Puppeto4: I really needed help on how to stop the play time. Pup mentioned something about Graphics.frame_count which I then thought to myself “Hmm... store the frame count in an instance variable then make said instance equal the Graphics.frame_count upon unpausing the game.” *
  • SilentBackstabber: Gave me some neat ideas and helped out a bit in the making of the original script. SBS had requested to have my pause script literally pause the music. I had somehow misread such a request and thought “Custom Pause Music? Totally adding to this script!” SBS really wanted my script to be able to literally pause the music and I just couldn't figure out a scripted solution to it. So then I thought of Music Effects and how they have a way of stalling the BGM. I had an idea in which I could make the ME play repeatedly during the pause screen therefore efficiently stalling the BGM for quite some time. I then needed help from someone to make me a 1-second sound effect that was silent. SBS made the sound effect and sent me the file. *
  • Shade: During chat in another site, he said "RPGs don't pause except in battles". By saying that, he had given me yet another idea for a feature to add in the script. (Dis)allow pausing in maps/battles were added to the script. *
  • Arbiter: His pause script made me want to make my own. *
  • NO: The features in his pause script, which was posted by Landarma in another site, gave me ideas on what else to implement in my original script. *
  • EJlol, MicKo, Yin, DerVVulfman: Giving their input on their preferences on how instructions should be laid out.
Not included in the thanks/credits for this script, I dedicate this script to Perihelion. I hope she's still working on Paradigm Shift.
* Was in the original pause script credits

Author's Notes
History
I might make some kind of editor to this.

Terms and Conditions
If you were to use this script, credit me somewhere in your project. This script is RMVXPUniverse exclusive. Do not post this script anywhere else. Simply link to this topic.
Reply }
#2
Pfew, awesome. I've never planned to use a pause script or anything, but now that I see that, I'm thinking of using it. :0

Well, the options & co are just awesome, and I'll take my time to read the instructions tomorrow (1:41am here ;_; ), but I already have a request, hrhr!

You know, I'm using ME for my battle musics... Is there a way to pause the music when in battle, and that it starts again when I "unpause" ? If I used BGMs I wouldn't pause the music but since MEs don't loop, if the player pauses the game, goes somewhere and comes back to the battle without any music, it would suck hard. :P And if I put Pause_MusicPause = true, the ME just stops and won't play again.

Well, good work on this, I'll try to give you more critics tomorrow!
Reply }
#3
For the maps that you can't pause on, can you put a notifier? Whenever the pause button is pressed, make something that flashes "can't pause here" on the bottom of the screen or even just an icon that flashes.
Reply }
#4
MicKo: @.@

Yin: Aww shoot! Why didn't I think of that? Alright. Here's a quick add-on I made up. :D
Pause Disabled Sound Notifier
Reply }
#5
Holy crud. I've been imagining a script like this. Despite my inexcusable hiatus on my project at the moment, this script will definitely get me back into it. Thanks.
Reply }
#6
Thanks, bro. o:

Update:
I made a new add-on for this script: Random Background Tone/Color requested by Yin.
Check it out here: click
Reply }
#7
Hey Punk. Good work on this script ^_^

I really like your documentation and commenting for the settings.
I do not like your indention (or lack-of rather) of the second settings page.
Take for example this:
Code:
Pause_Text[0] = [
"Paused.", # Text String
["Georgia", 22, false, false, # Font Name, Size, Bold, Italics
[255, 255, 255, 255]], # Text Color: Red, Green, Blue, Alpha
1, 5, # Alignment, Z Coordinate
255, 0, # Opacity, Blend Type
[100, 100], # Zoom X and Zoom Y
0, false, # Angle, Draw Horizontally?
[0, 0] # X and Y Positioning
]

I would suggest using indention to illustrate which part belongs to which part: (I.e. proper indention)
Code:
Pause_Text[0] = [
    "Paused.", # Text String
    ["Georgia", 22, false, false, # Font Name, Size, Bold, Italics
      [255, 255, 255, 255]], # Text Color: Red, Green, Blue, Alpha
    1, 5, # Alignment, Z Coordinate
    255, 0, # Opacity, Blend Type
    [100, 100], # Zoom X and Zoom Y
    0, false, # Angle, Draw Horizontally?
    [0, 0] # X and Y Positioning
  ]

On to the last page, the pause script code:
I don't like that you are doing all the processing in the constructor of the PK8_Pause_Script class script. Instead I would suggest creating a class method which you just call and let that method handle the time consuming processing so creating the object doesn't take an insanely long time. It could for example look like this:
Code:
class PK8_Pause_Script
  def self.run
    instance = self.new
    loop do
      Graphics.update
      Input.update
      instance.update
      if Input.trigger?(PK8::Pause_UPButton_Eval)
        instance.dispose
        $pk8_pause = nil
        break
      end
    end
  end

Since it is a pause script which can work in more than a specific scene you could consider integrating the pausing with the Input module rather than specific scenes.
If you need an example you can look at this pause script I have created:
Code:
#==============================================================================
# ** Pause with image
#------------------------------------------------------------------------------
# Zeriab
# Version 1.0
# 2009-05-23 (Year-Month-Day)
#------------------------------------------------------------------------------
# * Description :
#
#   This script changes the functionality of pressing F12 during the game
#   from resetting the game to (un)pausing the game. A picture is displayed
#   while the game is paused. (Having a picture is optional)
#------------------------------------------------------------------------------
# * License :
#
#   Copyright (C) 2009  Zeriab
#
#   This program is free software: you can redistribute it and/or modify
#   it under the terms of the GNU Lesser Public License as published by
#   the Free Software Foundation, either version 3 of the License, or
#   (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU Lesser Public License for more details.
#
#   For the full license see <http://www.gnu.org/licenses/>
#   The GNU General Public License: http://www.gnu.org/licenses/gpl.txt
#   The GNU Lesser General Public License: http://www.gnu.org/licenses/lgpl.txt
#------------------------------------------------------------------------------
# * Compatibility :
#
#   Is most likely not compatible with other pause scripts.
#------------------------------------------------------------------------------
# * Instructions :
#
#   Place this script anywhere above main.
#   The image file 'pause' present in Graphics/Pictures is used.
#   Note: No picture is shown if there is no 'pause' in Graphics/Pictures.
#==============================================================================

#=============================================================================
# ** Module Input
#=============================================================================
module Input
  class << self
    PAUSE_BUTTON = F6
    #-------------------------------------------------------------------------
    # * Aliases Graphics.update and Graphics.transition
    #-------------------------------------------------------------------------
    unless self.method_defined?(:zeriab_pause_update)
      alias_method(:zeriab_pause_update, :update)
    end
    def update(*args)
      zeriab_pause_update(*args)
      return unless trigger?(PAUSE_BUTTON)
      # Store frame count
      frame_count = Graphics.frame_count
      # Show pause image
      @sprite = Sprite.new
      @sprite.z = 9999
      begin
        @sprite.bitmap = RPG::Cache.picture('pause')
      rescue
        @sprite.bitmap = Bitmap.new(32,32)
      end
      # Update once so the trigger doesn't count.
      zeriab_pause_update(*args)
      # Update until trigger
      while !trigger?(PAUSE_BUTTON)
        zeriab_pause_update(*args)
        Graphics.update
      end
      # Dispose pause image
      @sprite.dispose
      # Set proper frame count
      Graphics.frame_count = frame_count
    end
  end
end

*hugs*
- Zeriab
Reply }
#8
Posting here because of a number of things. :P

Hey Zeriab, thanks for your critique on the indentation of the settings. I was trying to wrap my head around how I was going to lay the settings out but it was a bit difficult. I decided to indent the settings. :D Also, could you please teach me a bit about that third code? :o

Update:
There was a bug in my pause script, mainly for those who were using the flicker effects for the background tones. Please update to version 2.0.1 now. :P
Reply }
#9
Oh sweet! I've tested this baby and I love all the options you put in there! :D
I've configured it so that it shows a image and plays a nice relaxing BGM.
I'm just wondering though...
When you pause, it stops the map's BGM, all fine and good of course, but is there an option to resume the audio rather than re-start it?

Either way, nice script! ^_^v
Reply }
#10
It's not possible to resume the audio rather than restart it unless you have a custom audio system which memorization and/or pausing the bgm.

@Punk: Sorry about not noticing your request earlier >_>
I'm not really sure what to teach you about. You just have to use PK8_Pause_Script.run
Is it perhaps the fourth code, i.e. my pause script you are talking about?
[Image: ZeriabSig.png]
Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   Keyboard Name Input - Updated DerVVulfman 0 1,880 01-05-2022, 04:25 AM
Last Post: DerVVulfman
   Text Scroll Script - Enhanced DerVVulfman 23 34,329 02-18-2021, 04:16 AM
Last Post: DerVVulfman
   Cursor Script Selwyn 7 15,366 09-28-2019, 02:13 PM
Last Post: DerVVulfman
   ACBS FIX SCRIPT #2: Advanced Cry Correction DerVVulfman 1 4,777 08-09-2019, 03:42 PM
Last Post: aeliath
   ACBS FIX SCRIPT #1: Victory Cries Patch DerVVulfman 1 4,711 08-08-2019, 02:53 PM
Last Post: aeliath
   Spritesheet Generator Conversion Script DerVVulfman 0 4,254 11-21-2018, 04:48 AM
Last Post: DerVVulfman
   Neo Mode 7 Script by MGCaladtogel MGC 59 125,488 09-29-2017, 03:48 AM
Last Post: DerVVulfman
   Longer Script Calls LiTTleDRAgo 0 4,966 05-17-2017, 12:36 AM
Last Post: LiTTleDRAgo
   SLOLS: Snake Look-alike on Load Script Zeriab 3 11,286 05-14-2017, 06:25 PM
Last Post: LiTTleDRAgo
   Character Select Script Selwyn 3 10,739 03-07-2017, 04:14 AM
Last Post: JayRay



Users browsing this thread: 1 Guest(s)