movie in main menu only show up once

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
hiz317
Newbie
Posts: 6
Joined: Thu Sep 29, 2016 4:33 am
Contact:

movie in main menu only show up once

#1 Post by hiz317 »

here is the detail, i use webm file for animated main menu, it work, then if i start thegame, then back to main menu, main menu picture/ animated webm i put there, gone, but if start the game, play till end, automatically back to main menu, animated main menu are back

User avatar
vollschauer
Veteran
Posts: 231
Joined: Sun Oct 11, 2015 9:38 am
Github: vollschauer
Contact:

Re: movie in main menu only show up once

#2 Post by vollschauer »

try to hide the movie if you leave the main_menu and do a show/play if you enter the main_menu

hiz317
Newbie
Posts: 6
Joined: Thu Sep 29, 2016 4:33 am
Contact:

Re: movie in main menu only show up once

#3 Post by hiz317 »

vollschauer wrote:try to hide the movie if you leave the main_menu and do a show/play if you enter the main_menu
i check main_menu screen and back to main menu in navigation screen,
normally it should re add background image, i have no idea what to do here, how to show/hide displayable in screen anyway?

User avatar
Divona
Miko-Class Veteran
Posts: 678
Joined: Sun Jun 05, 2016 8:29 pm
Completed: The Falconers: Moonlight
Organization: Bionic Penguin
itch: bionicpenguin
Contact:

Re: movie in main menu only show up once

#4 Post by Divona »

hiz317 wrote:how to show/hide displayable in screen anyway?
Something like this?:

Code: Select all

image background_movie = Movie(play="my_little_pony_video.webm")

label main_menu:
    show background_movie onlayer background

label start:
    hide background_movie onlayer background
Completed:
Image

hiz317
Newbie
Posts: 6
Joined: Thu Sep 29, 2016 4:33 am
Contact:

Re: movie in main menu only show up once

#5 Post by hiz317 »

Divona wrote:
hiz317 wrote:how to show/hide displayable in screen anyway?
Something like this?:

Code: Select all

image background_movie = Movie(play="my_little_pony_video.webm")

label main_menu:
    show background_movie onlayer background

label start:
    hide background_movie onlayer background
no it doesnt work, it said onlayer background nonexistent

also isn't screen automatically handled in screen.rpy and gui.rpy to define image background?

User avatar
Divona
Miko-Class Veteran
Posts: 678
Joined: Sun Jun 05, 2016 8:29 pm
Completed: The Falconers: Moonlight
Organization: Bionic Penguin
itch: bionicpenguin
Contact:

Re: movie in main menu only show up once

#6 Post by Divona »

hiz317 wrote:no it doesnt work, it said onlayer background nonexistent

also isn't screen automatically handled in screen.rpy and gui.rpy to define image background?
Well, that was a theory from my head, and hasn't been testing out. Also forgot that not everyone using layer. My bad.

Anyhoo, how did you define your main menu background?
I just get around to test out, and it seem to be working fine for me even when back to main menu mid way before get to the end of visual novel. Here is what I do in 'gui.rpy':

Code: Select all

## Main and Game Menus #########################################################

## The images used for the main and game menus.
define gui.main_menu_background = Movie(play="images/my_movie.webm")
This one also work with no issue:

Code: Select all

screen main_menu():

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

    style_prefix "main_menu"

    add gui.main_menu_background
    add Movie(play="images/movie.webm")
Last edited by Divona on Wed Oct 05, 2016 9:17 am, edited 1 time in total.
Completed:
Image

hiz317
Newbie
Posts: 6
Joined: Thu Sep 29, 2016 4:33 am
Contact:

Re: movie in main menu only show up once

#7 Post by hiz317 »

Divona wrote:
hiz317 wrote:no it doesnt work, it said onlayer background nonexistent

also isn't screen automatically handled in screen.rpy and gui.rpy to define image background?
Well, that was a theory from my head, and hasn't been testing out. Also forgot that not everyone using layer. My bad.

Anyhoo, how did you define your main menu background?
I just get around to test out, and it seem to be working fine for me even when back to main menu mid way before get to the end of visual novel. Here is what I do in 'gui.rpy':

Code: Select all

## Main and Game Menus #########################################################

## The images used for the main and game menus.
define gui.main_menu_background = Movie(play="my_movie.webm")
ya exactly like that, but it doesnt show up mid way, i tried different webm file, still same
im really confused here

User avatar
Divona
Miko-Class Veteran
Posts: 678
Joined: Sun Jun 05, 2016 8:29 pm
Completed: The Falconers: Moonlight
Organization: Bionic Penguin
itch: bionicpenguin
Contact:

Re: movie in main menu only show up once

#8 Post by Divona »

hiz317 wrote:ya exactly like that, but it doesnt show up mid way, i tried different webm file, still same
im really confused here
Look like it's time to troubleshooting this.

Did you change the code in 'navigation()'? Especially:

Code: Select all

textbutton _("Main Menu") action MainMenu()
Also, have you test it out on another computer with different spec?
What is the file size of your 'webm' file?

Try to do the main menu background movie from a new project, with no change except that one line:

Code: Select all

define gui.main_menu_background = Movie(play="images/movie.webm")"
Does problem still exist?

I believe there is some part in your code that interfere with background movie from being play properly when back to main menu mid way.
Last edited by Divona on Wed Oct 05, 2016 9:30 am, edited 1 time in total.
Completed:
Image

hiz317
Newbie
Posts: 6
Joined: Thu Sep 29, 2016 4:33 am
Contact:

Re: movie in main menu only show up once

#9 Post by hiz317 »

Divona wrote:
hiz317 wrote:ya exactly like that, but it doesnt show up mid way, i tried different webm file, still same
im really confused here
Look like it's time to troubleshooting this.

Did you change the code in 'navigation()'? Especially:

Code: Select all

textbutton _("Main Menu") action MainMenu()
Also, have you test it out on another computer with different spec?
What is the file size of your 'webm' file?
actually i look up navigation too, i dont change it becuase well i dont know what wrong and what to change, everything seem normal
havent tried on different spec though, webm size around 300kb, is there certain limit to work properly? i tried it for normal show in game and run smooth, i though size not problem

User avatar
Divona
Miko-Class Veteran
Posts: 678
Joined: Sun Jun 05, 2016 8:29 pm
Completed: The Falconers: Moonlight
Organization: Bionic Penguin
itch: bionicpenguin
Contact:

Re: movie in main menu only show up once

#10 Post by Divona »

hiz317 wrote: actually i look up navigation too, i dont change it becuase well i dont know what wrong and what to change, everything seem normal
havent tried on different spec though, webm size around 300kb, is there certain limit to work properly? i tried it for normal show in game and run smooth, i though size not problem
File size definitely not a problem here with only 300kb.
Now I would like you to try to create a new project in Ren'Py, and just change that one line in 'gui.rpy':

Code: Select all

define gui.main_menu_background = Movie(play="images/movie.webm")
Does the problem still exist?
Completed:
Image

hiz317
Newbie
Posts: 6
Joined: Thu Sep 29, 2016 4:33 am
Contact:

Re: movie in main menu only show up once

#11 Post by hiz317 »

ohoho it work, oh i realized the different, i put properties channel before, actually what it does?

maybe i misunderstood documentation, i though must put channel properties

Code: Select all

channel

    A string giving the name of the channel that the movie will be played on.

    This must always be provided, and should never not be left at the default of "movie", and should not be the name of an audio channel. Names should be chosen such that only one Movie will be displaying on a given channel at the same time. Channels provided will be automatically registered using renpy.music.register_channel(), if not already registered.


User avatar
Divona
Miko-Class Veteran
Posts: 678
Joined: Sun Jun 05, 2016 8:29 pm
Completed: The Falconers: Moonlight
Organization: Bionic Penguin
itch: bionicpenguin
Contact:

Re: movie in main menu only show up once

#12 Post by Divona »

The 'channel' in Movie() is:
The audio channel associated with this movie. When a movie file is played on that channel, it will be displayed in this Movie displayable.
It shouldn't have affecting on movie being play or not, really. You can set channel to 'sfx' so when player mute the sound in Preference menu, it will also mute movie sound as well.

It typically no need to put in or change the channel in Movie() as Ren'Py already set channel to 'movie' on default.

However, I did have problem when I used:

Code: Select all

$ renpy.music.register_channel("movie", mixer="sfx", loop=False, stop_on_mute=True, tight=True)
Which cause movie from being play because I set 'movie' channel to be the same as 'sfx' and also set 'stop_on_mute=True', which stop playing movie when the sound is mute in Preference menu.

Well, I'm glad you get your problem sorted. :lol:
Completed:
Image

Post Reply

Who is online

Users browsing this forum: Majestic-12 [Bot], piinkpuddiin