Automatically adding pauses to accentuate dialogue?

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.
Post Reply
Message
Author
StValentines
Regular
Posts: 37
Joined: Mon Aug 26, 2019 2:08 am
Projects: St. Valentine's Academy for Magical Girls
Contact:

Automatically adding pauses to accentuate dialogue?

#1 Post by StValentines »

Just to try it, I added small pauses at commas and at the end of sentences, similar to how games like Phoenix Wright add tone and pacing to their dialogue. We decided we wanted to go with that for all the game's dialogue, and seriously, it reads so well, we love it.

But of course, I'm the one who has to code it in, which means going through all the dialogue as I write it to add {w=0.1} after every single spoken comma, {w=0.3} after every spoken sentence, etc. It's kind of a pain, and this game is looking like it's going to be very, very long.

So I'm wondering, is there a way to adjust the code in the game so it automatically applies these brief pauses in dialogue? Perhaps automatic, defined wait times after the appropriate punctuation and a space within quotation marks? I'd still add anything more complex or specific into the dialogue itself, of course, but even just specific pauses after every comma, period, and ellipsis would be amazing and save me so much time.

tl;dr: I'm adding stylized pauses in my dialogue and would enjoy some code that presents it that way automatically.

User avatar
isobellesophia
Miko-Class Veteran
Posts: 979
Joined: Mon Jan 07, 2019 2:55 am
Completed: None
Projects: Maddox and Friends! (AI Teacher friend), Friendly Universities! (Soon)
Organization: Friendly Teachers series
Deviantart: SophBelle
itch: Child Creation
Location: Philippines, Mindanao
Contact:

Re: Automatically adding pauses to accentuate dialogue?

#2 Post by isobellesophia »

StValentines wrote: Mon Sep 09, 2019 4:56 pm Just to try it, I added small pauses at commas and at the end of sentences, similar to how games like Phoenix Wright add tone and pacing to their dialogue. We decided we wanted to go with that for all the game's dialogue, and seriously, it reads so well, we love it.

But of course, I'm the one who has to code it in, which means going through all the dialogue as I write it to add {w=0.1} after every single spoken comma, {w=0.3} after every spoken sentence, etc. It's kind of a pain, and this game is looking like it's going to be very, very long.

So I'm wondering, is there a way to adjust the code in the game so it automatically applies these brief pauses in dialogue? Perhaps automatic, defined wait times after the appropriate punctuation and a space within quotation marks? I'd still add anything more complex or specific into the dialogue itself, of course, but even just specific pauses after every comma, period, and ellipsis would be amazing and save me so much time.

tl;dr: I'm adding stylized pauses in my dialogue and would enjoy some code that presents it that way automatically.
Maybe you are reffering into this

viewtopic.php?t=43009#p447324
I am a friendly user, please respect and have a good day.


Image

Image


StValentines
Regular
Posts: 37
Joined: Mon Aug 26, 2019 2:08 am
Projects: St. Valentine's Academy for Magical Girls
Contact:

Re: Automatically adding pauses to accentuate dialogue?

#3 Post by StValentines »

isobellesophia wrote: Mon Sep 09, 2019 10:59 pm
Maybe you are reffering into this

viewtopic.php?t=43009#p447324
Pretty much!

Unfortunately the consensus from that basically came down to "use find/replace functions," which doesn't quite serve my purposes since a universal find/replace would apply itself to narration as well, not just dialogue.

But it did inspire me to use the text editor's find/replace, which doesn't eliminate the workload but significantly reduces it. I'll consider that a win! Thanks.

philat
Eileen-Class Veteran
Posts: 1912
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: Automatically adding pauses to accentuate dialogue?

#4 Post by philat »

Actually you can use config.say_menu_text_filter instead of config.replace_text and it will work.

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Automatically adding pauses to accentuate dialogue?

#5 Post by Remix »

Code: Select all

define config.say_menu_text_filter = lambda t: reduce(
        lambda t, p: t.replace(p[0], p[1]), 
        [ (n,"{}{{w={}}}".format(n,m)) for m,v in 
          { 
            0.1: [', ', '; '], # one tenth second pause for these (comma and semi-colon)
            0.3: ['. ', '? ', '! ', ': '] # three tenths second for these (period, question/exclamation mark and colon) 
          }.items() 
          for n in v ], t )
Might be confusing... It basically uses the dictionary to add {w=time} tags after occurrences of the characters (with a space after themselves) in say text.
Frameworks & Scriptlets:

Post Reply

Who is online

Users browsing this forum: Bing [Bot], FAST WebCrawler [Crawler], Google [Bot]