Page 1 of 1

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

Posted: Thu Jul 28, 2022 12:11 am
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

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

Posted: Thu Jul 28, 2022 2:06 am
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!

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

Posted: Thu Jul 28, 2022 5:09 am
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.

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

Posted: Thu Jul 28, 2022 6:51 am
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

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

Posted: Thu Jul 28, 2022 9:50 am
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

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

Posted: Thu Jul 28, 2022 9:55 am
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.

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

Posted: Thu Jul 28, 2022 9:58 am
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

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

Posted: Thu Jul 28, 2022 10:28 am
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)

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

Posted: Thu Jul 28, 2022 11:13 am
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)

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

Posted: Thu Jul 28, 2022 12:31 pm
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

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

Posted: Thu Jul 28, 2022 1:05 pm
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!

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

Posted: Thu Jul 28, 2022 4:07 pm
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 :(

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

Posted: Thu Jul 28, 2022 4:18 pm
by laure44
What didn't work, exactly? Did you get an error? Or an unwanted result maybe?

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

Posted: Thu Jul 28, 2022 4:54 pm
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

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

Posted: Fri Jul 29, 2022 2:50 am
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))