Play Movie file behind menu buttons don't work! (SOLVED)

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
Coldness
Newbie
Posts: 5
Joined: Sun Aug 31, 2014 7:13 am
Contact:

Play Movie file behind menu buttons don't work! (SOLVED)

#1 Post by Coldness »

Hello dear visual novel lovers,

I tried to understand the information from an existing thread http://lemmasoft.renai.us/forums/viewto ... =8&t=23365 but with no success... What am i doing wrong? Besides, i want the movie to loop the whole time and doesn't dissapear when returning to the main menu from ex. 'options menu'.
Here is the sample from my code:

Code: Select all

screen main_menu:
     
    on "show" action Play("movie", "planetg.mpg")
    on "hide" action Stop("movie")
    on "replaced" action Stop("movie")
      
    # This ensures that any other menu screen is replaced.
        tag menu
        
    
    
    # The background of the main menu.
            window:
            style "mm_root"
            
    add Movie(size=(1920, 1080))
    
    # The main menu buttons.
        frame:
            style_group "mm"
            xalign .98
            yalign .98

            has vbox

            textbutton _("Start Game") action Start()
            textbutton _("Load Game") action ShowMenu("load")
            textbutton _("Preferences") action ShowMenu("preferences")
            textbutton _("Help") action Help()
            textbutton _("Quit") action Quit(confirm=False)

init -2:

    # Make all the main menu buttons be the same size.
    style mm_button:
        size_group "mm"
here is the traceback:

Code: Select all

I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.


File "game/screens.rpy", line 184: Line is indented, but the preceding on statement does not expect a block. Please check this line's indentation.
    tag menu
    ^

Ren'Py Version: Ren'Py 6.17.7.521
Last edited by Coldness on Mon Sep 01, 2014 4:27 am, edited 1 time in total.

Human Bolt Diary
Regular
Posts: 111
Joined: Fri Oct 11, 2013 12:46 am
Contact:

Re: Play Movie file behind menu buttons don't work!

#2 Post by Human Bolt Diary »

Read the trackback.

Hint: In Python, indentation matters. One of your lines isn't indented correctly. Re-read the code you copied.

You can figure this one out. I believe in you.

User avatar
Alex
Lemma-Class Veteran
Posts: 3094
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Play Movie file behind menu buttons don't work!

#3 Post by Alex »

Fix the indentation, should be

Code: Select all

screen main_menu:
     
    on "show" action Play("movie", "planetg.mpg")
    on "hide" action Stop("movie")
    on "replaced" action Stop("movie")
      
    # This ensures that any other menu screen is replaced.
    tag menu
http://www.renpy.org/wiki/renpy/FAQ#How ... _blocks.3F
http://www.renpy.org/doc/html/language_ ... and-blocks

Coldness
Newbie
Posts: 5
Joined: Sun Aug 31, 2014 7:13 am
Contact:

Re: Play Movie file behind menu buttons don't work!

#4 Post by Coldness »

It worked now! Yeah it was so obvious, thanks guys!

Post Reply

Who is online

Users browsing this forum: No registered users