Thought Bubbles or something similar for Interior Monologue

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
lsf22
Regular
Posts: 143
Joined: Wed Feb 23, 2022 9:43 pm
Contact:

Thought Bubbles or something similar for Interior Monologue

#1 Post 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.
Last edited by lsf22 on Wed Jun 08, 2022 4:47 pm, edited 1 time in total.

User avatar
Zelan
Lemma-Class Veteran
Posts: 2436
Joined: Tue Mar 01, 2016 7:23 pm
Completed: The Dark
Projects: Cosplay Couple
Tumblr: evns
itch: Zelan
Discord: ltnkitsuragi#7082
Contact:

Re: Thought Bubbles or something similar for Interior Monologue

#2 Post 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.

User avatar
bonnie_641
Regular
Posts: 140
Joined: Sat Jan 13, 2018 10:57 pm
Projects: Código C.O.C.I.N.A.
Deviantart: rubymoonlily
Contact:

Re: Thought Bubbles or something similar for Interior Monologue

#3 Post 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
I speak and write in Spanish. I use an English-Spanish translator to express myself in this forum. If I make any mistakes, please forgive me.
I try my best to give an answer according to your question. :wink:

User avatar
lsf22
Regular
Posts: 143
Joined: Wed Feb 23, 2022 9:43 pm
Contact:

Re: Thought Bubbles or something similar for Interior Monologue

#4 Post 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?
Attachments
Screenshot example 3 with thought bubble
Screenshot example 3 with thought bubble
Italics
Italics
Plain Text
Plain Text
Thought bubble example 2
Thought bubble example 2

User avatar
Dark12ose
Regular
Posts: 63
Joined: Mon Oct 04, 2021 11:29 pm
Deviantart: Rosentear
Contact:

Re: Thought Bubbles or something similar for Interior Monologue

#5 Post 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!
Last edited by Dark12ose on Wed Jun 08, 2022 3:23 am, edited 2 times in total.
Note: My mind can be all over the place while I'm writing as I think. If what you read is unclear do tell it to my face :lol:

User avatar
lsf22
Regular
Posts: 143
Joined: Wed Feb 23, 2022 9:43 pm
Contact:

Re: Thought Bubbles or something similar for Interior Monologue

#6 Post 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.

User avatar
lsf22
Regular
Posts: 143
Joined: Wed Feb 23, 2022 9:43 pm
Contact:

Re: Thought Bubbles or something similar for Interior Monologue

#7 Post 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"

User avatar
Dark12ose
Regular
Posts: 63
Joined: Mon Oct 04, 2021 11:29 pm
Deviantart: Rosentear
Contact:

Re: Thought Bubbles or something similar for Interior Monologue

#8 Post 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.
Note: My mind can be all over the place while I'm writing as I think. If what you read is unclear do tell it to my face :lol:

User avatar
lsf22
Regular
Posts: 143
Joined: Wed Feb 23, 2022 9:43 pm
Contact:

Re: Thought Bubbles or something similar for Interior Monologue

#9 Post 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

User avatar
Dark12ose
Regular
Posts: 63
Joined: Mon Oct 04, 2021 11:29 pm
Deviantart: Rosentear
Contact:

Re: Thought Bubbles or something similar for Interior Monologue

#10 Post 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.
Note: My mind can be all over the place while I'm writing as I think. If what you read is unclear do tell it to my face :lol:

User avatar
zmook
Veteran
Posts: 421
Joined: Wed Aug 26, 2020 6:44 pm
Contact:

Re: Thought Bubbles or something similar for Interior Monologue

#11 Post 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."

colin r
➔ if you're an artist and need a bit of help coding your game, feel free to send me a PM

User avatar
Dark12ose
Regular
Posts: 63
Joined: Mon Oct 04, 2021 11:29 pm
Deviantart: Rosentear
Contact:

Re: Thought Bubbles or something similar for Interior Monologue

#12 Post 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.
Note: My mind can be all over the place while I'm writing as I think. If what you read is unclear do tell it to my face :lol:

User avatar
lsf22
Regular
Posts: 143
Joined: Wed Feb 23, 2022 9:43 pm
Contact:

Re: Thought Bubbles or something similar for Interior Monologue

#13 Post 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

User avatar
zmook
Veteran
Posts: 421
Joined: Wed Aug 26, 2020 6:44 pm
Contact:

Re: Thought Bubbles or something similar for Interior Monologue

#14 Post 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.
colin r
➔ if you're an artist and need a bit of help coding your game, feel free to send me a PM

User avatar
zmook
Veteran
Posts: 421
Joined: Wed Aug 26, 2020 6:44 pm
Contact:

Re: Thought Bubbles or something similar for Interior Monologue

#15 Post 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
colin r
➔ if you're an artist and need a bit of help coding your game, feel free to send me a PM

Post Reply

Who is online

Users browsing this forum: Bing [Bot]