Renpy question.

Darth Bane

Member
May 2, 2018
146
1,102
How would I go about having dialogue remain during scene transitions? ie. I want a sentence to remain while 4 scenes transition with dissolve.
 

Porcus Dev

Engaged Member
Game Developer
Oct 12, 2017
2,582
4,692
You can try this:

Code:
label testsametext:
    scene image 1
    "Your text"
    scene image 2
    "{cps=0}Your text"   #It will be displayed immediately and will appear to be the same
    scene image 3
    "{cps=0}Your text"
    scene image 4
    "{cps=0}Your text"
The problem is if you use some kind of transition between images, such as "dissolve", since the text will be hidden for a moment to be shown again later and will not create the same effect... maybe there is some way to avoid it, right now I don't know.
 
  • Like
Reactions: Darth Bane

Rich

Old Fart
Modder
Donor
Respected User
Game Developer
Jun 25, 2017
2,490
7,035
The main question is whether you want the player to have to manually advance to see the next image, or whether you want the image to automatically advance without user interaction. For the first, what @mgomez0077 has given you a solution. If you want the image to automatically advance without user interaction, then you can use ATL to create a pseudo-image that updates automatically:
Code:
image my_auto_image:
    image1
    pause 0.5
    image2
    pause 0.5
    image3

...

    scene my_auto_image
    "Your text"
 
  • Like
Reactions: Darth Bane

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,582
2,219
Alternatively... and I think this would work...

Use show rather than scene, at least for the 3 images.

RenPy has this thing where the first unique identifier for an image (maybe all objects) is it's name.
It's the way side images work, where there might be a character called Alison and she has multiple side images for "side alison casual happy", "side alison casual sad", "side alison casual mad", "side alison blackdress happy", "side alison swimsuit shocked", etc. Where I'm using the using a combination of the character name, what they are wearing and their mood to associate with the side images.
In this case the identifier is "side", because that's the first parameter and is used by RenPy to refer to another unique identifier "alison".

All of which is a long way of saying that if you define an image identifier "bg" (for background), then use a combination of show and scene, you can have each "bg" image replace the previous one, without affecting anything else on the screen. Note: It's the space between the image names that make RenPy say "this is a bg", "this is alison", etc.

Something like:

Python:
image bg home hallway night = "bg_home_hallway_night"
image bg home hallway day = "bg_home_hallway_day"
image bg home kitchen night = "bg_home_kitchen_night"
image bg home kitchen day = "bg_home_kitchen_day"

label start:

    scene bg home hallway night
    with dissolve
    "this is the first line of text"
    show bg home hallway day
    with dissolve
    "this is the second line of text"
    show bg home kitchen night
    with dissolve
    "this is the third line of text"
    show bg home kitchen day
    with dissolve
    "this is the fourth line of text"

    scene black with dissolve
    "*** THE END ***"

And whilst this is possible... I'd still prefer the ATL solution Rich suggested of a timed animation of multiple images shown right at the beginning, that play on their own schedule regardless of what the player is doing...

Python:
image my_auto_image:
    "bg_home_hallway_night" with dissolve
    pause 2.0
    "bg_home_hallway_day" with dissolve
    pause 2.0
    "bg_home_kitchen_night" with dissolve
    pause 2.0
    "bg_home_kitchen_day" with dissolve

label start:

    scene my_auto_image
    "this is the first line of text"
    "this is the second line of text"
    "this is the third line of text"
    "this is the fourth line of text"

    scene black with dissolve
    "*** THE END ***"
Where the four images will rotate in order until the final one is shown and won't wait for the player to do anything.
 
  • Like
Reactions: Darth Bane

recreation

pure evil!
Respected User
Game Developer
Jun 10, 2018
6,274
22,423
Python:
"Some text that should stay on screen"
show some image # don't use with dissolve here, but instead:
$ renpy.transition(dissolve, layer="master")
show another image
$ renpy.transition(dissolve, layer="master")
extend "some text that should stay on screen with some more text"
show yet another image
$ renpy.transition(dissolve, layer="master")
"new text"
show new image with dissolve
 
  • Like
Reactions: Darth Bane

Darth Bane

Member
May 2, 2018
146
1,102
Thanks guys! Figured it out, after loosing half my hair!
While I have your attention, is it possible to speed up a movie file in Renpy itself, or do I have to use a video program?
ie. x2 x4
It's for a bike riding scene *cough* *cough*
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,369
15,286
is it possible to speed up a movie file in Renpy itself, or do I have to use a video program?
Well, back in the early time where Ren'py started to deal with movies, there were a fps optional argument for the object. Nowadays it's not used anymore because Ren'py automatically detect the frame rate, but it worth giving it a try, perhaps that it overwrite the movie's value. But I say this without any clue if it works or not.
 
  • Like
Reactions: Darth Bane

Honey hunters

Member
Jan 23, 2020
118
26
I'm new to renpy engine I want small help in script making I want make a Age verification code in Ren'Py script please help me to make a code in Ren'Py script Like { Yes I'm 18+ } goes to game and {No below 18 } is quit from game to home screen
 

Rich

Old Fart
Modder
Donor
Respected User
Game Developer
Jun 25, 2017
2,490
7,035
I'm new to renpy engine I want small help in script making I want make a Age verification code in Ren'Py script please help me to make a code in Ren'Py script Like { Yes I'm 18+ } goes to game and {No below 18 } is quit from game to home screen
There are a couple of ways to do this. The simplest is to use a "menu" right at the beginning of your game.

Code:
start:
    scene put-the-name-of-whatever-image-you-want-to-be-showing-behind-the-menu-here
    "You must be at least 18 to play this game"
    menu:
        "Yes, I'm 18 or older":
            pass
        "No, I'm under 18":
            return

    now-start-with-the-rest-of-your-game-code-here