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.
I'm a complete coding newbie, so I apologize in advance if these questions have an unreasonably simple solution.
Here's what I'm trying to do:
1. Have lines of dialogue (or narration) play at different speeds, and/or have part of the dialogue/narration play at normal speed, pause, then play the rest of the dialogue.
For example:
"What's going on? (pause 0.5)
What's. (pause 1.5) Going. (pause 1.5) On?!?"
OR
"Hello, everyone! (pause)
...How was your summer?"
SOLVED! Thanks, Imperf3kt.
2. Similar to the above, have dialogue play at normal speed, pause, play a sound effect, then have dialogue finish at normal speed once the sound effect ends.
I hope all of this makes sense! I would truly appreciate if someone can help out.
SOLVED! Thanks, philat.
Last edited by Offworlder on Sat Sep 15, 2018 9:28 pm, edited 5 times in total.
Thank you so much for your quick response!
I couldn't get "$pause" to work properly. But with a bit of tweaking, just using "{w=}" in its place works like a charm!
I'm unfortunately not seeing where the link you sent shows how to have a sound play before dialogue completes, followed by the rest of the dialogue after it completes (without clicking)...It's absolutely possible I just overlooked it, or merely don't understand.
On a separate note, I can't actually...seem to get sounds to play. I made a folder called "sfx" and placed a ".ogg" file in it, then used the code "play sound", followed by the name of the sound file in quotes. However, I keep getting an error stating that Ren'py can't find the sound file. "sfx" clearly shows in Atom under "images", "gui", etc. I'm not sure what I'm doing wrong...
EDIT: Oh! I also meant to say that my examples were purely made up for this thread. Especially after testing it out, I agree 100% that 1.5 seconds is excruciatingly long. xD
Whoops! Didn't realize I had to define anything. x_x
With your suggestion, I ended up just changing the statement to " play sound "sfx/DinnerBell.ogg" " and it worked perfectly!
This bit isn't quite working for what I'm trying to do, though:
"3...{w=1.0}2...{w=1.0}1{w=1.0}{nw}"
play sound "kaboom.ogg"
"3...{w=1.0}2...{w=1.0}1{w=1.0}{fast} BANG!"
[/quote]
It actually ALMOST works. The first part of the text plays, then the sound plays, then BANG plays (with no clicks necessary throughout). However, BANG plays at the same time as the sound. I'm wanting the sound to play, then BANG right after. I tried playing around with the code a bit, but I still couldn't figure it out. I apologize for all of the trouble!
YES! That's exactly what I was looking for!
I have just one final issue, now that you've figured out all the necessary starts and stops:
This is supposed to happen in the middle of a character's dialogue. However, once the sound starts playing, it removes the character's name/turns into narration.
If I add the character tag at the start of the line that contains "BANG", it leaves the name but requires a click to get there.
The "fast" tag seems to be extremely important in this case. Without it, "3...2...1" repeats when the sound plays, and "BANG" takes much longer to show up.
No worries about being unsure how to resolve the last issue. I'm extremely grateful for all of the help you were able to provide! Thanks to you, I'm one step away from everything working exactly as I envisioned. :3
There is one other way, but I am unfamiliar with it.
You can use the sound file with a delayed start and place it before the line of dialog, or another option is to enqueue a playlist with some silence at the start.
I'm not at my PC right now, or I'd give you an example.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Having a delayed start for the sound is a great suggestion!
Unfortunately, I don't think it'll work for what I'm trying to do. Unless I'm misunderstanding, I assume the idea would be to have X seconds of delay after the sound is inserted. If that's the case, the pacing will be off depending on how fast the player reads.
You are absolutely brilliant, Philat! The code worked perfectly. ^.^
The two of you have answered all my questions. Undoubtedly, my project will be better because of it! Thank you so much for helping out.