Ren'Py Default transition ?

Nayko93

Well-Known Member
Feb 3, 2018
1,245
2,779
hi

After hours of having to write " with dissolve" at the end of each "show" and "scene" command, I'm starting to get a little bored ...

So is there a way to have a default transition for "show" and a default one for "scene"
so I don't have to write "scene 2-23 with dissolve" , instead I could just write "scene 2-23" and renpy will automatically apply a "dissolve" transition

thanks :)
 

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,607
2,256
Yeah.

What you want is : and .

with dissolve is already the default transition, but it's set to run for 0.2 seconds.
What you probably want is to increase that to 0.5 seconds.

For reference, the definition of dissolve is define dissolve = Dissolve(0.5).

Python:
# --- options.rpy ---

define config.window_show_transition = Dissolve(.5)
define config.window_hide_transition = Dissolve(.5)

This affects both scene and show (since scene uses show to do it's thing anyway).

If you wanted separate "default" transitions for scene and show - I'm not sure that's possible. I'd pick a default transition to use for scene and then override any show statements which are the exceptions. But only because I'd use scene 90% of the time and show for considerably less.
 

Nayko93

Well-Known Member
Feb 3, 2018
1,245
2,779
Yeah.

What you want is : and .

with dissolve is already the default transition, but it's set to run for 0.2 seconds.
What you probably want is to increase that to 0.5 seconds.

For reference, the definition of dissolve is define dissolve = Dissolve(0.5).

Python:
# --- options.rpy ---

define config.window_show_transition = Dissolve(.5)
define config.window_hide_transition = Dissolve(.5)

This affects both scene and show (since scene uses show to do it's thing anyway).

If you wanted separate "default" transitions for scene and show - I'm not sure that's possible. I'd pick a default transition to use for scene and then override any show statements which are the exceptions. But only because I'd use scene 90% of the time and show for considerably less.
thanks but I've tried your solution :

if I use "scene" the text box dissolve slowly to the next one, but the image change immediately without dissolve
if I use "show" the text box stay in place but the image still change immediately without dissolve

editing those line in the option only affect the text box, not the image
 

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,607
2,256
ah. I really should have tried it before replying. But since was from PyTom, I took it as being right (which it is, sort of... I just misunderstood the context of his answer).

That answer was in response to another thread I found:


It might be that one is what you are looking for. Or a combination of the two.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,957
16,188
It might be that one is what you are looking for.
The one gave by your link seem to be the only possibility.

But it present a default, you'll really have all the images change use Dissolve as transition, even when you don't want it. And incidentally it have a pause 1/2 time longer than the transition.

Therefore, I'll extend it a little to solve this. Note that I haven't tested it.
Code:
init python:
    #  I'm not narcissistic, it just ensure that Ren'py will
    # never have a configuration value with this name.
    config.AONscene_transition = Dissolve
    config.AONscene_transition_delay = 1

   def replacement_show(*args, **kwargs):
        if not config.AONscene_transition is None:
            renpy.transition( config.AONscene_transition( config.AONscene_transition_delay ) )
        renpy.show(*args, **kwargs)
        if not config.AONscene_transition is None:
            renpy.pause(config.AONscene_transition_delay, hard=True)
        return 
    config.show = replacement_show
    
    def replacement_hide(*args, **kwargs):
        if not config.AONscene_transition is None:
            renpy.transition( config.AONscene_transition( config.AONscene_transition_delay ) )
        renpy.hide(*args, **kwargs)
        if not config.AONscene_transition is None:
            renpy.pause(config.AONscene_transition_delay, hard=True)
        return 
    config.hide = replacement_hide 

label whatever:
    scene abc001
    "blabla"
    scene abc002
    "blibli"
    $ config.AONscene_transition = None
    # No transition for this scene
    scene abc003
    "bloblo"
    $ config.AONscene_transition = Whatever
    # "Whatever" transition for that scene
    scene abc004
    "blublu"
    $ config.AONscene_transition = Dissolve
    $ config.AONscene_transition_delay = 0.5
    # Dissolve( 0.5) transition
    scene abc005
    [...]