Ren'Py Renpy Scenes Skipping Noob Question

timepants

God of Time (and Pants)
Donor
Game Developer
May 12, 2017
1,698
6,611
Hey, everybody, so I've noticed that Renpy skips images in a sequence if one of the scenes doesn't contain dialogue.

For instance if (in my editor) i typed:
scene image 1
narrator "blah blah"
scene image 2
scene image 3
only scene image 1 would be displayed and the next two would be skipped entirely until the next scene with dialogue.

Now, if I typed:
scene image 1
narrator "blah blah"
scene image 2
character "blah blah blah"
scene image 3
character "blah blah blah! BLAH!"

In this case, all 3 images would show up, which I assume means that they're all tied to a dialogue line, otherwise Renpy will "autoplay" right through the blank ones in a split second.
So I guess my question is, do all scenes have to contain dialogue to avoid being auto skipped? Is there a way around this? I can delay the skip by adding a specific transition or pause, but it will still autoplay through eventually. I want it to proceed when the user clicks.
 

the66

beware, the germans are cumming
Modder
Donor
Respected User
Jan 27, 2017
7,656
23,750
a proper way would be
Python:
scene image 1
narrator "blah blah"
scene image 2
pause
scene image 3
pause

or
Python:
scene image 1
narrator "blah blah"
scene image 2
$ renpy.pause()
scene image 3
$ renpy.pause()
 
Last edited:
  • Like
Reactions: timepants

Rich

Old Fart
Modder
Donor
Respected User
Game Developer
Jun 25, 2017
2,486
7,007
Hey, everybody, so I've noticed that Renpy skips images in a sequence if one of the scenes doesn't contain dialogue.
I know you've got this working thanks to the66, but I figured I might add a few words to perhaps expand your Ren'py knowledge a bit.

Ren'py has the concept of an "interaction" with the user. Basically, "wait for the user to do something." Not every Ren'py command causes an interaction. This is by design, because you might be in a situation where you wanted to do something like this:

Code:
    scene my_background
    show my_foreground_character1
    show my_foreground_character2
    narrator "The two girls were walking down the street"
This code brings up all three images and then does the narration line.

So, the "scene" and "show" commands don't wait for user input - they just tell Ren'py what the screen should look like at the next interaction. So if you want to display an image and then have it stay there until the user clicked, after you "show" the image ("scene" is basically "clear all images and then show") you have to cause an interaction. Character dialog obviously does this. So do:
  • "menu" commands - they wait for the user to make a choice out of the options
  • "pause" commands (more below)
  • "call screen screenName" - won't proceed until the screen is dismissed by executing a Return() action.
Things that don't cause an interaction:
  • "show" commands. (Show an image, show a screen, etc.)
  • "scene" commands (Which, as I said, is just a "show" command that clears the screen first.)
  • Virtually all Python statements (anything starting with a $)
Those are not all-inclusive lists - they're just the cases that people hit most frequently.

As for "pause", there are two ways of doing this. If all you want is for the user to have to click before moving on, then either
Code:
    pause
or
Code:
    $ renpy.pause()
will do. The two are equivalent. The second one, however, has a few bells and whistles, since it's calling the underlying Python function.

If you wrote
Code:
    $ renpy.pause(3.0)
the game will advance when the user clicks, or when 3.0 seconds elapses, whichever comes first. So if you wanted to show a sequence of images without requiring the user to click, you could do:
Code:
    show image1
    $ renpy.pause(1.0)
    show image2
    $ renpy.pause(1.0)
    show image3
    $ renpy.pause(1.0)
With this code, if the user did nothing, each image would be displayed for one second, then the game would move on. On the other hand, if the user clicked, an image could be dismissed sooner than the 1.0 second.

On the other hand,
Code:
    $ renpy.pause(1.0, hard=True)
Generates a pause that can't be advanced until after the 1.0 second is up. So, basically, Ren'py will sit there for one second, completely ignoring the user, and then, when the 1.0 second is up, would wait for the user to click before advancing. So it's kind of like:
Code:
    sleep 1.0
    pause
if "sleep" was a Ren'py command. (Which it isn't.)

Of course, many people consider "hard pauses" to be rude - the user should be able to advance the game at his/her own rate. But the feature is there, if needed.

Anyway, that's the basic idea behind interactions and pauses. There are ways to play around with interactions, but those are more advanced Ren'py techniques that aren't needed all that often.

Happy Ren'py-ing!
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,302
15,172
On a side note, since you named it and some people can misunderstand what it do.

if "sleep" was a Ren'py command. (Which it isn't.)
But it's a Python method ; available but I'll not say how to prevent problems.

But it's something that should never be used.
The sleep Python method, and all its possible variations, "freeze" the game, making it wait the given amount of time before doing anything else. This while the pause statement, and its Python equivalent, just delay the moment where Ren'py will continue to proceed the game ; but let it continue to proceed everything "behind the scene".

Therefore, something like :
Code:
image myMovie = Movie( play="whatever.webm" )

label whatever:
    show myMovie
    pause 3.0
    "some dialog line"
Will play the movie during 3 seconds before displaying the dialog line.

But something like :
Code:
image myMovie = Movie( play="whatever.webm" )

label whatever:
    show myMovie
    $ sleep( 3.0 )    # Do not effectively works like that
    "some dialog line"
Would display the first frame of the movie during 3 seconds, then start to play the movie and display the dialog line.

Ren'py doing a lot of things "behind the scene", it's important to let it continue ; and so to never make it sleep, whatever how you intend to do it.