Is it possible to tell renpy to stop a looped video and move to a different video only at the end of the video that's beeing looped?

30avenger30

Member
Game Developer
May 27, 2018
125
508
Hey )
I hope I'm being clear.
I have a video being looped and supposed to move to a different video when the player hits the mouse.
I want it to move to the new video only when the looped video finish the last frame of the original video that is being looped , so that the new video will continue the first one.
Is it possible in renpy?

I'm using this code for the video:

image scene_1 = Movie(size=(1920,1080), channel="movie", play="Videos/scene 1.ogv", loop=True)

and then just show it:

show scene_1

Thanks...
 

Deleted member 609064

Well-Known Member
May 11, 2018
1,249
1,587
I am not a programmer but couldn't you just have the first video load on click 1, and then a brief pause (stop in the movement of the game/story) with a new movie starting on click 2?

Maybe you don't want that pause. If so, I suspect you need to make it all one movie, perhaps with a pause midway through (for cinematic purposes). I don't know what that will do for file size and loading ...
 

30avenger30

Member
Game Developer
May 27, 2018
125
508
I am not a programmer but couldn't you just have the first video load on click 1, and then a brief pause (stop in the movement of the game/story) with a new movie starting on click 2?

Maybe you don't want that pause. If so, I suspect you need to make it all one movie, perhaps with a pause midway through (for cinematic purposes). I don't know what that will do for file size and loading ...
Thanks for the response.
No, I want the first video to loop and the player to decide when to finish the loop.
I just want renepy to stop the loop at the end of the video that is being looped.
for example...
if my looped video is 30 frames long and the player decides to stop the loop at frame 15 of the video, I want renepy to keep playing the loop until it reaches frame 30 and then move to the new video.
Again, I hope I'm being clear :)
 

Deleted member 609064

Well-Known Member
May 11, 2018
1,249
1,587
Thanks for the response.
No, I want the first video to loop and the player to decide when to finish the loop.
I just want renepy to stop the loop at the end of the video that is being looped.
for example...
if my looped video is 30 frames long and the player decides to stop the loop at frame 15 of the video, I want renepy to keep playing the loop until it reaches frame 30 and then move to the new video.
Again, I hope I'm being clear :)
Perhaps introduce a button to continue to the next video that appears after some time. Something that appears in the corner while the video loops, now the viewer can decide when to advance.
 

30avenger30

Member
Game Developer
May 27, 2018
125
508
Perhaps introduce a button to continue to the next video that appears after some time. Something that appears in the corner while the video loops, now the viewer can decide when to advance.
Thanks for your help, but you're not really getting what I'm saying.
The video will move to the next one as soon as the player hits the mouse button/space, but I want renpy to keep playing the loop until the last frame of the original video that's being looped.
Any help from someone else would be grately appriciated )
 

desmosome

Conversation Conqueror
Sep 5, 2018
6,182
14,229
Thanks for the response.
No, I want the first video to loop and the player to decide when to finish the loop.
I just want renepy to stop the loop at the end of the video that is being looped.
for example...
if my looped video is 30 frames long and the player decides to stop the loop at frame 15 of the video, I want renepy to keep playing the loop until it reaches frame 30 and then move to the new video.
Again, I hope I'm being clear :)
If anyone can help you, it would probably be anne O'nymous.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,389
15,300
I have a video being looped and supposed to move to a different video when the player hits the mouse.
I want it to move to the new video only when the looped video finish the last frame of the original video that is being looped , so that the new video will continue the first one.
Is it possible in renpy?
Natively, no. Either the movie stop immediately when the user click, or it stop at the end of the umpteenth loop.

But it's really easy to do what you want, you just need to encapsulate the movie in a screen that will catch the click:
Code:
# Arguments are the exact duration of the movie, and the movie itself.
screen loopingMovie( duration, movieName ):

    default loop = True

    timer duration repeat True action If( loop is True, NullAction(), Return() )

    add movieName

    # A 100% transparent button that cover all the screen
    imagebutton:
        xpos 0
        ypos 0
        xsize config.screen_width
        ysize config.screen_height
        idle Solid( "#00000000" )
        action SetScreenVariable( "loop", False )

image myMovie = Movie(play="someMovie.webm")

label whatever:
    call screen loopingMovie( 12.0, "myMovie" )
 

30avenger30

Member
Game Developer
May 27, 2018
125
508
Natively, no. Either the movie stop immediately when the user click, or it stop at the end of the umpteenth loop.

But it's really easy to do what you want, you just need to encapsulate the movie in a screen that will catch the click:
Code:
# Arguments are the exact duration of the movie, and the movie itself.
screen loopingMovie( duration, movieName ):

    default loop = True

    timer duration repeat True action If( loop is True, NullAction(), Return() )

    add movieName

    # A 100% transparent button that cover all the screen
    imagebutton:
        xpos 0
        ypos 0
        xsize config.screen_width
        ysize config.screen_height
        idle Solid( "#00000000" )
        action SetScreenVariable( "loop", False )

image myMovie = Movie(play="someMovie.webm")

label whatever:
    call screen loopingMovie( 12.0, "myMovie" )
Thank you so much.
I was hoping I could do it without screens, but I'll take what I can get :)