QTE mode

In this forum we discuss the future of Ren'Py, both bug fixes and longer-term development. Pre-releases are announced and discussed here.
Post Reply
Message
Author
Vorses_910
Newbie
Posts: 1
Joined: Sat May 11, 2024 6:28 am
Contact:

QTE mode

#1 Post by Vorses_910 »

Hello everyone, I'm new to creating mods for the game "Everlasting Summer". In this article, I'm asking for help, I don't understand how to create code in a script that calls the next button after pressing the previous one. I want to make sure that after pressing the button, another button is called and so on 5 times. After that, the QTE mode ends. In case of a QTE loss, the player is teleported to the Lable with a loss. Please help me set up the script

[youtube]https://youtu.be/MDg8yCwLJCk[/youtube]

Code: Select all

init 5:
    $ mi_game = 1
    $ mi_next = renpy.random.choice(["mi_qte1", "mi_qte2", "mi_qte3", "mi_qte4"])
    $ button_qte = "mods/hatsune_miku/qte/"

init -999 python:
    button_qte = "mods/hatsune_miku/qte/"
    complete_qte = button_qte + "qte_win"
    lose_qte = button_qte + "qte_loss.mp3"

init -1:
    transform mi_qte_button(x, y):
        parallel:
            alpha 0.
            easein_quad 0.5 alpha 1.
        parallel:
            ease .5 rotate -5 zoom 1.
            ease .5 rotate 5 zoom 1.05
            block:
                ease .35 rotate -5 zoom 1.
                ease .35 rotate 5 zoom 1.05
                block:
                    ease .225 rotate -5 zoom 1.
                    ease .225 rotate 5 zoom 1.05
                    block:
                        ease .135 rotate -5 zoom 1.
                        ease .135 rotate 5 zoom 1.05
                        block:
                            ease .065 rotate -5 zoom 1.
                            ease .065 rotate 5 zoom 1.05
                            repeat

    transform mi_qte_button2(x1, x2, x3, x4, x5):
        anchor(0.5, 0.5) xalign x1 yalign x2
        easein_quad 1.0 alpha 0. xalign x3 yalign x4 rotate x5

    transform mi_qte_button3(x1, x2):
        alpha 1. xalign x1 yalign x2
        easein_quad .5 alpha 0. zoom .5

screen qte_mi:
    if mi_next == "mi_qte1":
        add button_qte + "a.png" at mi_qte_button(.2, .2)
        key "K_a" action [Hide("qte_mi"), Show("qte_mi_end", mi_game = 1), Jump("ura_pobeda")]
        timer 1 action [Hide("qte_mi"), Show("qte_mi_end", mi_game = 1), Jump("qte_mi_end_label2")]

    elif mi_next == "mi_qte2":
        add button_qte + "d.png" at mi_qte_button(.8, .8)
        key "K_d" action [Hide("qte_mi"), Show("qte_mi_end", mi_game = 1), jump("ura_pobeda")]
        timer 1 action [Hide("qte_mi"), Show("qte_mi_end", mi_game = 1), Jump("qte_mi_end_label2")]

    elif mi_next == "mi_qte3":
        add button_qte + "s.png" at mi_qte_button(.2, .8)
        key "K_s" action [Hide("qte_mi"), Show("qte_mi_end", mi_game = 1), Jump("ura_pobeda")]
        timer 1 action [Hide("qte_mi"), Show("qte_mi_end", mi_game = 1), Jump("qte_mi_end_label2")]

    elif mi_next == "mi_qte4":
        add button_qte + "w.png" at mi_qte_button(.5, .5)
        key "K_w" action [Hide("qte_mi"), Show("qte_mi_end", mi_game = 1), Jump("ura_pobeda")]
        timer 1 action [Hide("qte_mi"), Show("qte_mi_end", mi_game = 1), Jump("qte_mi_end_label2")]

screen qte_mi_end:
    if mi_next == "mi_qte1":
        if mi_game == 0:
            add button_qte + "a_procces.png" at mi_qte_button3(0.2, 0.2)
            timer 0.5 action [Play("sound", qte_win), Hide("qte_mi_end")]

        else:
            add button_qte + "a_lost1.png" at mi_qte_button2(0.2, 0.2, 0.15, 0.4, -10)
            add button_qte + "a_lost2.png" at mi_qte_button2(0.2, 0.2, 0.25, 0.4, 10)
            timer 1 action [Play("sound", lose_qte), Hide("qte_mi_end")]

    elif mi_next == "mi_qte2":
        if mi_game == 0:
            add button_qte + "d_process.png" at mi_qte_button3(.8, .8)
            timer 0.5 action [Play("sound", qte_win), Hide("qte_mi_end")]

        else:
            add button_qte + "d_lost1.png" at mi_qte_button2(0.8, 0.8, 0.75, 1.0, -10)
            add button_qte + "d_lost2.png" at mi_qte_button2(0.8, 0.8, 0.85, 1.0, 10)
            timer 1 action [Play("sound", lose_qte), Hide("qte_mi_end")]

    elif mi_next == "mi_qte3":
        if mi_game == 0:
            add button_qte + "s_process.png" at mi_qte_button3(0.2, 0.8)
            timer 0.5 action [Play("sound", qte_win), Hide("qte_mi_end")]

        else:
            add button_qte + "s_lost1.png" at mi_qte_button2(0.2, 0.8, 0.15, 1.0, -10)
            add button_qte + "s_lost2.png" at mi_qte_button2(0.2, 0.8, 0.25, 1.0, 10)
            timer 1 action [Play("sound", lose_qte), Hide("qte_mi_end")]

    elif mi_next == "mi_qte4":
        if mi_game == 0:
            add button_qte + "w_process.png" at mi_qte_button3(0.5, 0.5)
            timer 0.5 action [Play("sound", qte_win), Hide("qte_mi_end")]

        else:
            add button_qte + "w_lost1.png" at mi_qte_button2(0.5, 0.5, 0.45, 0.7, -10)
            add button_qte + "w_lost2.png" at mi_qte_button2(0.5, 0.5, 0.55, 0.7, 10)
            timer 1 action [Play("sound", lose_qte), Hide("qte_mi_end")]

label mi_qte_event:
    call screen qte_mi(ura_pobeda, qte_mi_end_label2)

label qte_mi_end_label2:
    return

label ura_pobeda:
    return
Attachments
day_4.rpy
QTE Script
(1.35 KiB) Downloaded 8 times
qte_scripts (1).rpy
Lable 4
(4.5 KiB) Downloaded 5 times

Post Reply

Who is online

Users browsing this forum: No registered users