AWorks Frame Skip
#1
AWorks Frame Skip
Created by: AWorks(vgvgf)
Version: 1.10
Updated: 11/08/2009(dd/mm/yyyy)

Description
This script lets the game to skip frames, and as these frames are not drawed the game will advance faster. You should have seen these function on emulators. This script can be used as a cheat feature, or as a debugging tool.

For installing it, just copy&paste it on a new section. On PlayTest mode press ALT for skipping frames.

Script Code
Code:
#==============================================================================
# *** AWorks Frame Skip(AFS)
#------------------------------------------------------------------------------
# Creted by AWorks(vgvgf)
# Version: 1.10
# Updated: 11/08/2009 (dd/mm/yyyy)
#------------------------------------------------------------------------------
#==== Description ====
# This script lets the game to skip frames, and as these frames are not drawed
# the game will advance faster.
# Compatible with RMXP and RMVX.
#------------------------------------------------------------------------------
#==== Instructions ====
# There are two frame skip modes, one which skip frames each time the screen
# is updated, and the other which will skip an amount of frames per second.
# The first one will let the game to play faster, but the second one is
# smoother.
#
# * Graphics.frame_skip_mode = mode
#   Changes the frame skip mode. Set it to 0 or 1.
#
# * Graphics.frame_skip_rate = rate
#   Changes the frame skip rate, the higher the number the faster it goes.
#   If it is 0, frame skip will be deactivated.
#
# * FRAME_SKIP_PLAY_TEST
#   If true, frame skip will be activated when a key is press on Play Test
#   mode. ALT by default.
#
# * FRAME_SKIP_PLAY_TEST_MODE
#   Change the frame skip mode for Play Test.
#
# * FRAME_SKIP_PLAY_TEST_RATE
#   Change the frame skip rate for Play Test.
#
# * FRAME_SKIP_PLAY_TEST_BUTTON
#   Change the frame skip key for Play Test.
#==============================================================================

#==============================================================================
# ** Graphics Module
#==============================================================================
module Graphics
  #----------------------------------------------------------------------------
  # * Opciones
  #----------------------------------------------------------------------------
  FRAME_SKIP_PLAY_TEST = true
  FRAME_SKIP_PLAY_TEST_MODE = 0
  FRAME_SKIP_PLAY_TEST_RATE = 5
  FRAME_SKIP_PLAY_TEST_BUTTON = Input::ALT
  #----------------------------------------------------------------------------
  # * Variables
  #----------------------------------------------------------------------------
  @frame_skip_rate = 0
  @frame_skip_count = 0
  @frame_skip_mode = 0
  #----------------------------------------------------------------------------
  FRAME_SKIP_PLAY_TEST = false if (!$DEBUG and !$TEST and !$BTEST) or
                                  FRAME_SKIP_PLAY_TEST_RATE <= 0
  class << self
    attr_accessor(:frame_skip_rate, :frame_skip_mode)
    if @aworks_frameskip_alias.nil?
      alias_method(:aworks_graphics_update, :update)
      alias_method(:aworks_graphics_transition, :transition)
      @aworks_frameskip_alias = true
    end
    #--------------------------------------------------------------------------
    # * Update
    #--------------------------------------------------------------------------
    def update(*args)
      if @frame_skip_rate > 0
        if @frame_skip_mode == 0
          @frame_skip_count += 1
          if @frame_skip_count >= @frame_skip_rate
            @frame_skip_count = 0
          else
            return
          end
        else
          @frame_skip_count += [@frame_skip_rate, frame_rate / 2].min
          if @frame_skip_count >= frame_rate
            @frame_skip_count = 0
            return
          end
        end
      elsif FRAME_SKIP_PLAY_TEST and Input.press?(FRAME_SKIP_PLAY_TEST_BUTTON)
        if FRAME_SKIP_PLAY_TEST_MODE == 0
          @frame_skip_count += 1
          if @frame_skip_count >= FRAME_SKIP_PLAY_TEST_RATE
            @frame_skip_count = 0
          else
            return
          end
        else
          @frame_skip_count += [@frame_skip_rate,
                                FRAME_SKIP_PLAY_TEST_RATE / 2].min
          if @frame_skip_count >= FRAME_SKIP_PLAY_TEST_RATE
            @frame_skip_count = 0
            return
          end
        end
      end
      aworks_graphics_update(*args)
    end
  end
end
Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   Skip Title Once VX + ACE kyonides 0 25 11-03-2024, 12:39 AM
Last Post: kyonides
   Skip Battle Messages Helladen 1 6,012 08-06-2012, 01:34 AM
Last Post: Helladen
   Skip Battle Log Helladen 0 4,784 08-02-2012, 10:49 AM
Last Post: Helladen
   Skip Party Command Window Helladen 0 4,905 07-27-2012, 06:43 AM
Last Post: Helladen
   Victor Engine - Skip Battle Log Victor Sant 0 4,954 01-09-2012, 05:27 AM
Last Post: Victor Sant
   Xenres' Title Skip Kirito 0 5,530 11-25-2010, 06:03 AM
Last Post: Kirito
   AWorks Fix Walk Speed VX vgvgf 0 4,438 09-23-2009, 11:41 PM
Last Post: vgvgf
   [Unsupported] Title Skip 2 VX PK8 0 4,868 12-07-2008, 12:36 PM
Last Post: PK8



Users browsing this thread: 1 Guest(s)