Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Pause Script
#1
Pause Script
by Arbiter

I noticed you didn't have a pause script so I thought I would write a quick one, sorry my standards have slipped and I have used scenes, meh, what can you do. I do not usually post scripts as I am very paranoid of criticism and note this is only a small one because you didn't have one already I don't think.
Quote: To pause the game simply press Z on the keyboard while you are on the map
and to unpause just press the Z key again.
Contains a pause graphic - import it into your projects picture folder.

To change the pause graphic import a new graphic into your pictures folder
then go to line 48 and change the word Pause to the name of your graphic.
To change the pause BGM go to line 52 and change the name of the BGM to the
BGM of your choice, 001-Battle01, 002-Battle02 for example.
Code:
#===============================================================================
# Script: Pause
# Version: 1.0
# Author: Arbiter
#===============================================================================
#===============================================================================
# To pause the game simply press Z on the keyboard while you are on the map
# and to unpause just press the Z key again.
# Contains a pause graphic - import it into your projects picture folder.

# To change the pause graphic import a new graphic into your pictures folder
# then go to line 48 and change the word Pause to the name of your graphic.
# To change the pause BGM go to line 52 and change the name of the BGM to the
# BGM of your choice, 001-Battle01, 002-Battle02 for example.
#===============================================================================


class Scene_Pause
   def main
    @spriteset_map = Spriteset_Map.new
    @pause_window = Pause_Window.new
    @pause_window.x = 100
    @pause_window.y = 160
    @pause_window.height = 500
    @pause_window.width = 500
    @pause_window.opacity = 0
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @pause_window.dispose
  end

  def update
    if Input.trigger?(Input::A)
      $scene = Scene_Map.new
      Audio.bgm_stop
    end
  end
end

class Pause_Window < Window_Base
  def initialize
    super(480, 480, 480, 480)
    self.contents = RPG::Cache.picture("pause")
    Audio.bgm_play("Audio/BGM/018-Field01", 100, 100)
  end
end

class Game_Map
  alias arbiter_pause_update :update
  def update
    arbiter_pause_update
    if Input.trigger?(Input::A)
      $scene = Scene_Pause.new
    else
      $game_system.bgm_play(@map.bgm)
    end
  end
end
Here is the pause graphic, do not laugh it was done quick for semi testing.
Content Hidden

I'm also going to write some tutorials for commands (well paste across ones I have already written) and for windows and others when I get some time.
Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   Text Scroll Script - Enhanced DerVVulfman 23 29,450 02-18-2021, 04:16 AM
Last Post: DerVVulfman
   Cursor Script Selwyn 7 12,965 09-28-2019, 02:13 PM
Last Post: DerVVulfman
   ACBS FIX SCRIPT #2: Advanced Cry Correction DerVVulfman 1 3,855 08-09-2019, 03:42 PM
Last Post: aeliath
   ACBS FIX SCRIPT #1: Victory Cries Patch DerVVulfman 1 3,842 08-08-2019, 02:53 PM
Last Post: aeliath
   Archived Script Listings DerVVulfman 9 33,299 01-08-2019, 04:27 AM
Last Post: DerVVulfman
   Spritesheet Generator Conversion Script DerVVulfman 0 3,533 11-21-2018, 04:48 AM
Last Post: DerVVulfman
   Neo Mode 7 Script by MGCaladtogel MGC 59 110,525 09-29-2017, 03:48 AM
Last Post: DerVVulfman
   Longer Script Calls LiTTleDRAgo 0 4,301 05-17-2017, 12:36 AM
Last Post: LiTTleDRAgo
   SLOLS: Snake Look-alike on Load Script Zeriab 3 10,082 05-14-2017, 06:25 PM
Last Post: LiTTleDRAgo
   Character Select Script Selwyn 3 9,398 03-07-2017, 04:14 AM
Last Post: JayRay



Users browsing this thread: