Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 P's Pause Script v2.0.1 (Updated: July 5th, 2009) [Exclusive]
#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 }


Messages In This Thread
P's Pause Script v2.0.1 (Updated: July 5th, 2009) [Exclusive] - by Zeriab - 05-25-2009, 03:02 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
   Keyboard Name Input - Updated DerVVulfman 0 1,411 01-05-2022, 04:25 AM
Last Post: DerVVulfman
   Text Scroll Script - Enhanced DerVVulfman 23 30,398 02-18-2021, 04:16 AM
Last Post: DerVVulfman
   Cursor Script Selwyn 7 13,406 09-28-2019, 02:13 PM
Last Post: DerVVulfman
   ACBS FIX SCRIPT #2: Advanced Cry Correction DerVVulfman 1 4,074 08-09-2019, 03:42 PM
Last Post: aeliath
   ACBS FIX SCRIPT #1: Victory Cries Patch DerVVulfman 1 4,029 08-08-2019, 02:53 PM
Last Post: aeliath
   Archived Script Listings DerVVulfman 9 34,383 01-08-2019, 04:27 AM
Last Post: DerVVulfman
   Spritesheet Generator Conversion Script DerVVulfman 0 3,695 11-21-2018, 04:48 AM
Last Post: DerVVulfman
   Neo Mode 7 Script by MGCaladtogel MGC 59 112,875 09-29-2017, 03:48 AM
Last Post: DerVVulfman
   Longer Script Calls LiTTleDRAgo 0 4,471 05-17-2017, 12:36 AM
Last Post: LiTTleDRAgo
   SLOLS: Snake Look-alike on Load Script Zeriab 3 10,351 05-14-2017, 06:25 PM
Last Post: LiTTleDRAgo



Users browsing this thread: