[SOLVED] I need that the player can't skip the movie
Posted: Thu Jul 28, 2022 12:11 am
I need that the player cannot skip the movie and that the text box does not appear when the movie is played
Supporting creators of visual novels and story-based games since 2003.
https://lemmasoft.renai.us/forums/
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
Not directly, but with the addition of some other lines of code, its perfectly possible, if not the best approach.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!
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.Imperf3kt wrote: ↑Thu Jul 28, 2022 6:51 amNot directly, but with the addition of some other lines of code, its perfectly possible, if not the best approach.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!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
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 badm_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
Don't use renpy.movie_cutscene, since you cannot forbid skipping using this function!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
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)Imperf3kt wrote: ↑Thu Jul 28, 2022 6:51 amNot directly, but with the addition of some other lines of code, its perfectly possible, if not the best approach.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!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
Code: Select all
$renpy.movie_cutscene("myfile.avi")
$renpy.pause(2, hard=True)
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)
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
Don't use renpy.movie_cutscene, since you cannot forbid skipping using this function!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
it didn't work eitherlaure44 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
Don't use renpy.movie_cutscene, since you cannot forbid skipping using this function!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
I posted an example. Of course you have to adjust the length of the movie for the timer or adjust positioning of the video.David Santos wrote: ↑Thu Jul 28, 2022 4:54 pmI'm having problems with the resolution, it doesn't stay at 1280 x 720
Code: Select all
image mymovie = Movie(play="file.mp4", size=(1280,720))