Ren'Py Prevent side image transitions

Corrupt King

Member
Game Developer
Nov 21, 2017
121
963
I'm looking for a way to stop side images from transitioning (dissolving), when using code like this:
Code:
scene bg_home_entrance
$ nan.sprite("normal", center)
with dissolve
$ show_text_during_trans = True
nan.u "Hello. May I help you?"
mc.n "Yeah, my name is Ryota. I rented a room in this house."
$ nan.sprite("shock", center)
with dissolve
nan.u "Eh? You're Ryota-san?" <= this is where the side image transition happens
For context, show_text_during_trans is a fix for disappearing dialogue.
renpy/display/core.py
Code:
    def show_window(self):

        if not renpy.store._window:
            return

        if not renpy.game.preferences.show_empty_window:
            return

        ########## MOD (Keep text during transitions)
        if getattr(renpy.store, "show_text_during_trans", False):
            return
        ########## MOD

        if renpy.game.context().scene_lists.shown_window:
            return

###

        finally:
            renpy.game.context().deferred_translate_identifier = None

            self.force_prediction = False

            context.interacting = False

            # Clean out transient stuff at the end of an interaction.
            if clear:
                scene_lists = renpy.game.context().scene_lists
                ########## MOD (Keep text during transitions)
                if getattr(renpy.store, "show_text_during_trans", False):
                    if ("screens", "say") in scene_lists.additional_transient:
                        scene_lists.additional_transient.remove(("screens", "say"))

                    if ("screens", "nvl") in scene_lists.additional_transient:
                        scene_lists.additional_transient.remove(("screens", "nvl"))
                ########## MOD
                scene_lists.replace_transient()

            self.end_transitions()

            self.restart_interaction = True
I would think, that since I'm already disabling transitions for the say screen (where the side image is added), this is enough, but no. I'm still getting the "fade out" effect on the old side image. The new side image appears without transition, as it should.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,131
14,813
I'm looking for a way to stop side images from transitioning (dissolving), when using code like this:
Code:
scene bg_home_entrance
$ nan.sprite("normal", center)
with dissolve
$ show_text_during_trans = True
nan.u "Hello. May I help you?"
mc.n "Yeah, my name is Ryota. I rented a room in this house."
$ nan.sprite("shock", center)
with dissolve
nan.u "Eh? You're Ryota-san?" <= this is where the side image transition happens
And, er... why are you using "code like this" ?


For context, show_text_during_trans is a fix for disappearing dialogue.
renpy/display/core.py
[...]
Because
Python:
screen say(who, what ):

    style_prefix 'say'

    if not show_text_during_trans:
        window:
            id 'window'
        [...]
is to complicated I guess.


I would think, that since I'm already disabling transitions for the say screen (where the side image is added), this is enough, but no.
Or you could use show and scene like everyone else. The first one should apply the transition only to the sprite, while the second would automatically hide the "say" screen during the transition.
 

Corrupt King

Member
Game Developer
Nov 21, 2017
121
963
I used "show_text_during_trans" to keep the text visible during transitions. Not exactly sure what I would accomplish by disabling/enabling the dialogue box all together. You can read more about it here:

For all intents and purposes, .sprite is show - I just use a custom class to store character parameters and some associated functions. That's not the problem.

In the end, I managed to fix side images by switching to a different method of keeping the text visible. The following replacement sorted everything out.
Code:
init python:
    show_text_during_trans=True
   
    def _default_empty_window2():
        try:
            who = _last_say_who
            who = renpy.eval_who(who)
        except:
            who = None
        what = _last_say_what
        if who is None:
            who = narrator
        if what is None:
            what = ""
        if show_text_during_trans:
            who(what+"{fast}", interact=False, _call_done=False)
        else:
            if isinstance(who, NVLCharacter):
                nvl_show_core()
            elif isinstance(store.narrator, ADVCharacter):
                store.narrator.empty_window()
            elif isinstance(store._narrator, ADVCharacter):
                store._narrator.empty_window()

    config.empty_window = _default_empty_window2