Play Audio THEN Show Dialog

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
bDunks
Newbie
Posts: 21
Joined: Tue Jan 08, 2019 3:07 pm
Contact:

Play Audio THEN Show Dialog

#1 Post by bDunks »

Right now I am trying to play a sound, then have dialog show up after. Not both at the same time.

I would like it to go like this.

Code: Select all

voice "sound/monster.mp3" #plays scary sound

b "What was that?!!!" #When audio completes, b says this.
Is there a way to do this without pause x?
Thank you. :)
Last edited by bDunks on Tue Jan 08, 2019 11:53 pm, edited 1 time in total.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3794
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Play Audio THEN Show Dialog

#2 Post by Imperf3kt »

Use the pause statement

Code: Select all

    play sound "sound/monster.mp3"
    $pause(1)
    b "What was that?"
Adjust the number in the pause statement to adjust the wait time in seconds. So, for example, two and a half seconds would be $pause(2,5)
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

bDunks
Newbie
Posts: 21
Joined: Tue Jan 08, 2019 3:07 pm
Contact:

Re: Play Audio THEN Show Dialog

#3 Post by bDunks »

Imperf3kt wrote: Tue Jan 08, 2019 11:23 pm Use the pause statement

Code: Select all

    play sound "sound/monster.mp3"
    $pause(1)
    b "What was that?"
Adjust the number in the pause statement to adjust the wait time in seconds. So, for example, two and a half seconds would be $pause(2,5)
Oops!
Forgot to put in the question how to do this without pause.
Have edited the post.
I guess now the more I think on it, it's not a big deal to do it this way.
Thank you.

It seems that this only works properly.

Code: Select all

    play sound "sound/monster.mp3" #or voice "sound/monster.mp3"
    $ renpy.pause(1)
    b "What was that?"

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3794
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Play Audio THEN Show Dialog

#4 Post by Imperf3kt »

I haven't used pause in a long time. It may be Pause instead (capital P)

If you wish to avoid using pause, you can achieve a similar result with the wait text tag

Code: Select all

    play sound "mysound.mp3"
    b "{w=1.0}What was that?" 
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

bDunks
Newbie
Posts: 21
Joined: Tue Jan 08, 2019 3:07 pm
Contact:

Re: Play Audio THEN Show Dialog

#5 Post by bDunks »

Imperf3kt wrote: Wed Jan 09, 2019 12:40 am I haven't used pause in a long time. It may be Pause instead (capital P)

If you wish to avoid using pause, you can achieve a similar result with the wait text tag

Code: Select all

    play sound "mysound.mp3"
    b "{w=1.0}What was that?" 
I had not seen that yet.
Thank you! :)

Post Reply

Who is online

Users browsing this forum: Semrush [Bot], voluorem