Project1

标题: 全局加速脚本希望得到改进 [打印本页]

作者: 牲口    时间: 2013-3-20 10:29
标题: 全局加速脚本希望得到改进
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    = 40       # Set value of new frame rate
  48.  
  49.     Auto     = false    # Set to true to raise the frame rate automatically.
  50.                         # Set to false to press a button to raise the fps.
  51.     Button   = "ALT"    # Set Input button
  52.   end
  53. end
  54.  
  55. #==============================================================================
  56. # ** Graphics
  57. #------------------------------------------------------------------------------
  58. #  The module that carries out graphics processing.
  59. #==============================================================================
  60.  
  61. module Graphics
  62.   class << self
  63.     #--------------------------------------------------------------------------
  64.     # * Alias Listings
  65.     #--------------------------------------------------------------------------
  66.     unless method_defined?(:pk8_frsu_update)
  67.       alias_method(:pk8_frsu_update, :update)
  68.     end
  69.     #--------------------------------------------------------------------------
  70.     # * Frame Update
  71.     #--------------------------------------------------------------------------
  72.     def update(*args)
  73.       if PK8::Framerate_Speedup::Switch == true and $TEST
  74.         button = PK8::Framerate_Speedup::Button
  75.         button = eval("Input::#{button}") if button.is_a?(String)
  76.         real_fps = self.frame_rate
  77.         if PK8::Framerate_Speedup::Relative == true
  78.           new_fps = real_fps + PK8::Framerate_Speedup::Value
  79.         else
  80.           new_fps = PK8::Framerate_Speedup::Value
  81.         end
  82.         if PK8::Framerate_Speedup::Auto == true; self.frame_rate = new_fps
  83.         else; self.frame_rate = (Input.press?(button) ? new_fps : real_fps)
  84.         end
  85.       end
  86.       pk8_frsu_update(*args)
  87.       if PK8::Framerate_Speedup::Switch == true and $TEST
  88.         self.frame_rate = real_fps
  89.       end
  90.     end
  91.   end
  92. end


这是很了不起的脚本

使用方法是按住Alt时加速游戏 提高 "Value    = 40  "帧

希望巨巨能帮我改进成 某开关打开时候加速 并且帧数可调节

感激不尽
作者: sai90306    时间: 2013-8-6 09:48
似乎已經內建有自動加速功能了...在第49行
Auto     = false    # Set to true to raise the frame rate automatically.
改為
Auto     = true    # Set to true to raise the frame rate automatically.




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