Page 1 of 2

Main menu, movie into still image HELP

Posted: Sun Jan 12, 2020 2:46 pm
by GlazeWasTaken
Hey all, first post, I have a question for the visual novel I am attempting to make. I'm not great with coding and haven't had a whole lot of experience, but I am trying to make my main menu have a short movie that plays, and then when the movie ends the background and the text buttons appear and then it stays on that forever.
https://www.youtube.com/watch?v=t5iXKkB ... e=youtu.be Here is an example of what I am talking about, using sketches.

Any help would be appreciated!

Re: Main menu, movie into still image HELP

Posted: Sun Jan 12, 2020 10:52 pm
by gas
Have the movie play in the splashscreen label.
https://www.renpy.org/dev-doc/html/labe ... ial-labels
As for the main menu background... simply use that last frame picture as the main menu picture (I dunno, maybe a screenshot?). That way a player can reach the main menu without watching that movie again (anyway, by your sketch, that backgorund doesn't actually seem an active part of the movie).

Re: Main menu, movie into still image HELP

Posted: Sun Jan 12, 2020 11:09 pm
by Imperf3kt
You would not use the splashscreen for that but the before_main_menu label
https://www.renpy.org/doc/html/label.ht ... ial-labels
If it exists, this label is called before the main menu. It is used in rare cases to set up the main menu, for example by starting a movie playing in the background.
I mention this because the splashscreen is only shown on game load, whereas the before main menu label will play through even if a player quits to the main menu mid game.

Re: Main menu, movie into still image HELP

Posted: Mon Jan 13, 2020 12:13 am
by gas
Imperf3kt wrote:
Sun Jan 12, 2020 11:09 pm
You would not use the splashscreen for that but the before_main_menu label
https://www.renpy.org/doc/html/label.ht ... ial-labels
If it exists, this label is called before the main menu. It is used in rare cases to set up the main menu, for example by starting a movie playing in the background.
I mention this because the splashscreen is only shown on game load, whereas the before main menu label will play through even if a player quits to the main menu mid game.
Movie playing as a background of the main menu, that's what before_main_menu does. His movie play before it.

Re: Main menu, movie into still image HELP

Posted: Mon Jan 13, 2020 3:05 am
by GlazeWasTaken
gas wrote:
Mon Jan 13, 2020 12:13 am
Imperf3kt wrote:
Sun Jan 12, 2020 11:09 pm
You would not use the splashscreen for that but the before_main_menu label
https://www.renpy.org/doc/html/label.ht ... ial-labels
If it exists, this label is called before the main menu. It is used in rare cases to set up the main menu, for example by starting a movie playing in the background.
I mention this because the splashscreen is only shown on game load, whereas the before main menu label will play through even if a player quits to the main menu mid game.
Movie playing as a background of the main menu, that's what before_main_menu does. His movie play before it.
I think I understand, but I have an OP playing using the splashcreen label already:

Code: Select all

label splashscreen:
    scene black
    with Pause(1)
    $ renpy.movie_cutscene("movies/op.m2t")
    with Pause(1)
    return
For the main menu I am currently using this code, but it continues to loop the video. Again, I am very much a beginner:

Code: Select all

image main_menu = Movie(play="movies/title.m2t", size=(1920,1080))
screen main_menu:
    add "main_menu"

Re: Main menu, movie into still image HELP

Posted: Mon Jan 13, 2020 3:10 am
by GlazeWasTaken
GlazeWasTaken wrote:
Mon Jan 13, 2020 3:05 am
gas wrote:
Mon Jan 13, 2020 12:13 am
Imperf3kt wrote:
Sun Jan 12, 2020 11:09 pm
You would not use the splashscreen for that but the before_main_menu label
https://www.renpy.org/doc/html/label.ht ... ial-labels


I mention this because the splashscreen is only shown on game load, whereas the before main menu label will play through even if a player quits to the main menu mid game.
Movie playing as a background of the main menu, that's what before_main_menu does. His movie play before it.
I think I understand, but I have an OP playing using the splashcreen label already:

Code: Select all

label splashscreen:
    scene black
    with Pause(1)
    $ renpy.movie_cutscene("movies/op.m2t")
    with Pause(1)
    return
For the main menu I am currently using this code, but it continues to loop the video. Again, I am very much a beginner:

Code: Select all

image main_menu = Movie(play="movies/title.m2t", size=(1920,1080))
screen main_menu:
    add "main_menu"
After doing a bit of fiddling with the before_main_menu label, I have it working (kind of).
I need it to be playing the main menu theme in the background, so that the visuals tie in with the song, but right now it plays after the menu intro is done. There is also a short black screen that transitions between the video and the title screen, a quick flash cutting between the two. Any way I can fix these things? Thank you!

Re: Main menu, movie into still image HELP

Posted: Mon Jan 13, 2020 3:27 pm
by Alex
GlazeWasTaken wrote:
Mon Jan 13, 2020 3:05 am
...For the main menu I am currently using this code, but it continues to loop the video. Again, I am very much a beginner:

Code: Select all

image main_menu = Movie(play="movies/title.m2t", size=(1920,1080))
screen main_menu:
    add "main_menu"
Try to set 'loop and 'image' properties for your movie - https://www.renpy.org/doc/html/movie.html#Movie

Re: Main menu, movie into still image HELP

Posted: Mon Jan 13, 2020 11:51 pm
by GlazeWasTaken
Alex wrote:
Mon Jan 13, 2020 3:27 pm
GlazeWasTaken wrote:
Mon Jan 13, 2020 3:05 am
...For the main menu I am currently using this code, but it continues to loop the video. Again, I am very much a beginner:

Code: Select all

image main_menu = Movie(play="movies/title.m2t", size=(1920,1080))
screen main_menu:
    add "main_menu"
Try to set 'loop and 'image' properties for your movie - https://www.renpy.org/doc/html/movie.html#Movie
Hi, that was my old code. Here is how it's looking now:

Code: Select all

label before_main_menu:
    $renpy.movie_cutscene("movies/title.m2t")
    return
What I am currently having trouble with is this:
I need it to be playing the main menu theme in the background, so that the visuals tie in with the song, but right now it plays after the menu intro is done. There is also a short black screen that transitions between the video and the title screen, a quick flash cutting between the two. Any way I can fix these things? Thank you!

Re: Main menu, movie into still image HELP

Posted: Tue Jan 14, 2020 5:08 pm
by Alex
Have you tried this?

Code: Select all

image main_menu = Movie(play="movies/title.m2t", size=(1920,1080), loop=False, image="images/static_img.png")
screen main_menu:
    add "main_menu"

Re: Main menu, movie into still image HELP

Posted: Wed Jan 15, 2020 12:47 am
by GlazeWasTaken
Alex wrote:
Tue Jan 14, 2020 5:08 pm
Have you tried this?

Code: Select all

image main_menu = Movie(play="movies/title.m2t", size=(1920,1080), loop=False, image="images/static_img.png")
screen main_menu:
    add "main_menu"
I just went and tried this:

Code: Select all

label before_main_menu:
    image main_menu = Movie(play="movies/title.m2t", size=(1920,1080), loop=False, image="images/title screen logo.png")
    screen main_menu:
        add "main_menu"

return
and the video is still in a weird size (https://i.imgur.com/X27RKoh.png), as well as it looping and not going to the image, which is strange because it says loop=false. I tried removing the label as well, and it does the same thing. Really not sure what is going wrong. Maybe the video format I'm using is a problem?

Re: Main menu, movie into still image HELP

Posted: Wed Jan 15, 2020 1:31 am
by Imperf3kt
I believe so, m2t is mpeg2 transport, typically packaged in an m2ts (mpeg-2 transport stream) container. Generally only used with blurays or HDTV broadcasts.
It's a licensed format, so to use it you'd technically need to pay royalties.

As far as I can see, Ren'Py doesn't officially support its use.
https://www.renpy.org/doc/html/movie.html

Re: Main menu, movie into still image HELP

Posted: Wed Jan 15, 2020 2:55 am
by GlazeWasTaken
Imperf3kt wrote:
Wed Jan 15, 2020 1:31 am
I believe so, m2t is mpeg2 transport, typically packaged in an m2ts (mpeg-2 transport stream) container. Generally only used with blurays or HDTV broadcasts.
It's a licensed format, so to use it you'd technically need to pay royalties.

As far as I can see, Ren'Py doesn't officially support its use.
https://www.renpy.org/doc/html/movie.html
Thanks for letting me know about this, I am using Vegas Pro 14 to put together the cutscenes/OP/credits, and I am not sure which file type to use. What is the best extension to use for use in renpy?

Re: Main menu, movie into still image HELP

Posted: Wed Jan 15, 2020 3:40 am
by Imperf3kt
There's some varying opinions about that, but personally I prefer vp8 / vp9 inside an mkv or WebM container.
The documentation has the following to say about it
Note that using some of these formats may require patent licenses. When in doubt, and especially for commercial games, we recommend using VP9, VP8, or Theora; Opus or Vorbis; and WebM, Matroska, or Ogg
If Vegas doesn't export to this format, you can choose something with the codec and 'mux' the output into a different container with a muxing program.

Re: Main menu, movie into still image HELP

Posted: Wed Jan 15, 2020 1:08 pm
by GlazeWasTaken
Imperf3kt wrote:
Wed Jan 15, 2020 3:40 am
There's some varying opinions about that, but personally I prefer vp8 / vp9 inside an mkv or WebM container.
The documentation has the following to say about it
Note that using some of these formats may require patent licenses. When in doubt, and especially for commercial games, we recommend using VP9, VP8, or Theora; Opus or Vorbis; and WebM, Matroska, or Ogg
If Vegas doesn't export to this format, you can choose something with the codec and 'mux' the output into a different container with a muxing program.
Thank you, I will try one of these out.
My main issue is still that the video is sized weirdly while it plays and that it continues to loop, despite having the loop defined as false and having an image defined to the Movie, so it should go right to that image after it is done playing. MPEG2 is supported by renpy from the Movie page, but maybe for some reason that format is messing with the Movie script. I will try and find a program that allows me to re-encode my videos to mkv and then post an update.

Re: Main menu, movie into still image HELP

Posted: Wed Jan 15, 2020 4:26 pm
by Alex
That's the actual code that worked well for me (no additional labels required)... It uses video and image from tutorial game.

Code: Select all

image main_menu_movie_bg = Movie(play="oa4_launch.webm", size=(640,320), loop=False, image="images/bg washington.jpg")

screen main_menu():

    ## This ensures that any other menu screen is replaced.
    tag menu

    style_prefix "main_menu"

    add gui.main_menu_background
    
    add "main_menu_movie_bg" align(0.5,0.5)