Keeping text shown during transitions

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.
Message
Author
User avatar
akakyouryuu
Regular
Posts: 162
Joined: Fri Nov 30, 2012 10:29 am
Contact:

Re: Keeping text shown during transitions

#16 Post by akakyouryuu »

Try python early

Code: Select all

python early:
    show_text_during_trans=True

User avatar
A Hazard
Regular
Posts: 25
Joined: Sun Jun 29, 2014 4:02 pm
Completed: Gilded - The Lily & the Cage
Projects: Fragment - A Broken Fairy Tale
Tumblr: fragmentfairytale
Deviantart: fragmentfairytale
Contact:

Re: Keeping text shown during transitions

#17 Post by A Hazard »

No more error messages! Unfortunately, no text during the transition either. (Either with "show_text_during_trans=True" set as the default in options.rpy or when it's instead turned on for a specific scene in script.rpy)

Image

User avatar
akakyouryuu
Regular
Posts: 162
Joined: Fri Nov 30, 2012 10:29 am
Contact:

Re: Keeping text shown during transitions

#18 Post by akakyouryuu »

Try this in the tutorial. Is text hidden there?

User avatar
akakyouryuu
Regular
Posts: 162
Joined: Fri Nov 30, 2012 10:29 am
Contact:

Re: Keeping text shown during transitions

#19 Post by akakyouryuu »

The code had bug. Please fix.

Code: Select all

    def show_window(self):

        if not renpy.store._window:
            return

        if not renpy.game.preferences.show_empty_window:
            return

        ############Edit
        if getattr(renpy.store, "show_text_during_trans", False):
            return
        ############Edit

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

        if renpy.config.empty_window:
            renpy.config.empty_window()

~~~~~~~~~~~~~~~~~~~~~~~~~~~~

            while repeat:
                repeat, rv = self.interact_core(preloads=preloads, **kwargs)

            return rv

        finally:

            context.interacting = False

            # Clean out transient stuff at the end of an interaction.
            if clear:
                scene_lists = renpy.game.context().scene_lists
                ####################Edit
                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"))
                ####################Edit
                scene_lists.replace_transient()

            self.ongoing_transition = { }
            self.transition_time = { }
            self.transition_from = { }

User avatar
A Hazard
Regular
Posts: 25
Joined: Sun Jun 29, 2014 4:02 pm
Completed: Gilded - The Lily & the Cage
Projects: Fragment - A Broken Fairy Tale
Tumblr: fragmentfairytale
Deviantart: fragmentfairytale
Contact:

Re: Keeping text shown during transitions

#20 Post by A Hazard »

There are extra left brackets in the new code in the same spot as the old code but other than that, yes, the textbox & text stayed through the transition with the updated code. :D Thanks for all your effort with this!

User avatar
Arowana
Miko-Class Veteran
Posts: 531
Joined: Thu May 31, 2012 11:17 pm
Completed: a2 ~a due~
Projects: AXIOM.01, The Pirate Mermaid
Organization: Variable X, Navigame
Tumblr: navigame-media
itch: navigame
Contact:

Re: Keeping text shown during transitions

#21 Post by Arowana »

I've been using akakyouryuu's code and ran into a strange bug that we can't figure out.

If I have a button on the say screen that sets a persistent variable, then Renpy crashes when I try to save. For example, I tried starting a new game, then added a button like this to the say screen:

Code: Select all

screen say:
    # Defaults for side_image and two_window
    default side_image = None
    default two_window = False
   
    textbutton "test button":
        action SetField(persistent,"testvariable", False)   

    # regular say screen stuff below
This is my simple test script:

Code: Select all

label start:
    $ persistent.testvariable = True
    e "You've created a new Ren'Py game."
    e "Once you add a story, pictures, and music, you can release it to the world!"
    return
If I try to save the game on the second line of dialogue, I get an error that looks like this:
An exception has occurred:
While running game code:
File "renpy//common/00action_file.rpy", Line 259, in __call_
renpy.save(fn, extra_info=save_name)
TypeError: 'NoneType' object is not callable
Somehow removing these two lines in the core.py code:

Code: Select all

if ("screens", "say") in scene_lists.additional_transient:
    scene_lists.additional_transient.remove(("screens", "say"))
fixes the problem. Anyone know why those 2 lines are conflicting with the button?
Complete: a2 ~a due~ (music, language, love)
In progress: The Pirate Mermaid (fairytale otome)
On hold: AXIOM.01 (girl detective game)

Image

Valiowk
Newbie
Posts: 22
Joined: Sat Jan 02, 2016 8:32 pm
Contact:

Re: Keeping text shown during transitions

#22 Post by Valiowk »

Tried out akakyouryuu's latest fixed code in Ren'Py 6.99.8; the project will not launch after the edits to core.py. Any ideas what must be further fixed for it to work in a new version of Ren'Py?

User avatar
Fox Lee
Veteran
Posts: 213
Joined: Sat Oct 18, 2008 1:46 am
Completed: Where Ages Go [NaNo2015]
Projects: Swan x Swan [YuriJam/NaNo16], ♥ON, Guilded Age
Organization: Invincible Ink
Deviantart: foxlee
itch: foxlee
Location: Australia
Contact:

Re: Keeping text shown during transitions

#23 Post by Fox Lee »

Did anybody ever work this out for sure? I use a ton of facial expressions in my games, and I'd like to be able to have smooth transitions between them, but it feels terrible having the say window blink out on every second line of dialogue :\ Would be super great if somebody knew!
Fox Lee: The Girl Your Mother Warned You About
CleanDirtyFurryPro

User avatar
akakyouryuu
Regular
Posts: 162
Joined: Fri Nov 30, 2012 10:29 am
Contact:

Re: Keeping text shown during transitions

#24 Post by akakyouryuu »

How about statement_callbacks?
This code calls renpy.transition every "say" and "extend" statements.

Code: Select all

init python:
    tra = dissolve
    def auto_transition(statements):
        if statements in ["say", "extend"]:
            renpy.transition(tra, layer="master")
    config.statement_callbacks.append(auto_transition)

User avatar
Fox Lee
Veteran
Posts: 213
Joined: Sat Oct 18, 2008 1:46 am
Completed: Where Ages Go [NaNo2015]
Projects: Swan x Swan [YuriJam/NaNo16], ♥ON, Guilded Age
Organization: Invincible Ink
Deviantart: foxlee
itch: foxlee
Location: Australia
Contact:

Re: Keeping text shown during transitions

#25 Post by Fox Lee »

Doesn't seem to do the trick for me, but I just took a quick try, and I may be missing something. I'll give it another shot in the morning. Thanks! :)
Fox Lee: The Girl Your Mother Warned You About
CleanDirtyFurryPro

Akemari
Newbie
Posts: 4
Joined: Thu Jun 30, 2016 10:16 am
Contact:

Re: Keeping text shown during transitions

#26 Post by Akemari »

I would love to know this too! I've tried all of the above and haven't had any luck in the 6.99.10.

What I really would like is a way to have new text appear right as a transition starts. Imagine you see what a character is saying, as their image dissolves or moves on screen.

The reason I would really appreciate some help with this is I have a tavern in my game, and it's the kind of environment where people just casually pop in and out of the conversation willy nilly. I don't like having them just teleport, but it looks kind of jarring having the text disappear for half a second all the time.

User avatar
fundogmo
Newbie
Posts: 19
Joined: Thu Feb 19, 2015 12:24 am
Projects: Wingin' In: Love Can Be Such a Dragon
Tumblr: boxofsquids
Location: NYC
Contact:

Re: Keeping text shown during transitions

#27 Post by fundogmo »

Sorry to bump this, but I'm still hoping someone can work out a solution to this.

My game also would ideally have a bunch of dissolve transitions between characters and backgrounds to represent them moving away, and the loss of the text window is really affecting the pacing.

'show window' is making the NVL window pop up for me, rather than keeping the dialogue textbox on screen.

User avatar
akakyouryuu
Regular
Posts: 162
Joined: Fri Nov 30, 2012 10:29 am
Contact:

Re: Keeping text shown during transitions

#28 Post by akakyouryuu »

The code I posted previously has a problem showing text always fast even if text includes cps.
So, I stopped edditing core.py.


Just add options.rpy below code.
You also need window auto statement and Preference("show empty window", "show")

Code: Select all

  
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

edgebug
Regular
Posts: 41
Joined: Thu Jun 30, 2016 11:44 pm
Contact:

Re: Keeping text shown during transitions

#29 Post by edgebug »

I'm sorry, what do you mean by "window auto statement and Preference("show empty window", "show") "?

User avatar
akakyouryuu
Regular
Posts: 162
Joined: Fri Nov 30, 2012 10:29 am
Contact:

Re: Keeping text shown during transitions

#30 Post by akakyouryuu »

This code replaces default empty_window with new empty_window which lets the last speaker speak the last dialogue instantly if show_text_during_trans is True.
it means that text is kept during transition if _window and show_text_during_trans are True.

The behavior of empty_window is controlled by window statements and Preferences.
https://www.renpy.org/doc/html/dialogue ... management
https://www.renpy.org/doc/html/preferen ... pty_window
https://www.renpy.org/doc/html/config.h ... pty_window

Post Reply

Who is online

Users browsing this forum: barsunduk, Bing [Bot]