delaying a scene change as the dialogue continues [SOLVED]

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
User avatar
Rainvillain
Regular
Posts: 76
Joined: Thu Mar 05, 2015 11:27 am
Contact:

delaying a scene change as the dialogue continues [SOLVED]

#1 Post by Rainvillain »

Hi there!

I was wondering if there was a way so that the act of changing scenes/backgrounds could be delayed briefly so as to have the scene transition not happen right when I click but instead after the subsequent line of dialogue has already started to appear?
I realize this is a weird little thing but basically it's to make some transitions a bit more "movie-like", in that I might want to have the dialogue start half a second before the camera cuts to a different character.
So for example:

Code: Select all

label start:
    scene livingroom
    show bob
    b "hey steve! How are you doing?"
    scene kitchen
    show steve
    s "yeah, I'm not bad."
    s "Thanks for asking!"
What if I wanted the transition from the living room to the kitchen to happen after Steve's line "yeah I'm not bad" has started to appear on screen (and before the player clicks again. Is their something I would attach to the scene transition to delay it? like "with delay"? :lol:
Last edited by Rainvillain on Fri Jan 22, 2016 12:43 pm, edited 1 time in total.

philat
Eileen-Class Veteran
Posts: 1912
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: delaying a scene change as the dialogue continues

#2 Post by philat »

Use an ATL transform to delay when the scene shows up.

Code: Select all

init:
    transform atldelay:
        alpha 0.0
        pause 0.5
        alpha 1.0

label start:
    scene livingroom
    "Blah"
    scene kitchen at atldelay
    "Blah blah"

User avatar
Rainvillain
Regular
Posts: 76
Joined: Thu Mar 05, 2015 11:27 am
Contact:

Re: delaying a scene change as the dialogue continues

#3 Post by Rainvillain »

Hey thanks for the reply!
That pretty much did the trick, except I had to change it from "show" instead of "scene", since the delayed scene just meant it wiped the previous scene and then waited a half second for the next scene to load. Using "show" instead fixed this issue. :)

And if I wanted to make the scene change with dissolve, where in the init block would I include that? Forgive me, I'm still a beginner..
I tried variations on:

Code: Select all

init:
    transform atldelay:
        alpha 0.0
        pause 1.0
        alpha 1.0 with dissolve
...but it didn't seem to register. And if I added "with dissolve" to:

Code: Select all

scene kitchen at atldelay with dissolve 
it just makes the scene fade to black before the delay. So if you have any suggestion as to how to make the dissolve happen after the delay I would be most grateful!

philat
Eileen-Class Veteran
Posts: 1912
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: delaying a scene change as the dialogue continues

#4 Post by philat »

Code: Select all

init:
    transform atldelay:
        alpha 0.0
        pause 0.5
        linear 0.5 alpha 1.0

User avatar
Rainvillain
Regular
Posts: 76
Joined: Thu Mar 05, 2015 11:27 am
Contact:

Re: delaying a scene change as the dialogue continues

#5 Post by Rainvillain »

Yes, that did it, thanks!

Now I have a new problem I haven't accounted for. I want a character to appear at the same time as the new scene appears.
So in our ongoing goofy example, I tried:

Code: Select all

label start:
    scene livingroom
    show bob
    b "hey steve! How are you doing?"
    show kitchen at altdelay
    show steve
    s "yeah, I'm not bad."
    s "Thanks for asking!"
...which makes Steve show up before the kitchen fades in.

If I try writing:

Code: Select all

show kitchen at altdelay
show steve at altdelay
..then I get the follow error, claiming that altdelay isn't defined (even though I've defined it above in the init.

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 24, in script
    show steve at altdelay
  File "game/script.rpy", line 24, in <module>
    show steve at altdelay
NameError: name 'altdelay' is not defined

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "game/script.rpy", line 24, in script
    show steve at altdelay
  File "/Applications/renpy-6.99.4-sdk/renpy/ast.py", line 1061, in execute
    show_imspec(self.imspec, atl=getattr(self, "atl", None))
  File "/Applications/renpy-6.99.4-sdk/renpy/ast.py", line 1024, in show_imspec
    at_list = [ renpy.python.py_eval(i) for i in at_list ]
  File "/Applications/renpy-6.99.4-sdk/renpy/python.py", line 1489, in py_eval
    return py_eval_bytecode(code, globals, locals)
  File "/Applications/renpy-6.99.4-sdk/renpy/python.py", line 1484, in py_eval_bytecode
    return eval(bytecode, globals, locals)
  File "game/script.rpy", line 24, in <module>
    show steve at altdelay
NameError: name 'altdelay' is not defined

Darwin-13.4.0-x86_64-i386-64bit
Ren'Py 6.99.7.858
imagemap test 0.0
So my question is, I think(?) a simple one: how do I make it so that a character is shown on screen at the same time delay as the background?

philat
Eileen-Class Veteran
Posts: 1912
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: delaying a scene change as the dialogue continues

#6 Post by philat »

Before looking into this further, did you redefine the transform I posted to altdelay? Because I posted it as atldelay (= delay using ATL), so just wondering.

User avatar
Rainvillain
Regular
Posts: 76
Joined: Thu Mar 05, 2015 11:27 am
Contact:

Re: delaying a scene change as the dialogue continues

#7 Post by Rainvillain »

Oh, yeah... I wrote alt instead of atl. Damn such an obvious mistake ._.
That fixed my problem.
Thanks again for your help!! If there was a kudos/points/karma system on these boards I'd dump all of them onto you. :)

Post Reply

Who is online

Users browsing this forum: Majestic-12 [Bot]