[SOLVED] I need that the player can't skip the movie

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
David Santos
Newbie
Posts: 11
Joined: Thu Jul 28, 2022 12:03 am
Contact:

[SOLVED] I need that the player can't skip the movie

#1 Post by David Santos »

I need that the player cannot skip the movie and that the text box does not appear when the movie is played
Last edited by David Santos on Fri Jul 29, 2022 4:32 pm, edited 2 times in total.

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

Re: I need that the player can't skip the movie

#2 Post by m_from_space »

For this to happen you have to create a movie Displayable and just show it to the player (via a screen might be the best solution). https://www.renpy.org/doc/html/movie.html

Code: Select all

image mymovie = Movie(play="file.webm")

screen mymoviescreen:
    add "mymovie"
    # return from screen after 10 seconds (length of movie scene)
    timer 10.0 action Return()

label start:
    # call the screen and wait for its return
    call screen mymoviescreen
Don't use renpy.movie_cutscene, since you cannot forbid skipping using this function!

User avatar
Tayruu
Regular
Posts: 141
Joined: Sat Jul 05, 2014 7:57 pm

Re: I need that the player can't skip the movie

#3 Post by Tayruu »

Oh this seems a useful technique. I want to be able to do something similar, at least have a "hold to skip" prompt instead of immediately skip. Mostly for cases where text is displayed and players might accidentally skip the whole thing thinking clicking will just advance.
That said, this probably would interrupt skip mode.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3807
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: I need that the player can't skip the movie

#4 Post by Imperf3kt »

m_from_space wrote: Thu Jul 28, 2022 2:06 am Don't use renpy.movie_cutscene, since you cannot forbid skipping using this function!
Not directly, but with the addition of some other lines of code, its perfectly possible, if not the best approach.

Code: Select all

label start:
    window hide
    $renpy.pause(2, hard=True) #adjust the number to match however long the video is, in seconds.
    $renpy.movie_cutscene("myfile.avi") #rename "myfile.avi" to your movie's filename
    window auto
    "Wow, that was a cool video!"
    return
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

David Santos
Newbie
Posts: 11
Joined: Thu Jul 28, 2022 12:03 am
Contact:

Re: I need that the player can't skip the movie

#5 Post by David Santos »

Could you write the code for me so I can just copy it? the video file is "yustudio" 3 seconds long. sorry, i'm brazilian and my english is bad

David Santos
Newbie
Posts: 11
Joined: Thu Jul 28, 2022 12:03 am
Contact:

Re: I need that the player can't skip the movie

#6 Post by David Santos »

Imperf3kt wrote: Thu Jul 28, 2022 6:51 am
m_from_space wrote: Thu Jul 28, 2022 2:06 am Don't use renpy.movie_cutscene, since you cannot forbid skipping using this function!
Not directly, but with the addition of some other lines of code, its perfectly possible, if not the best approach.

Code: Select all

label start:
    window hide
    $renpy.pause(2, hard=True) #adjust the number to match however long the video is, in seconds.
    $renpy.movie_cutscene("myfile.avi") #rename "myfile.avi" to your movie's filename
    window auto
    "Wow, that was a cool video!"
    return
the movie is being skipped normally.

David Santos
Newbie
Posts: 11
Joined: Thu Jul 28, 2022 12:03 am
Contact:

Re: I need that the player can't skip the movie

#7 Post by David Santos »

m_from_space wrote: Thu Jul 28, 2022 2:06 am For this to happen you have to create a movie Displayable and just show it to the player (via a screen might be the best solution). https://www.renpy.org/doc/html/movie.html

Code: Select all

image mymovie = Movie(play="file.webm")

screen mymoviescreen:
    add "mymovie"
    # return from screen after 10 seconds (length of movie scene)
    timer 10.0 action Return()

label start:
    # call the screen and wait for its return
    call screen mymoviescreen
Don't use renpy.movie_cutscene, since you cannot forbid skipping using this function!
Could you write the code for me so I can just copy it? the video file is "yustudio" 3 seconds long. sorry, i'm brazilian and my english is bad

David Santos
Newbie
Posts: 11
Joined: Thu Jul 28, 2022 12:03 am
Contact:

Re: I need that the player can't skip the movie

#8 Post by David Santos »

Imperf3kt wrote: Thu Jul 28, 2022 6:51 am
m_from_space wrote: Thu Jul 28, 2022 2:06 am Don't use renpy.movie_cutscene, since you cannot forbid skipping using this function!
Not directly, but with the addition of some other lines of code, its perfectly possible, if not the best approach.

Code: Select all

label start:
    window hide
    $renpy.pause(2, hard=True) #adjust the number to match however long the video is, in seconds.
    $renpy.movie_cutscene("myfile.avi") #rename "myfile.avi" to your movie's filename
    window auto
    "Wow, that was a cool video!"
    return
this code makes the text box close, pause for 2 seconds without being able to skip and only then displays the movie (still being able to skip)

laure44
Regular
Posts: 84
Joined: Mon Mar 08, 2021 10:55 pm
Projects: Arkan'sTower, Gemshine Lorelei!
Location: France
Contact:

Re: I need that the player can't skip the movie

#9 Post by laure44 »

Try using renpy.pause after renpy.movie_cutscene, like so

Code: Select all

    $renpy.movie_cutscene("myfile.avi")
    $renpy.pause(2, hard=True)

David Santos
Newbie
Posts: 11
Joined: Thu Jul 28, 2022 12:03 am
Contact:

Re: I need that the player can't skip the movie

#10 Post by David Santos »

laure44 wrote: Thu Jul 28, 2022 11:13 am Try using renpy.pause after renpy.movie_cutscene, like so

Code: Select all

    $renpy.movie_cutscene("myfile.avi")
    $renpy.pause(2, hard=True)

I tried, this method doesn't work

laure44
Regular
Posts: 84
Joined: Mon Mar 08, 2021 10:55 pm
Projects: Arkan'sTower, Gemshine Lorelei!
Location: France
Contact:

Re: I need that the player can't skip the movie

#11 Post by laure44 »

Since you did not mention trying, have you tried this solution from m_from_space? This looks like a very good way to do what you're trying to achieve.
m_from_space wrote: Thu Jul 28, 2022 2:06 am For this to happen you have to create a movie Displayable and just show it to the player (via a screen might be the best solution). https://www.renpy.org/doc/html/movie.html

Code: Select all

image mymovie = Movie(play="file.webm")

screen mymoviescreen:
    add "mymovie"
    # return from screen after 10 seconds (length of movie scene)
    timer 10.0 action Return()

label start:
    # call the screen and wait for its return
    call screen mymoviescreen
Don't use renpy.movie_cutscene, since you cannot forbid skipping using this function!

David Santos
Newbie
Posts: 11
Joined: Thu Jul 28, 2022 12:03 am
Contact:

Re: I need that the player can't skip the movie

#12 Post by David Santos »

laure44 wrote: Thu Jul 28, 2022 1:05 pm Since you did not mention trying, have you tried this solution from m_from_space? This looks like a very good way to do what you're trying to achieve.
m_from_space wrote: Thu Jul 28, 2022 2:06 am For this to happen you have to create a movie Displayable and just show it to the player (via a screen might be the best solution). https://www.renpy.org/doc/html/movie.html

Code: Select all

image mymovie = Movie(play="file.webm")

screen mymoviescreen:
    add "mymovie"
    # return from screen after 10 seconds (length of movie scene)
    timer 10.0 action Return()

label start:
    # call the screen and wait for its return
    call screen mymoviescreen
Don't use renpy.movie_cutscene, since you cannot forbid skipping using this function!
it didn't work either :(

laure44
Regular
Posts: 84
Joined: Mon Mar 08, 2021 10:55 pm
Projects: Arkan'sTower, Gemshine Lorelei!
Location: France
Contact:

Re: I need that the player can't skip the movie

#13 Post by laure44 »

What didn't work, exactly? Did you get an error? Or an unwanted result maybe?

David Santos
Newbie
Posts: 11
Joined: Thu Jul 28, 2022 12:03 am
Contact:

Re: I need that the player can't skip the movie

#14 Post by David Santos »

laure44 wrote: Thu Jul 28, 2022 4:18 pm What didn't work, exactly? Did you get an error? Or an unwanted result maybe?
I'm having problems with the resolution, it doesn't stay at 1280 x 720

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

Re: I need that the player can't skip the movie

#15 Post by m_from_space »

David Santos wrote: Thu Jul 28, 2022 4:54 pm
laure44 wrote: Thu Jul 28, 2022 4:18 pm What didn't work, exactly? Did you get an error? Or an unwanted result maybe?
I'm having problems with the resolution, it doesn't stay at 1280 x 720
I posted an example. Of course you have to adjust the length of the movie for the timer or adjust positioning of the video.

So I assume your game resolution is 1280 x 720? Is your original video 1280 x 720?

Create the movie using the following lines. And start using the manual! https://www.renpy.org/doc/html/movie.html#Movie

Code: Select all

image mymovie = Movie(play="file.mp4", size=(1280,720))

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]