Play a movie file which is currently playing?

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
ReAnimator
Regular
Posts: 67
Joined: Mon Dec 16, 2013 1:00 pm
Contact:

Play a movie file which is currently playing?

#1 Post by ReAnimator »

Hi,
is there a way to play a movie file from the beginning which is currently playing?
An example game is attached so please look at it.
If this is not featured somehow I think it's very important.
Attachments
Test.zip
(186.86 KiB) Downloaded 21 times

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: Play a movie file which is currently playing?

#2 Post by Divona »

Code: Select all

label start:
    scene black
    e "Here comes red ball."
    show movie test
    e "It's partially looping(brilliant feature btw) but I want this movie file to play again."
    e "How would you do that?"
    hide movie test
    $ renpy.pause(0.0)
    show movie test
    e "I put show statement again but it won't happen perhaps because Ren'py is smart enough to avoid nonsense."
    e "In case of static images that's great but when it comes to movie playback this seems nonsense."

    return
Completed:
Image

ReAnimator
Regular
Posts: 67
Joined: Mon Dec 16, 2013 1:00 pm
Contact:

Re: Play a movie file which is currently playing?

#3 Post by ReAnimator »

Thanks for quick reply and a solution!
Didn't know this trick.
I still hope more elegant way to do this but at least it's possible.
Thanks, Divona.

--edit

Uh... there's a slight gap between hide and show... The screen goes complete black for an instant. Unfortunately not acceptable.

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: Play a movie file which is currently playing?

#4 Post by Divona »

Code: Select all

label start:
    scene black
    e "Here comes red ball."
    show movie test
    e "It's partially looping(brilliant feature btw) but I want this movie file to play again."
    e "How would you do that?"
    $ renpy.play(renpy.music.get_playing(channel="test"), channel="test")
    e "I put show statement again but it won't happen perhaps because Ren'py is smart enough to avoid nonsense."
    e "In case of static images that's great but when it comes to movie playback this seems nonsense."

    return
Completed:
Image

ReAnimator
Regular
Posts: 67
Joined: Mon Dec 16, 2013 1:00 pm
Contact:

Re: Play a movie file which is currently playing?

#5 Post by ReAnimator »

Okaaay, you nailed it.
One problem that is not introduced in the example.
Say there are other movie files which use this method and they play in a irregular way.
That means you don't know the order of playing files.
Since this method returns the file name currently playing, it cannot use different files.

--edit

Silly me, just using renpy.play() was good enough.

Post Reply

Who is online

Users browsing this forum: No registered users