[Solved] Pausing between sentences?

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
User avatar
siolia
Newbie
Posts: 11
Joined: Mon Apr 15, 2019 9:55 pm
Projects: Oraclos
Location: United States
Contact:

[Solved] Pausing between sentences?

#1 Post by siolia »

Oh geez oh man, I hope this is right.
I'm wondering if there is a way to have cps pause at end of sentence markers like periods, exclamation points, and question marks. The idea that I'm thinking of right now is to slow the cps down at the spaces between the sentences, but that's a lot of work you know? Is there a way to streamline this so it recognizes the character and changes the speed always?

Sorry if this is a dumb question :cry:
Last edited by siolia on Tue May 21, 2019 11:20 pm, edited 1 time in total.

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: Pausing between sentences?

#2 Post by isobellesophia »

I am a friendly user, please respect and have a good day.


Image

Image


User avatar
siolia
Newbie
Posts: 11
Joined: Mon Apr 15, 2019 9:55 pm
Projects: Oraclos
Location: United States
Contact:

Re: Pausing between sentences?

#3 Post by siolia »

Oh! That really helps! Thanks!

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: Pausing between sentences?

#4 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.25: [', ', '; '], # quarter second pause for these
            0.5: ['. ', '? ', '! ', ': '] # half second for these
          }.items() 
          for n in v ], t )
Frameworks & Scriptlets:

Post Reply

Who is online

Users browsing this forum: Bing [Bot]