Dialogue speed preview

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
Gazza
Newbie
Posts: 24
Joined: Wed Sep 19, 2018 5:18 pm
Contact:

Dialogue speed preview

#1 Post by Gazza »

Hi, it's me again

how do i code a text speed preview (https://i.imgur.com/ViS3aMZ.png) like the one shown here? I found a relevant thread (viewtopic.php?f=8&t=57516), but i don't understand how to pass the current speed in the slider to the text and update it in "real time"

thank you very much for your patience!


Gazza
Newbie
Posts: 24
Joined: Wed Sep 19, 2018 5:18 pm
Contact:

Re: Dialogue speed preview

#3 Post by Gazza »

oh yeah, i tried that one, but i wanted to stay on the screen and repeat itself after a period of time

User avatar
Andredron
Miko-Class Veteran
Posts: 719
Joined: Thu Dec 28, 2017 2:37 pm
Location: Russia
Contact:

Re: Dialogue speed preview

#4 Post by Andredron »

Wanda Siren wrote: Sun Dec 22, 2019 1:23 pm
oh yeah, i tried that one, but i wanted to stay on the screen and repeat itself after a period of time


Add in Time

Code: Select all

..... 
.... while:
........timer... 
Not the fact that I wrote correctly, I did not do this


https://o7planning.org/ru/11387/loops-in-python

Gazza
Newbie
Posts: 24
Joined: Wed Sep 19, 2018 5:18 pm
Contact:

Re: Dialogue speed preview

#5 Post by Gazza »



Add in Time

Code: Select all

..... 
.... while:
........timer... 
I'm sorry, i don't understand, where should i place the while loop and the timer in the code?

User avatar
Andredron
Miko-Class Veteran
Posts: 719
Joined: Thu Dec 28, 2017 2:37 pm
Location: Russia
Contact:

Re: Dialogue speed preview

#6 Post by Andredron »

Wanda Siren wrote: Sun Dec 22, 2019 5:33 pm

I'm sorry, i don't understand, where should i place the while loop and the timer in the code?
Yes,

Code: Select all

 
screen preference:
    frame:
        align 0.5
        
        while:
            timer 2.0 action Hide("text_test")
            timer 5.0 action Show("text_test")
Or write a function. But now I’m writing from the phone, without a PC it’s hard for me to remember what

Gazza
Newbie
Posts: 24
Joined: Wed Sep 19, 2018 5:18 pm
Contact:

Re: Dialogue speed preview

#7 Post by Gazza »

Code: Select all

 
screen preference:
    frame:
        align 0.5
        
        while:
            timer 2.0 action Hide("text_test")
            timer 5.0 action Show("text_test")
Or write a function. But now I’m writing from the phone, without a PC it’s hard for me to remember what
sorry to bother again, but the code always gives me an error; if a put it in a function the "timer" givers me an error, if i don't the "while" loop gives me an error

i'm a little stumped

User avatar
RicharDann
Veteran
Posts: 286
Joined: Thu Aug 31, 2017 11:47 am
Contact:

Re: Dialogue speed preview

#8 Post by RicharDann »

You might not need to use a while loop, you can just set the timer property repeat to True, so that it effectively loops:

Code: Select all

    timer 2.0 repeat True action Show("text_test")
    timer 5.0 repeat True action Hide("text_test")
The most important step is always the next one.

Gazza
Newbie
Posts: 24
Joined: Wed Sep 19, 2018 5:18 pm
Contact:

Re: Dialogue speed preview

#9 Post by Gazza »

RicharDann wrote: Tue Dec 24, 2019 10:11 am You might not need to use a while loop, you can just set the timer property repeat to True, so that it effectively loops:

Code: Select all

    timer 2.0 repeat True action Show("text_test")
    timer 5.0 repeat True action Hide("text_test")
It works, but is there a way to have the text always showing, wihout hiding the screen?

User avatar
RicharDann
Veteran
Posts: 286
Joined: Thu Aug 31, 2017 11:47 am
Contact:

Re: Dialogue speed preview

#10 Post by RicharDann »

From my understanding, this method works precisely because the text is being removed and then shown again. This is because slow text is designed to displayed only once per screen, since it's intended use is for dialogue, so there's no way to "reset" it without hiding it first that I know of.

What you can do is reduce the amount of seconds both timers wait so the removal is less noticeable to the player, but I think if it's set too low, it might not give a chance to see the effect if the text is too long. Might have to experiment with that.
The most important step is always the next one.

Gazza
Newbie
Posts: 24
Joined: Wed Sep 19, 2018 5:18 pm
Contact:

Re: Dialogue speed preview

#11 Post by Gazza »

RicharDann wrote: Thu Dec 26, 2019 10:04 am From my understanding, this method works precisely because the text is being removed and then shown again. This is because slow text is designed to displayed only once per screen, since it's intended use is for dialogue, so there's no way to "reset" it without hiding it first that I know of.
yeah, my question was more about how the guy in the first post i linked was able to refresh the screen without hiding it, it's seemed complicated

but i'll go with this route, thank you very much for your help!

Post Reply

Who is online

Users browsing this forum: Google [Bot], Sugar_and_rice