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.

Quick Time Event

I'm wondering if anyone knows how to make a quick time event script? I am trying to implement that into my game and all help is greatly apreciated.
I'm to go for a small window that pops up with one of the buttons telling you to press it down of you will get a game over/ lose alot of health.


EDIT: Also, The reason why i want a script is for easy convience and because I want the button you press to be random out of a possible 4-5 buttons(arrow keys and c preferebly)
 
There is a German Script for Quicktime Events (Some times the Germans do good work hehe :smile: )
Just download tisbuttons an put them into the Picture bin of your Project.
Click the Link!
Then put this above Main´:
Code:
#=================================================#

#       Nekos famoses Quick Time Event Script

#       >>>>>>>>> Version : zwischen 0 und 1

#---------------------------------------------------------------#

#       (Es ist an Sinnlosigkeit und Simpelheit

#       kaum zu überbieten, deshalbt wird bei

#       Benutzung um keine Danksagung gebeten.

#=================================================#

 

class Scene_Geschick < Window_Base

  def initialize(index, zeit)

 

# Dateinamen der Tasten; (Grafiken sollten 48x48 Pixel messen)

        @Taste_UP = "TasteOben.png"

        @Taste_DOWN = "TasteUnten.png"

        @Taste_LEFT = "TasteLinks.png"

        @Taste_RIGHT = "TasteRechts.png"

        @Taste_OK = "TasteOK.png"

        @Taste_ESC = "TasteEsc.png"

        @Richtige_Eingabe = "TasteDone.png"

        @Rich_Eing_Opacity = 255

# Dateinamen und Blending der Balken;...=["Name", (0=Norm, 1=Add, 2=Sub)]

# (Grafiken sollten 600x30 Pixel messen)

        @Balken_Overlay = ["Geschick-ZeitFüllung.png", 0]

        @Balken_BG = ["Geschick-Zeit.png", 0]

#---------------------------------------------------------------#

 

    super(0, 310, 640, 80)

    self.contents = Bitmap.new(width - 32, height - 32)

    self.opacity = 0

    self.z = 9998

    @Maximale_Tasten = index

    @Zeit = zeit

    @Zeit_Intervall = 1.00000 / @Zeit / 3

  end

  def main

    @spriteset = Spriteset_Map.new

    $geschick = false

    $tasten_need = []

    @inx = 0

    @show_x = 20

    while @inx < @Maximale_Tasten

    $tasten_need[@inx] = rand(6)

    bitmap = RPG::Cache.picture(@Taste_UP) if $tasten_need[@inx] == 0

    bitmap = RPG::Cache.picture(@Taste_DOWN) if $tasten_need[@inx] == 1

    bitmap = RPG::Cache.picture(@Taste_LEFT) if $tasten_need[@inx] == 2

    bitmap = RPG::Cache.picture(@Taste_RIGHT) if $tasten_need[@inx] == 3

    bitmap = RPG::Cache.picture(@Taste_OK) if $tasten_need[@inx] == 4

    bitmap = RPG::Cache.picture(@Taste_ESC) if $tasten_need[@inx] == 5

    self.contents.blt(@show_x, 0, bitmap, Rect.new(0, 0, 48, 48))

    @inx += 1

    @show_x  += 48

    end

    @inx = 0

    @show_x = 20

    @addition_1 = Sprite.new

    @addition_1.bitmap = RPG::Cache.picture(@Balken_BG[0])

    @addition_1.blend_type = @Balken_BG[1]

    @addition_1.x = 20

    @addition_1.y = y + 10

    @addition_1.z = 9997

    @addition_2 = Sprite.new

    @addition_2.bitmap = RPG::Cache.picture(@Balken_Overlay[0])

    @addition_2.blend_type = @Balken_Overlay[1]

    @addition_2.x = 20

    @addition_2.y = y + 10

    @addition_2.z = 9998

Graphics.transition

    loop do

    Graphics.update

    Input.update

    update

    if $scene != self

        break

    end

    end

    Graphics.freeze

    @addition_1.dispose

    @addition_2.dispose

    @spriteset.dispose

    self.contents.dispose

    self.dispose

  end

  def update

    if Input.trigger?(Input::C)

    if $tasten_need[@inx] == 4

        $game_system.se_play($data_system.cursor_se)

        bitmap = RPG::Cache.picture(@Richtige_Eingabe)

        self.contents.blt(@show_x, 0, bitmap, Rect.new(0, 0, 48, 48), @Rich_Eing_Opacity)

        @inx += 1

        @show_x += 48

    else

        $game_system.se_play($data_system.buzzer_se)

            $geschick = false

            $scene = Scene_Map.new

    end

    elsif Input.trigger?(Input::B)

        if $tasten_need[@inx] == 5

        $game_system.se_play($data_system.cursor_se)

        bitmap = RPG::Cache.picture(@Richtige_Eingabe)

        self.contents.blt(@show_x, 0, bitmap, Rect.new(0, 0, 48, 48), @Rich_Eing_Opacity)

        @inx += 1

        @show_x += 48

    else

        $game_system.se_play($data_system.buzzer_se)

            $geschick = false

            $scene = Scene_Map.new

        end

        elsif Input.trigger?(Input::UP)

        if $tasten_need[@inx] == 0

        $game_system.se_play($data_system.cursor_se)

        bitmap = RPG::Cache.picture(@Richtige_Eingabe)

        self.contents.blt(@show_x, 0, bitmap, Rect.new(0, 0, 48, 48), @Rich_Eing_Opacity)

        @inx += 1

        @show_x += 48

    else

        $game_system.se_play($data_system.buzzer_se)

            $geschick = false

            $scene = Scene_Map.new

        end

        elsif Input.trigger?(Input::DOWN)

        if $tasten_need[@inx] == 1

        $game_system.se_play($data_system.cursor_se)

        bitmap = RPG::Cache.picture(@Richtige_Eingabe)

        self.contents.blt(@show_x, 0, bitmap, Rect.new(0, 0, 48, 48), @Rich_Eing_Opacity)

        @inx += 1

        @show_x += 48

    else

        $game_system.se_play($data_system.buzzer_se)

            $geschick = false

            $scene = Scene_Map.new

        end

        elsif Input.trigger?(Input::LEFT)

        if $tasten_need[@inx] == 2

        $game_system.se_play($data_system.cursor_se)

        bitmap = RPG::Cache.picture(@Richtige_Eingabe)

        self.contents.blt(@show_x, 0, bitmap, Rect.new(0, 0, 48, 48), @Rich_Eing_Opacity)

        @inx += 1

        @show_x += 48

    else

        $game_system.se_play($data_system.buzzer_se)

            $geschick = false

            $scene = Scene_Map.new

        end

        elsif Input.trigger?(Input::RIGHT)

        if $tasten_need[@inx] == 3

        $game_system.se_play($data_system.cursor_se)

        bitmap = RPG::Cache.picture(@Richtige_Eingabe)

        self.contents.blt(@show_x, 0, bitmap, Rect.new(0, 0, 48, 48), @Rich_Eing_Opacity)

        @inx += 1

        @show_x += 48

    else

        $game_system.se_play($data_system.buzzer_se)

            $geschick = false

            $scene = Scene_Map.new

        end

    end

    if @inx >= @Maximale_Tasten

        $game_system.se_play($data_system.decision_se)

        $geschick = true

        $scene = Scene_Map.new

        return

    end

    @addition_1.update

    @spriteset.update

    @addition_2.zoom_x -= @Zeit_Intervall

    @addition_2.update

    if @addition_2.zoom_x <= 0

    $game_system.se_play($data_system.buzzer_se)

    $geschick = false

    $scene = Scene_Map.new

    end

    end

end

To call the script you have to create a Scriptcommand in the wished Event
Use folloin Code in the Script command:
Code:
$scene = Scene_Geschick.new(X, Time)

@wait_count = 1
Put number of Bottoms you want.
Time is in Frames.

Last thing put a Codition Branch below the Script Command
Select Script (Codition Branch Page 4) and add this line:
Code:
$geschick == true

Thats all. Have fun!
 

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