Page 1 of 2

Thought Bubbles or something similar for Interior Monologue

Posted: Tue Apr 19, 2022 11:14 am
by lsf22
I want to be able to show a character thinking or speaking inside their head. Can this be done easily? For example I've used Italics but sometimes it doesn't look strong enough for players to see the difference from plain text, since italics are used to convey "Interior Monologue".

One of my guesses is would I need to create speech bubble dialogue box? What that require some style prefixes to work with on doing that? Or is there actually a simple solution?

Many of you have seen when a character is not actively speaking but is conveying their inner thoughts (internal monologue) to the viewers by using some sort of means which is usually a thought bubble in video games, VN's comics. And in other mediums there is the boxy sound effect to their voice for the viewers to understand it's their thoughts.

Example of a thought bubble
Image

This is a nice writer's reference on why we might use inner monologues
https://www.nownovel.com/blog/inner-mon ... in-novels/

As it seems is that Ren'py does not have a quick and easy solution to this which requires some extra code to get the job done. I wan't to the players to be able to understand and see clearly that the characters are having a internal monologue (thoughts) when it occurs in my VN. Italics alone is not enough because some of the fonts I use do not have a strong italic display, so it ends up looking like regular dialogue. Therefore the player ends up thinking the character is actively talking.

While you can write in *Thinking to himself/herself or *while thinking *, that tends to not be attractive all the time and it's certainly not what I want in my way of writing. Especially when you want a certain impact from your dialogue or focus on words

For anyone wanting to accomplish the same I hope this thread will help you out as well.

Re: Thought Bubbles or something similar for Interior Monologue

Posted: Tue Apr 19, 2022 11:30 am
by Zelan
I'm not really sure what the difference is between "a character thinking or speaking inside their head" and "interior monologue," to me these are the same thing and I think it would feel unnecessary or confusing to use thought bubbles.

Regardless, if you're still wanting to look into it: I'm not a programmer, but Where the Sun Always Shines uses speech bubbles. Maybe looking at this code will give you an idea of how it would work? This game is from an older version of Ren'Py though, so this way may not work now, or there may be a more efficient way to do what you want.

Re: Thought Bubbles or something similar for Interior Monologue

Posted: Tue Apr 19, 2022 4:50 pm
by bonnie_641
lsf22 wrote: Tue Apr 19, 2022 11:14 am I want to be able to show a character thinking or speaking inside their head. Can this be done easily? For example I've used Italics but sometimes it doesn't look strong enough for players to see the difference from plain text, since italics are used to convey "Interior Monologue".
One of my guesses is would I need to create speech bubble dialogue box? What that require some style prefixes to work with on doing that? Or is there actually a simple solution?
Remix gave the answer a long time ago:
https://github.com/RenpyRemix/speech-bubbles

I hope you find it helpful :D

Re: Thought Bubbles or something similar for Interior Monologue

Posted: Sun Apr 24, 2022 11:03 am
by lsf22
What I was looking for was something like what I have attached for image examples. Because If I just do the italics to convey internal thoughs/speech/internal monologue or whatever you want to call it, it doesn't look like italics or like a inner though with some of the fonts we might use with our projects. Is it easy to implement a second dialogue window type for those inner thought dialogues?


As you can see from renpy screenshot 1 and 2 the italics sometimes isn't enough of a difference for that.

I made a third example with a thought bubble. Would I be able to easily switch and use that for dialogue when needed?

Re: Thought Bubbles or something similar for Interior Monologue

Posted: Sun Apr 24, 2022 6:21 pm
by Dark12ose
You can switch between dialogue boxes/textboxs using ConditionSwitch in say screen under style window.
https://www.renpy.org/doc/html/displaya ... tionSwitch

for example:

Code: Select all

style window:
	background ConditionSwitch(
		"tb == 'normal'", Frame("gui/textbox.png", xalign=0.5, yalign=1.0),
		"tb == 'thoughtbubble'", Frame("gui/thoughtbubble.png", xalign=0.5, yalign=1.0)
	)
Than in your script:

Code: Select all

define tb = "normal"  ## Place this BEFORE label start so that Ren'py knows what's the default dialogue box is.

label start:
	e "The dialogue box is a regular box."
	$ tb = "thoughtbubble"
	e "Now the dialogue box is my inner thought bubble."
	$ tb = "normal"
	e "Now it's back to the default dialogue box."
The "tb" and "normal"/"thoughtbubble" can be named whatever you want. As for the x/yalign, make sure you have this or else your dialogue box will be placed somewhere else. The numbers are the default placement and can be changed depending where you want your textbox location to be.

I hope this is what you are looking for!

Re: Thought Bubbles or something similar for Interior Monologue

Posted: Tue Apr 26, 2022 11:41 am
by lsf22
Dark12ose wrote: Sun Apr 24, 2022 6:21 pm You can switch between dialogue boxes/textboxs using ConditionSwitch in say screen under style window.
https://www.renpy.org/doc/html/displaya ... tionSwitch

for example:

Code: Select all

style window:
	background ConditionSwitch(
		"tb = 'normal'", Frame("gui/textbox.png, xalign=0.5, yalign=1.0),
		"tb = 'thoughtbubble'", Frame("gui/thoughtbubble.png, xalign=0.5, yalign=1.0)
	)
Than in your script:

Code: Select all

define tb = "normal"  ## Place this BEFORE label start so that Ren'py knows what's the default dialogue box is.

label start:
	e "The dialogue box is a regular box."
	$ tb = "thoughtbubble"
	e "Now the dialogue box is my inner thought bubble."
	$ tb = "normal"
	e "Now it's back to the default dialogue box."
The "tb" and "normal"/"thoughtbubble" can be named whatever you want. As for the x/yalign, make sure you have this or else your dialogue box will be placed somewhere else. The numbers are the default placement and can be changed depending where you want your textbox location to be.

I hope this is what you are looking for!
Yes, Thank you. I believe this is what I was looking for.

Re: Thought Bubbles or something similar for Interior Monologue

Posted: Tue Jun 07, 2022 5:29 pm
by lsf22
lsf22 wrote: Tue Apr 26, 2022 11:41 am
Dark12ose wrote: Sun Apr 24, 2022 6:21 pm You can switch between dialogue boxes/textboxs using ConditionSwitch in say screen under style window.
https://www.renpy.org/doc/html/displaya ... tionSwitch

for example:

Code: Select all

style window:
	background ConditionSwitch(
		"tb = 'normal'", Frame("gui/textbox.png, xalign=0.5, yalign=1.0),
		"tb = 'thoughtbubble'", Frame("gui/thoughtbubble.png, xalign=0.5, yalign=1.0)
	)
Than in your script:

Code: Select all

define tb = "normal"  ## Place this BEFORE label start so that Ren'py knows what's the default dialogue box is.

label start:
	e "The dialogue box is a regular box."
	$ tb = "thoughtbubble"
	e "Now the dialogue box is my inner thought bubble."
	$ tb = "normal"
	e "Now it's back to the default dialogue box."
The "tb" and "normal"/"thoughtbubble" can be named whatever you want. As for the x/yalign, make sure you have this or else your dialogue box will be placed somewhere else. The numbers are the default placement and can be changed depending where you want your textbox location to be.

I hope this is what you are looking for!
Yes, Thank you. I believe this is what I was looking for.
I'm getting this error for that code "Tab characters are not allowed in Ren'py scripts"

Re: Thought Bubbles or something similar for Interior Monologue

Posted: Tue Jun 07, 2022 6:30 pm
by Dark12ose
lsf22 wrote: Tue Jun 07, 2022 5:29 pm I'm getting this error for that code "Tab characters are not allowed in Ren'py scripts"
Don't copy and paste the code. Seems like that's the problem as it's not registering the indentation correctly. Tried copy and paste myself and I was getting the same error. Write it down manually and that should fix the problem.

I also just realized I forgot to put quotation marks in certain part of the code *facepalm* Should fix that.

Re: Thought Bubbles or something similar for Interior Monologue

Posted: Tue Jun 07, 2022 7:23 pm
by lsf22
I'm getting syntax errors now

edit: I added an = sign in the code for "tb == 'normal' " and "tb == 'thoughtbubble' " for it to work. At least I hope it works right fully

Re: Thought Bubbles or something similar for Interior Monologue

Posted: Wed Jun 08, 2022 3:22 am
by Dark12ose
lsf22 wrote: Tue Jun 07, 2022 7:23 pm I'm getting syntax errors now

edit: I added an = sign in the code for "tb == 'normal' " and "tb == 'thoughtbubble' " for it to work. At least I hope it works right fully
*facepalm again* Yes, there should be a double = there. Sorry.

Re: Thought Bubbles or something similar for Interior Monologue

Posted: Wed Jun 08, 2022 11:41 am
by zmook
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."


Re: Thought Bubbles or something similar for Interior Monologue

Posted: Wed Jun 08, 2022 3:35 pm
by Dark12ose
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.

Re: Thought Bubbles or something similar for Interior Monologue

Posted: Wed Jun 08, 2022 4:06 pm
by lsf22
I tried the code you supplied @zmook , but it seems like it's missing quotations and indented wrong. I'm not familiar with conditon switches at all, but the code you shared isn't working for me

Re: Thought Bubbles or something similar for Interior Monologue

Posted: Wed Jun 08, 2022 4:26 pm
by zmook
Oh, sorry, my code is pasted together from a couple different source, not tested. At a minimum, I didn't include a full copy of the 'say' screen, just enough to show how to pass an argument. Sorry if I got the syntax for ConditionSwitch wrong. I'll fix it later if I get a chance, no time right now.

Re: Thought Bubbles or something similar for Interior Monologue

Posted: Wed Jun 08, 2022 4:33 pm
by zmook
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