Save-Point
KuickTimeEvent XP - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Material Development (https://www.save-point.org/forum-8.html)
+--- Forum: Scripts Database (https://www.save-point.org/forum-39.html)
+---- Forum: HiddenChest (RGSS1-3) Engine (https://www.save-point.org/forum-118.html)
+---- Thread: KuickTimeEvent XP (/thread-13482.html)



KuickTimeEvent XP - kyonides - 05-19-2026

KuickTimeEvent XP
by Kyonides

Introduction

After releasing HiddenChest version 1.2.10, you can now setup custom QTE stuff in your games.

Two modes are available now:
  • Enter the maximum number of buttons expected by the script call.
  • Or enter them before time's up.

Script Calls:

Set a Button Sequence - Always type Symbols like :Enter, :KeyA or :N1 but not numbers!
Code:
Input.set_sequence(:Up, :Down, :Enter)

Set a Button Sequence - First Argument is the time in seconds:
Code:
Input.set_sequence_timer(30, :Up, :Down, :Ctrl)

Are both button sequences equal?
Code:
Input.same_sequence?

Don't forget to clear the sequence contents before you exit your custom scene or QTE stage.
Code:
Input.clear_button_sequence

The Script

Code:
# * KuickTimeEvent XP * #
#   Scripter : Kyonides
#   2026-05-19

class KTEScene
  def main
    @stage = :main
    @help_window = Window_Help.new
    @help_window.set_text("Press Start", 1)
    @bitmap = Bitmap.new(368, 96)
    @result_window = Window_Base.new(120, 128, 400, 128)
    @result_window.contents = @bitmap
    @result_window.visible = false
    Graphics.transition
    while @stage
      Graphics.update
      Input.update
      update
    end
    Graphics.freeze
    dispose
  end

  def update
    case @stage
    when :main
      if Input.trigger?(:C)
        $game_system.se_play($data_system.decision_se)
        @help_window.set_text("Enter the button sequence now", 1)
        Input.set_sequence(:Up, :Down, :Left, :Right)
        @stage = :test
      end
      return
    when :test
      unless Input.store_sequence
        $game_system.se_play($data_system.shop_se)
        @help_window.set_text("The Outcome", 1)
        @stage = :check
        if Input.same_sequence?
          text = "Success!"
        else
          text = "Epic Fail!"
        end
        targets  = "Targets:  " + Input.button_targets.join(", ")
        sequence = "Sequence: " + Input.button_sequence.join(", ")
        rect = @bitmap.rect.dup
        rect.height = 32
        @bitmap.draw_text(rect, text, 1)
        rect.y = 32
        @bitmap.draw_text(rect, targets)
        rect.y = 64
        @bitmap.draw_text(rect, sequence)
        @result_window.visible = true
      end
      return
    when :check
      if Input.trigger_any?
        $game_system.se_play($data_system.cancel_se)
        Input.clear_button_sequence
        $scene = Scene_Map.new
        return @stage = nil
      end
    end
  end

  def dispose
    @result_window.dispose
    @help_window.dispose
  end
end


Terms & Conditions

Free for any kind of game running on the HiddenChest engine. [Image: wink.gif] 
Due credit is mandatory.
Don't post the contents of this topic anywhere else!
You better paste a link to this thread and make them come here instead.
That's it! [Image: tongue.gif]