Project1

标题: 这个脚本只能在DEBUG模式使用,求修改为正常游戏也可用的 [打印本页]

作者: 605533120    时间: 2015-10-4 19:11
标题: 这个脚本只能在DEBUG模式使用,求修改为正常游戏也可用的
RUBY 代码复制
  1. =begin
  2.  
  3.  Speed Up Frame Rate During Test Play (Snippet)
  4.  by PK8
  5.  Created: 6/15/12
  6.  Modified: -
  7.  ──────────────────────────────────────────────────────────────────────────────
  8.  ■ Author's Notes
  9.    I made it mainly so I can wade through an unskippable cutscene for a project
  10.    I was testing out.
  11.  ──────────────────────────────────────────────────────────────────────────────
  12.  ■ Introduction
  13.    This script lets you speed up the frame rate of your project either
  14.    automatically or with the touch of a button during test play. Useful if you
  15.    really want to speed up battles, unskippable cutscenes, or whatever else you
  16.    want to fast forward through during test play.
  17.  ──────────────────────────────────────────────────────────────────────────────
  18.  ■ Features
  19.    o Speed up the frame rate of your game via button press or automatically
  20.      while testplaying.
  21.    o Set the value of the new frame rate. Can be absolute or relative.
  22.  ──────────────────────────────────────────────────────────────────────────────
  23.  ■ Changelog (MM/DD/YYYY)
  24.    o v1    (06/15/2012): Initial Release
  25.  ──────────────────────────────────────────────────────────────────────────────
  26.  ■ Methods Aliased
  27.    Graphics.update
  28.  ──────────────────────────────────────────────────────────────────────────────
  29.  ■ Thanks
  30.    EJlol and Kore for watching me script it during a stream.
  31.  
  32. =end
  33.  
  34. #==============================================================================
  35. # ** CONFIGURATION
  36. #==============================================================================
  37.  
  38. module PK8
  39.   class Framerate_Speedup
  40.     #--------------------------------------------------------------------------
  41.     # * General Settings
  42.     #--------------------------------------------------------------------------
  43.     Switch   = true     # Set true to enable. Set false to disable.
  44.  
  45.     Relative = true     # Set true to raise FPS relative to the value.
  46.                         # Set false to set absolute value to the FPS.
  47.     Value    = -45 # Set value of new frame rate
  48.  
  49.     # Set to true to raise the frame rate automatically.
  50.     Auto =  false
  51.     # Set to false to press a button to raise the fps.
  52.     Button   = "ALT"    # Set Input button
  53.   end
  54. end
  55.  
  56. #==============================================================================
  57. # ** Graphics
  58. #------------------------------------------------------------------------------
  59. #  The module that carries out graphics processing.
  60. #==============================================================================
  61.  
  62. module Graphics
  63.   class << self
  64.     #--------------------------------------------------------------------------
  65.     # * Alias Listings
  66.     #--------------------------------------------------------------------------
  67.     unless method_defined?(:pk8_frsu_update)
  68.       alias_method(:pk8_frsu_update, :update)
  69.     end
  70.     #--------------------------------------------------------------------------
  71.     # * Frame Update
  72.     #--------------------------------------------------------------------------
  73.     def update(*args)
  74.       if PK8::Framerate_Speedup::Switch == true and $TEST
  75.         button = PK8::Framerate_Speedup::Button
  76.         button = eval("Input::#{button}") if button.is_a?(String)
  77.         real_fps = self.frame_rate
  78.         if PK8::Framerate_Speedup::Relative == true
  79.           new_fps = real_fps + PK8::Framerate_Speedup::Value
  80.         else
  81.           new_fps = PK8::Framerate_Speedup::Value
  82.         end   
  83.         if PK8::Framerate_Speedup::Auto == true; self.frame_rate = new_fps
  84.         else; self.frame_rate = (Input.press?(button) ? new_fps : real_fps)
  85.         end
  86.       end
  87.       pk8_frsu_update(*args)
  88.       if PK8::Framerate_Speedup::Switch == true and $TEST
  89.         self.frame_rate = real_fps
  90.       end
  91.     end
  92.   end
  93. end

作者: taroxd    时间: 2015-10-4 19:12
删去脚本中两处 and $TEST




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1