One video after another in main menu

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
Adrian_DVL
Regular
Posts: 141
Joined: Fri Mar 15, 2019 8:46 am
Completed: Clockwork Poison
Projects: Melodic Dates, Clockwork Poison: Salvation
Contact:

One video after another in main menu

#1 Post by Adrian_DVL »

Hi all!

So, I have a game where I play a video in the main menu, instead of a still image. I defined it like this, in screens.rpy:

Code: Select all

image main_menu = Movie(channel="main_menu", play="gui/intro.webm", loop=True)
And I added it inside the screen main_menu, so the outcome is a video that plays in a loop while you're in the main menu.

Now I have another game, and I'd like to stick to this video thing, except for one thing: I want to play a video that, in its first two seconds, "introduces" the title of the game and some elements and then keeps playing over and over again. So, obviously, I can't just go with a single loop video, because, as soon as it finishes, it would introduce the title and those other elements again. That's why I'd like to play a video once and then play a loop video once the first one finishes.

Is that even possible? Can I just play a video and queue another loop video when the first one finishes in the main menu somehow? The most similar thing that comes to my mind is queueing sound or music inside a game label, but I don't know how to do it with a video in the main menu.
Last edited by Adrian_DVL on Wed Apr 15, 2020 10:14 am, edited 2 times in total.

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

Re: One video after another in main menu

#2 Post by Imperf3kt »

Use the special label before_main_menu to play your short video.
https://www.renpy.org/doc/html/label.ht ... ial-labels
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

Adrian_DVL
Regular
Posts: 141
Joined: Fri Mar 15, 2019 8:46 am
Completed: Clockwork Poison
Projects: Melodic Dates, Clockwork Poison: Salvation
Contact:

Re: One video after another in main menu

#3 Post by Adrian_DVL »

Imperf3kt wrote: Tue Apr 14, 2020 5:51 pm Use the special label before_main_menu to play your short video.
https://www.renpy.org/doc/html/label.ht ... ial-labels
Will you marry me? Hahaha! Seriously, thank you very much! The thing is that I did know about this but it didn't come to mind, it seems.
I can't test it right now, but I suppose I can show the buttons at the main menu with a transform, so they don't appear so sharply. Anyway, thank you!

Adrian_DVL
Regular
Posts: 141
Joined: Fri Mar 15, 2019 8:46 am
Completed: Clockwork Poison
Projects: Melodic Dates, Clockwork Poison: Salvation
Contact:

Re: One video after another in main menu

#4 Post by Adrian_DVL »

Well, I tried the before_main_menu label and it indeed works. The problem is that between the intro of the video (i.e. the before_main_menu) and the video itself and the menu buttons (i.e. the screen main_menu) there's one or two frames in which the screen goes black and with no music. I tried fixing that in a few ways, like defining the videos as Movies inside screens, playing the intro as a renpy cutscene, jumping to a label main_menu from the before_main_menu instead of making a return and stuff like that, but the damn black frames are still there. How can I fix it?

User avatar
hell_oh_world
Miko-Class Veteran
Posts: 777
Joined: Fri Jul 12, 2019 5:21 am
Contact:

Re: One video after another in main menu

#5 Post by hell_oh_world »

Adrian_DVL wrote: Wed Apr 15, 2020 10:18 am Well, I tried the before_main_menu label and it indeed works. The problem is that between the intro of the video (i.e. the before_main_menu) and the video itself and the menu buttons (i.e. the screen main_menu) there's one or two frames in which the screen goes black and with no music. I tried fixing that in a few ways, like defining the videos as Movies inside screens, playing the intro as a renpy cutscene, jumping to a label main_menu from the before_main_menu instead of making a return and stuff like that, but the damn black frames are still there. How can I fix it?
There's an image parameter for Movie(), you could specify that as an image which is the last frame of the movie, so that it won't turn black after it's playback
https://www.renpy.org/doc/html/movie.html#Movie

Code: Select all

image my_movie = Movie(play="movie.webm", image="the_last_frame_of_the_movie.png")

Adrian_DVL
Regular
Posts: 141
Joined: Fri Mar 15, 2019 8:46 am
Completed: Clockwork Poison
Projects: Melodic Dates, Clockwork Poison: Salvation
Contact:

Re: One video after another in main menu

#6 Post by Adrian_DVL »

hell_oh_world wrote: Wed Apr 15, 2020 10:41 am
Adrian_DVL wrote: Wed Apr 15, 2020 10:18 am Well, I tried the before_main_menu label and it indeed works. The problem is that between the intro of the video (i.e. the before_main_menu) and the video itself and the menu buttons (i.e. the screen main_menu) there's one or two frames in which the screen goes black and with no music. I tried fixing that in a few ways, like defining the videos as Movies inside screens, playing the intro as a renpy cutscene, jumping to a label main_menu from the before_main_menu instead of making a return and stuff like that, but the damn black frames are still there. How can I fix it?
There's an image parameter for Movie(), you could specify that as an image which is the last frame of the movie, so that it won't turn black after it's playback
https://www.renpy.org/doc/html/movie.html#Movie

Code: Select all

image my_movie = Movie(play="movie.webm", image="the_last_frame_of_the_movie.png")
That didn't work and I believe the reason is that those black and silent frames belong to the screen main_menu and not to the label before_main_menu. I tried passing the image to the movie in the main_menu screen as well as in the other one, but those frames still won't go away...

Post Reply

Who is online

Users browsing this forum: Google [Bot]