Pausing video?

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
pfranzen
Regular
Posts: 42
Joined: Fri Apr 01, 2016 2:39 pm
Completed: Cat President 1+2, Internet Court, Too Many Santas, The Awkward Steve Duology, The Pizza Delivery Boy Who Saved the World, Francy Droo & Friends
Organization: Oh, a Rock! Studios
itch: oharock
Contact:

Pausing video?

#1 Post by pfranzen »

Hello! I'm working on an Ace Attorney-style courtroom game that uses live-action footage of actors. Right now, if you click on any of the menu buttons (save, load, preferences, etc.) while video is playing, it keeps playing the video in the background. Is there a way to pause the video, instead, so that it remembers where you were when you exit the menu?

My best idea was to save the game when you open the menu, then load that save file when you return; unfortunately, it doesn't remember where you were in the video. It just skips to the next scene. Bummer. This would've been especially helpful, because we also have image files (captions) running concurrent to the video, like:

Code: Select all

  
play movie "case_1-132.webm" noloop 
show subtitle 1-223 # Why am I getting a strike when it's the defense's contradiction? 
pause 4.275
show subtitle 1-224 # My life is so unfair.
pause 1.67
# Then the next scene plays.
So being able to record the exact moment the player was in when they opened the menu would've been huge.

My gamedev partner had the idea of running a timer while each video is playing, then recording the time, and playing the video from that point when you exit the menu. That might work, but I'm a little reluctant because 1) I'm not sure it would work with the captions, and 2) it could be an enormous amount of coding. (We have 200+ videos in the game right now, and we're only 1/4 of the way through.)

My other option is to just gray out the menu icons, so that you can only click them when there aren't any videos playing (like when the player is making a decision), but if anyone else has any thoughts I would love to hear them.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3791
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Pausing video?

#2 Post by Imperf3kt »

Note, I am not experienced with this, so I may be completely wrong about this.

You might be able to use
https://www.renpy.org/doc/html/config.h ... t_callback
Or
https://www.renpy.org/doc/html/label.ht ... ew_context
Or
https://www.renpy.org/doc/html/label.ht ... ew_context

I have no idea how though.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

pfranzen
Regular
Posts: 42
Joined: Fri Apr 01, 2016 2:39 pm
Completed: Cat President 1+2, Internet Court, Too Many Santas, The Awkward Steve Duology, The Pizza Delivery Boy Who Saved the World, Francy Droo & Friends
Organization: Oh, a Rock! Studios
itch: oharock
Contact:

Re: Pausing video?

#3 Post by pfranzen »

I'll see if I can do anything with those; thank you!

EDIT: Alas! Using "renpy.invoke_in_new_context" to open a screen gets me close; it pauses the code and the music, but it doesn't pause the video.

Post Reply

Who is online

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