help with skip cutscene feature

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
Anastimafilia
Regular
Posts: 26
Joined: Mon May 30, 2022 3:43 pm
itch: anastimafilia
Discord: Anastimafilia#1400
Contact:

help with skip cutscene feature

#1 Post by Anastimafilia »

Hello fellas! I need help making a skip function for this video, maybe when the player clicks on the video a pop up windows shows up asking them if they want to skip it? or maybe there's a 'skip cutscene' text button in the top right corner of the screen? whatever is easier IMO
I'm posting the code with the call screen text empty for the sake of this board's decency

Code: Select all

image movie3 = Movie(play="images/petrawg.webm") 

screen mytextscreen(what, t):
    modal True
    text what xalign 0.5 yalign 0.9 style "textstyle"
    timer t action Return()

style textstyle:
    outlines [(4, "#000000")] ## Make sure to have the [] or else you get an error.

label movie3:

    show movie3:
        pos (0, 0)
        size (2560, 1440)

    call screen mytextscreen("", 3.0)
    call screen mytextscreen("", 3.0)
    call screen mytextscreen("", 3.0)
    call screen mytextscreen("", 3.0)
    call screen mytextscreen("", 3.0)
    call screen mytextscreen("", 3.0)
    call screen mytextscreen("", 3.0)
    call screen mytextscreen("", 3.0)
    call screen mytextscreen("", 3.0)
    call screen mytextscreen("", 3.0)

    hide movie3

User avatar
m_from_space
Eileen-Class Veteran
Posts: 1060
Joined: Sun Feb 21, 2021 3:36 am
Contact:

Re: help with skip cutscene feature

#2 Post by m_from_space »

Anastimafilia wrote: Sun May 26, 2024 12:21 pm Hello fellas! I need help making a skip function for this video, maybe when the player clicks on the video a pop up windows shows up asking them if they want to skip it? or maybe there's a 'skip cutscene' text button in the top right corner of the screen? whatever is easier IMO
So, I'm just using your code assuming you want to show those text elements while the movie plays.

Code: Select all

image movie3 = Movie(play="images/petrawg.webm") 

screen mytextscreen(what, t):
    modal True
    # when the player clicks anywhere, just ask them if they want to skip
    dismiss action Confirm("Do you really wanna skip?", Jump("movie3.end"))
    text what xalign 0.5 yalign 0.9 style "textstyle"
    timer t action Return()

style textstyle:
    outlines [(4, "#000000")] ## Make sure to have the [] or else you get an error.

label movie3:

    show movie3:
        pos (0, 0)
        size (2560, 1440)

    call screen mytextscreen("", 3.0)
    call screen mytextscreen("", 3.0)
    call screen mytextscreen("", 3.0)
    call screen mytextscreen("", 3.0)
    call screen mytextscreen("", 3.0)
    call screen mytextscreen("", 3.0)
    call screen mytextscreen("", 3.0)
    call screen mytextscreen("", 3.0)
    call screen mytextscreen("", 3.0)
    call screen mytextscreen("", 3.0)

    label .end:

    hide movie3
    
    return
P.S. You better not use the same name for both the movie and the label, this might confuse you and also is bad practice, since it can lead to strange behavior in certain circumstances.

User avatar
Anastimafilia
Regular
Posts: 26
Joined: Mon May 30, 2022 3:43 pm
itch: anastimafilia
Discord: Anastimafilia#1400
Contact:

Re: help with skip cutscene feature

#3 Post by Anastimafilia »

thanks a lot for the help, the skip function does works but for some reason it got applied to all other movies which is fine but the game ends whenever any of the movies is skipped

User avatar
Anastimafilia
Regular
Posts: 26
Joined: Mon May 30, 2022 3:43 pm
itch: anastimafilia
Discord: Anastimafilia#1400
Contact:

Re: help with skip cutscene feature

#4 Post by Anastimafilia »

update: I made it work by giving each screen a different name, it now works flawlessly, thanks a lot for the help, a mod can close this thread now

Post Reply

Who is online

Users browsing this forum: No registered users