Playing movie inside python block

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
TC_Ha$kell
Newbie
Posts: 1
Joined: Sun Oct 12, 2014 7:12 pm
Contact:

Playing movie inside python block

#1 Post by TC_Ha$kell »

I'm executing a loop inside a Python block, and at some point I want to play a movie.

I tried using renpy.movie_start_displayable, but it always takes the whole screen. Plus, the wiki says that it is obsolete.

This works great:

Code: Select all

#Declaring images
image movie = Movie(size=(720, 300), xpos=0, ypos=30, xanchor=0, yanchor=0)

#Inside the loop
show movie

play movie "battle_fire.ogv" 

"Boss Attacks!"
    
hide movie with dissolve

stop movie
What would be the python equivalent? I also tried writing that code inside a label and then using renpy.call inside the loop but it returns to the point after the loop finishes rather than the exact following statement after the call.

User avatar
qirien
Miko-Class Veteran
Posts: 541
Joined: Thu Jul 31, 2003 10:06 pm
Organization: Metasepia Games
Deviantart: qirien
Github: qirien
itch: qirien
Location: New Mexico, USA
Discord: qirien
Contact:

Re: Playing movie inside python block

#2 Post by qirien »

I'm not sure, but it looks like you can use

Code: Select all

$ renpy.music.play(movie, "battle_fire.ogv")
Play's documentation doesn't say it can be used with movies, but Movie's documentation implies that.

Does that work?
Finished games:
Image
Image
Image

User avatar
PyTom
Ren'Py Creator
Posts: 16093
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Playing movie inside python block

#3 Post by PyTom »

It'll work in the same circumstances where "play movie" will work.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: Bing [Bot]