查看: 4115|回复: 1

[已经过期] 全局加速脚本希望得到改进

[复制链接]
梦石
0
星屑
50
在线时间
65 小时
注册时间
2008-5-15
回帖
29
发表于 2013-3-20 10:29:28 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
[pre lang="ruby" line="1"]=begin

Speed Up Frame Rate During Test Play (Snippet)
by PK8
Created: 6/15/12
Modified: -
──────────────────────────────────────────────────────────────────────────────
■ Author's Notes
   I made it mainly so I can wade through an unskippable cutscene for a project
   I was testing out.
──────────────────────────────────────────────────────────────────────────────
■ Introduction
   This script lets you speed up the frame rate of your project either
   automatically or with the touch of a button during test play. Useful if you
   really want to speed up battles, unskippable cutscenes, or whatever else you
   want to fast forward through during test play.
──────────────────────────────────────────────────────────────────────────────
■ Features
   o Speed up the frame rate of your game via button press or automatically
     while testplaying.
   o Set the value of the new frame rate. Can be absolute or relative.
──────────────────────────────────────────────────────────────────────────────
■ Changelog (MM/DD/YYYY)
   o v1    (06/15/2012): Initial Release
──────────────────────────────────────────────────────────────────────────────
■ Methods Aliased
   Graphics.update
──────────────────────────────────────────────────────────────────────────────
■ Thanks
   EJlol and Kore for watching me script it during a stream.

=end

#==============================================================================
# ** CONFIGURATION
#==============================================================================

module PK8
  class Framerate_Speedup
    #--------------------------------------------------------------------------
    # * General Settings
    #--------------------------------------------------------------------------
    Switch   = true     # Set true to enable. Set false to disable.
   
    Relative = true     # Set true to raise FPS relative to the value.
                        # Set false to set absolute value to the FPS.
    Value    = 40       # Set value of new frame rate
   
    Auto     = false    # Set to true to raise the frame rate automatically.
                        # Set to false to press a button to raise the fps.
    Button   = "ALT"    # Set Input button
  end
end

#==============================================================================
# ** Graphics
#------------------------------------------------------------------------------
#  The module that carries out graphics processing.
#==============================================================================

module Graphics
  class << self
    #--------------------------------------------------------------------------
    # * Alias Listings
    #--------------------------------------------------------------------------
    unless method_defined?(:pk8_frsu_update)
      alias_method(:pk8_frsu_update, :update)
    end
    #--------------------------------------------------------------------------
    # * Frame Update
    #--------------------------------------------------------------------------
    def update(*args)
      if PK8::Framerate_Speedup::Switch == true and $TEST
        button = PK8::Framerate_Speedup::Button
        button = eval("Input::#{button}") if button.is_a?(String)
        real_fps = self.frame_rate
        if PK8::Framerate_Speedup::Relative == true
          new_fps = real_fps + PK8::Framerate_Speedup::Value
        else
          new_fps = PK8::Framerate_Speedup::Value
        end
        if PK8::Framerate_Speedup::Auto == true; self.frame_rate = new_fps
        else; self.frame_rate = (Input.press?(button) ? new_fps : real_fps)
        end
      end
      pk8_frsu_update(*args)
      if PK8::Framerate_Speedup::Switch == true and $TEST
        self.frame_rate = real_fps
      end
    end
  end
end[/pre]

这是很了不起的脚本

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

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

感激不尽
梦石
0
星屑
55
在线时间
461 小时
注册时间
2008-11-19
回帖
525
发表于 2013-8-6 09:48:57 | 显示全部楼层
似乎已經內建有自動加速功能了...在第49行
Auto     = false    # Set to true to raise the frame rate automatically.
改為
Auto     = true    # Set to true to raise the frame rate automatically.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部