[SOLVED] I need that the player can't skip the movie
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.
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.
-
- Newbie
- Posts: 11
- Joined: Thu Jul 28, 2022 12:03 am
- Contact:
[SOLVED] I need that the player can't skip the movie
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.
- m_from_space
- Eileen-Class Veteran
- Posts: 1030
- Joined: Sun Feb 21, 2021 3:36 am
- Contact:
Re: I need that the player can't skip the movie
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
Re: I need that the player can't skip the movie
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.
That said, this probably would interrupt skip mode.
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3808
- 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
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
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
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
-
- Newbie
- Posts: 11
- Joined: Thu Jul 28, 2022 12:03 am
- Contact:
Re: I need that the player can't skip the movie
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
-
- Newbie
- Posts: 11
- Joined: Thu Jul 28, 2022 12:03 am
- Contact:
Re: I need that the player can't skip the movie
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
-
- Newbie
- Posts: 11
- Joined: Thu Jul 28, 2022 12:03 am
- Contact:
Re: I need that the player can't skip the movie
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
-
- Newbie
- Posts: 11
- Joined: Thu Jul 28, 2022 12:03 am
- Contact:
Re: I need that the player can't skip the movie
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
-
- 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
Try using renpy.pause after renpy.movie_cutscene, like so
Code: Select all
$renpy.movie_cutscene("myfile.avi")
$renpy.pause(2, hard=True)
-
- Newbie
- Posts: 11
- Joined: Thu Jul 28, 2022 12:03 am
- Contact:
Re: I need that the player can't skip the movie
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
-
- 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
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
-
- Newbie
- Posts: 11
- Joined: Thu Jul 28, 2022 12:03 am
- Contact:
Re: I need that the player can't skip the movie
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
-
- 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
What didn't work, exactly? Did you get an error? Or an unwanted result maybe?
-
- Newbie
- Posts: 11
- Joined: Thu Jul 28, 2022 12:03 am
- Contact:
- m_from_space
- Eileen-Class Veteran
- Posts: 1030
- Joined: Sun Feb 21, 2021 3:36 am
- Contact:
Re: I need that the player can't skip the movie
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
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))
Who is online
Users browsing this forum: Amazon [Bot], Bing [Bot], Google [Bot]