Page 2 of 2

Re: Thought Bubbles or something similar for Interior Monologue

Posted: Wed Jun 08, 2022 4:50 pm
by Dark12ose
zmook wrote:
Wed Jun 08, 2022 4:33 pm
Dark12ose wrote:
Wed Jun 08, 2022 3:35 pm
When the mct is the first speaker in a scene change is there a ghosting of the default textbox before the custom textbox appear?
Oh, that sounds sort of familiar. I had a similar problem when I was re-writing the 'choice' screen, and fixed the ghost say box with

Code: Select all

  window hide
If that seems to work for your problem, see this part of the docs for details:

https://www.renpy.org/doc/html/config.h ... fig.window
I did find this solution and it definitely hides the ghosting textbox but at the cost of no textbox transition happening unfortunately.
The only way I found to get BOTH working was to do manual change. (I'm VERY picky with what I want lol)

Hopefully, that code can help the both of us!

Re: Thought Bubbles or something similar for Interior Monologue

Posted: Wed Jun 08, 2022 11:14 pm
by zmook
Okay, you can use ConditionSwitches if you want, but I've usually found simple 'if' statements easier to work with:

Code: Select all

screen say(who, what, thoughtbubble=False):
    # Character keyword arguments beginning with "show_" have the prefix stripped off, 
    # and are passed to the screen as arguments.
    style_prefix "say"

    window:
        id "window"
        if thoughtbubble:
            background Frame("gui/thoughtbubble.png, xalign=0.5, yalign=1.0)
        else:
            background Frame("gui/textbox.png, xalign=0.5, yalign=1.0)

        if who is not None:
            window:
                id "namebox"
                style "namebox"
                text who id "who"

        text what id "what"

Re: Thought Bubbles or something similar for Interior Monologue

Posted: Thu Jun 09, 2022 12:48 pm
by lsf22
What exactly am I doing wrong with this code? @Zmook

Code: Select all

screen say(who, what, thoughtbubble=False):
    # Character keyword arguments beginning with "show_" have the prefix stripped off,
    # and are passed to the screen as arguments.
    style_prefix "say"

    window:
        id "window"
        if thoughtbubble:
            background Frame("gui/textbox2.png", xalign=0.5, yalign=1.0)
        else:
            background Frame("gui/textbox.png", xalign=0.5, yalign=1.0)

        if who is not None:
            window:
                id "namebox"
                style "namebox"
                text who id "who"

        text what id "what"

define e = Character("Eileen")
define et = Character("Eileen thoughts", thoughtbubble=True)

Re: Thought Bubbles or something similar for Interior Monologue

Posted: Thu Jun 09, 2022 1:06 pm
by Dark12ose
lsf22 wrote:
Thu Jun 09, 2022 12:48 pm
What exactly am I doing wrong with this code? @Zmook

Code: Select all

screen say(who, what, thoughtbubble=False):
    # Character keyword arguments beginning with "show_" have the prefix stripped off,
    # and are passed to the screen as arguments.
    style_prefix "say"

    window:
        id "window"
        if thoughtbubble:
            background Frame("gui/textbox2.png", xalign=0.5, yalign=1.0)
        else:
            background Frame("gui/textbox.png", xalign=0.5, yalign=1.0)

        if who is not None:
            window:
                id "namebox"
                style "namebox"
                text who id "who"

        text what id "what"

define e = Character("Eileen")
define et = Character("Eileen thoughts", thoughtbubble=True)
In your character define it should say show_thoughtbubble=True with the show_

And damn the ghosting textbox does happen :(

Re: Thought Bubbles or something similar for Interior Monologue

Posted: Thu Jun 09, 2022 2:39 pm
by zmook
Dark12ose wrote:
Wed Jun 08, 2022 4:50 pm
I did find this solution and it definitely hides the ghosting textbox but at the cost of no textbox transition happening unfortunately.
The only way I found to get BOTH working was to do manual change. (I'm VERY picky with what I want lol)
What textbox transition are you trying to use?

Re: Thought Bubbles or something similar for Interior Monologue

Posted: Thu Jun 09, 2022 6:19 pm
by Dark12ose
zmook wrote:
Thu Jun 09, 2022 2:39 pm
What textbox transition are you trying to use?
Just the default dissolve on config.window_show/hide_transition but, if I remember right, it does it with any type of transition. Was testing it out with different types of transition before when I first found the ghosting.

What it does with the custom textbox is the default textbox appears first with the dissolve/transition than the custom textbox appears abruptly replacing it hence when used "window hide" the custom textbox just appears without the transition.

Re: Thought Bubbles or something similar for Interior Monologue

Posted: Thu Jun 09, 2022 6:27 pm
by zmook
Dark12ose wrote:
Thu Jun 09, 2022 6:19 pm
What it does with the custom textbox is the default textbox appears first with the dissolve/transition than the custom textbox appears abruptly replacing it hence when used "window hide" the custom textbox just appears without the transition.
Oh, huh. I don't have a good answer for that one.

Does anyone know, is Ren'py doing some kind of awkward optimization here?

Re: Thought Bubbles or something similar for Interior Monologue

Posted: Thu Jun 09, 2022 6:46 pm
by Dark12ose
zmook wrote:
Thu Jun 09, 2022 6:27 pm
Does anyone know, is Ren'py doing some kind of awkward optimization here?
Should have wrote this in the previous post but this is actually what Renpy does in general even with it's own default textbox. You just don't see it since it replaces it with the same exact one in a split second. For some reason manually changing with ConditionSwitch is the only way I found so far that makes it NOT do it.

Re: Thought Bubbles or something similar for Interior Monologue

Posted: Sat Jun 11, 2022 4:45 pm
by lsf22
I have wondered how version 8 is going to affect the code, which says it adds support for Python 3. I'm still using 7.4.11 for my game.
As for the current condition switch code by @DarkRose, it works fine. One thing to consider if anyone is using this method is that you'll able to see that when if you escape the dialogue by going to another menu(eg. tutorial menu) during the thought bubble dialogue is that it will still be active.

Re: Thought Bubbles or something similar for Interior Monologue

Posted: Sat Jun 11, 2022 8:32 pm
by Dark12ose
lsf22 wrote:
Sat Jun 11, 2022 4:45 pm
I have wondered how version 8 is going to affect the code, which says it adds support for Python 3. I'm still using 7.4.11 for my game.
As for the current condition switch code by @DarkRose, it works fine. One thing to consider if anyone is using this method is that you'll able to see that when if you escape the dialogue by going to another menu(eg. tutorial menu) during the thought bubble dialogue is that it will still be active.
I'm currently using the version 8 and it still works perfectly fine so no worries there.

What do you mean by menu? Choice menu or a custom screen or something else? I never ran into a problem where a textbox stayed unless I forgot to place a $ tb = "normal". Are you using the way Zmook suggested or my first post? If you can, can you post the code and I'll try to figure out why it's doing that.

Re: Thought Bubbles or something similar for Interior Monologue

Posted: Mon Jul 11, 2022 12:35 pm
by lsf22
With the way my game was set up It ended up going back to normal once I add a $ tb = "normal" back to the method you showed @Dark12rose.

As for version 8 of Renpy I still have not used it yet, it does sound like a major change for Renpy.

Re: Thought Bubbles or something similar for Interior Monologue

Posted: Fri Jul 22, 2022 8:38 pm
by lsf22
Dark12ose wrote:
Wed Jun 08, 2022 3:35 pm
zmook wrote:
Wed Jun 08, 2022 11:41 am
FWIW, it's common practice to define a separate "character" to speak the interior thoughts, when you want them to have a different look.

Code: Select all

define mc = Character("Our hero")   # for normal dialog
define mct = Character("", show_thoughtbubble=True)   # main character thoughts

screen say(who, what, thoughtbubble=False):
    # Character keyword arguments beginning with "show_" have the prefix stripped off, 
    # and are passed to the screen as arguments.
    style_prefix "say"
    
    window:
        style window:
        	background ConditionSwitch(
		        "thoughtbubble", Frame("gui/thoughtbubble.png, xalign=0.5, yalign=1.0)
	        	"True", Frame("gui/textbox.png, xalign=0.5, yalign=1.0),
	                )


label start:
	mc "The dialogue box is a regular box."
	mct "Now the dialogue box is my inner thought bubble."

Hmm the textbox doesn't seem to appear. Just uses the default textbox.

This would be nice if it works as it will save a whole lot of typing and confusion but one question. When the mct is the first speaker in a scene change is there a ghosting of the default textbox before the custom textbox appear?

I was having that problem when I was using the "window_background" in the Character() and using this method for automatic textbox change hence I just suggested manual change with ConditionSwitch.
So I started another test and for some reason the frame is using a width much bigger than what I created the textbox resolution size to. It happens when the condition switch code in effect

Textbox actual resolution size is at 1140x260

Is there some argument I can place within it to display a different size?

Code: Select all

[code]style window:
    background ConditionSwitch(
    "tb == 'normal'", Frame("gui/textbox.png", xalign=0.5, yalign=1.0),
    "tb == 'thoughtbubble'", Frame("gui/textbox_thought.png", xalign=0.5, yalign=1.0)
    )
[/code]

I have attached some example images of it.

Re: Thought Bubbles or something similar for Interior Monologue

Posted: Fri Jul 22, 2022 8:51 pm
by Dark12ose
Instead of Frame() use Image(). Frame() will adjust the size of the textbox while Image() keeps it the same size no mater what.

Re: Thought Bubbles or something similar for Interior Monologue

Posted: Sun Jul 24, 2022 4:57 am
by lsf22
Thanks, I got my dialogue box to where I wanted it to be