Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

In-game FPS Booster (switch) Version 1.4 Available!

Credit goes to sandgolem for the idea.

What this script does: Allows you to switch between fast and normal speed during debugging by presing F7

Notes: Again, this was not completely my idea, but it IS different than sandgolem's script.
Just put this joker in a new script above main.

Code:
################################################################################
#Gammastar's In-game Speed Booster Version 1.1
#
#No need to give credit, since anyone playing the real game
#can't use this.
################################################################################

if $DEBUG
class Game_Map
  alias gammastar_gamemap update
  def update
    gammastar_gamemap
      if Input.trigger?(Input::F7)
        $game_system.se_play($data_system.decision_se)
        if Graphics.frame_rate != 120
          Graphics.frame_rate = 120
        else
          Graphics.frame_rate = 40
      end
    end
  end
end


class Scene_Battle
  alias gammastar_scenebattle update
  def update
    gammastar_scenebattle
    if Input.trigger?(Input::F7)
        $game_system.se_play($data_system.decision_se)
        if Graphics.frame_rate != 120
          Graphics.frame_rate = 120
        else
          Graphics.frame_rate = 40
        end
      end
    end
  end
end

Thanks to Arbiter for helping out.

------------Version 1.4-------------

I have released version 1.4! This allows you to select 3 different speed settings! Just for the fun of it. There is no real update. This is just if you want a different speed. If you're content with the last version, just use it. I use it.

Code:
################################################################################
#Gammastar's In-game Speed Booster Version 1.4
#
#No need to give credit, since anyone playing the real game
#can't use this.
################################################################################

if $DEBUG
class Game_Map
  alias gammastar_gamemap update
  def update
    gammastar_gamemap
      if Input.trigger?(Input::F7)
        $game_system.se_play($data_system.decision_se)
        $previous_scene = $scene
        $scene = Scene_DebugSpeedWindow.new
      end
    end
  end
end

class Scene_Battle
  alias gammastar_scenebattle update
  def update
    gammastar_scenebattle
    if Input.trigger?(Input::F7)
      $game_system.se_play($data_system.decision_se)
      $previous_scene = $scene
      $scene = Scene_DebugSpeedWindow.new
    end
  end
end

#Not necessary on menu, but is a little more convenient.
if $DEBUG
  class Scene_Menu
    alias gammastar_scenemenu update
    def update 
      gammastar_scenemenu
      if Input.trigger?(Input::F7)
      $game_system.se_play($data_system.decision_se)
      $previous_scene = $scene
      $scene = Scene_DebugSpeedWindow.new
      end
    end
  end
end
This also requires another script, so here it is:

Code:
#Gammastar's Speed Chooser. Use in conjunction with In-game FPS Booster.
class Scene_DebugSpeedWindow 
   def main 
    s1 = "Default"
    s2 = "Fast"
    s3 = "Really Fast"
    s4 = "What the?!"
    @command_window = Window_Command.new(192, [s1, s2, s3, s4])
    @command_window.x = 320 - @command_window.width / 2
    @command_window.y = 240 - @command_window.height / 2
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @command_window.dispose
    if $scene.is_a?(Scene_Title)
      Graphics.transition
      Graphics.freeze
    end
  end
  def update
    @command_window.update
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = $previous_scene
      return
    end
    if Input.trigger?(Input::C)
      case @command_window.index
      when 0  
        command_normal
      when 1  
        command_fast
      when 2  
        command_reallyfast
      when 3
        command_wtf
      end
      return
    end
  end
  def command_normal
    $game_system.se_play($data_system.decision_se)
    Graphics.frame_rate = 40
    $scene = $previous_scene
  end
  def command_fast
    $game_system.se_play($data_system.decision_se)
    Graphics.frame_rate = 80
    $scene = $previous_scene
  end
  def command_reallyfast
    $game_system.se_play($data_system.decision_se)
    Graphics.frame_rate = 100
    $scene = $previous_scene
  end
  def command_wtf
    $game_system.se_play($data_system.decision_se)
    Graphics.frame_rate = 150
    $scene = $previous_scene
  end  
end

I don't guess it matters where you put this one, but I put it above the original when I used it.
 
Thanks Arbiter. I should have considered battle. I'll go fix it (even though you did, it's on gamebaker forums as well).

I'm thinking of adding speed settings (like "Fast", "Really Fast", and "What the...*BOOM*"), but that would just be a separate script (so the ones who want a simple version have it).

----------------------------------

Edit: Ok, I added in another section (allows you to turn on/off on menu. Not all that important, but if it's on when you go to the menu and you want to turn it off, you don't have to leave the menu.)

Just throw this code in on the end (and update the title to "Version 1.3")

Code:
#Not necessary on menu, but is a little more convenient.
if $DEBUG
  class Scene_Menu
    alias gammastar_scenemenu update
    def update 
      gammastar_scenemenu
      if Input.trigger?(Input::F7)
        $game_system.se_play($data_system.decision_se)
        if Graphics.frame_rate != 120
          Graphics.frame_rate = 120
        else
          Graphics.frame_rate = 40
        end
      end
    end
  end
end
 
I have noticed that there is a glitch where [on the menu] the playtime is a lot less when you're sped up, then when you switch back it's a lot more. I'm not sure how to fix this, but it's not really that important.
 
ok, well, I have a version that turns the booster on while you hold A (most likely Z on your keyboard), but I don't want to post it (since the first post is getting crowded), so if you want it, PM me.
 
In 'main', after 'begin', add this line:
Code:
Graphics.frame_rate = NUMBER
Note that 120 is maximum in RMXP.

Btw, nice script Gammastar :)
 
It would probably be better to alias the update method in the Graphics or Input module as oppossed of the update method in individual scenes. Why update multiple scenes when we can just alias one thing? ^_^

Code:
module Graphics
  class << self
    alias_method :sephgammastar_fpschange_grphcs_update, :update
    def update
      if Input.trigger?(Input::ALT)
        Graphics.frame_rate = Graphics.frame_rate == 120 ? 40 : 120
      end
      sephgammastar_fpschange_grphcs_update
    end
  end
end

Something like that. ;)
       
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top