设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 3429|回复: 1
打印 上一主题 下一主题

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

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
65 小时
注册时间
2008-5-15
帖子
44
跳转到指定楼层
1
发表于 2013-3-20 10:29:28 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
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  "帧

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

感激不尽

Lv1.梦旅人

梦石
0
星屑
55
在线时间
461 小时
注册时间
2008-11-19
帖子
607
2
发表于 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.
回复 支持 反对

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-4-24 06:14

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表