[SOLVED] Extending... Character 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
User avatar
Shocking Alberto
Regular
Posts: 35
Joined: Sun Mar 29, 2020 4:58 am
Contact:

[SOLVED] Extending... Character Dialog

#1 Post by Shocking Alberto »

I'm trying out a couple ideas in order to do more with character dialog. The idea is fairly simple: Have a character appear and in the middle of the text block, their expression changes. What makes this slightly trickier is making the whole thing automatic at the point of the expression change while also having voice playback.

Here's what I've tried:

Code: Select all

show char normal
voice "char_voice_01"
char "I am saying some things "
extend " but I will smile as well!"
show char smile
In practice, this works just fine except it requires user input to get the second half of the text and expression transition. A second choice is using {nw}:

Code: Select all

show char normal
voice "char_voice_01"
char "I am saying some things{nw}"
" but I will smile as well!"
show char smile
Unfortunately, using {nw} won't automatically advance the text so long as the voice clip is playing which somewhat defeats the purpose of trying this. Another problem with this option is that since I have it set up so that a voiced line will be highlighted in history, only the first half of the line is highlighted which makes things look a bit weird.

I'm debating some workarounds, such as splitting up the voice file and sticking with using extend or maybe not even bothering with this effort but I'd appreciate any suggestions or advice from everyone. o/
Last edited by Shocking Alberto on Fri Sep 03, 2021 7:34 pm, edited 1 time in total.

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

Re: Extending... Character Dialog

#2 Post by Imperf3kt »

For this you'd actually want to use ATL instead of extend, I believe.
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

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: Extending... Character Dialog

#3 Post by Remix »

You could try voice sustain with the {nw}... untested

Code: Select all

show char normal
voice "char_voice_01"
char "I am saying some things {nw}"

show char smile
voice sustain
extend " but I will smile as well!"
Not sure how you'd do the history bit though (tbh I thought extend would handle that itself)
Frameworks & Scriptlets:

User avatar
Shocking Alberto
Regular
Posts: 35
Joined: Sun Mar 29, 2020 4:58 am
Contact:

Re: Extending... Character Dialog

#4 Post by Shocking Alberto »

Shoot, I don't know how I missed these responses.

Re: ATL
Hmm... Okay. Guess I'll need to see what I can use to do what I want to do. Appreciate you pointing me in a direction. '-')/

Re: voice sustain
Unfortunately, the result is the same where nothing transitions until the voice clip plays. Thanks for the suggestion though!

User avatar
Shocking Alberto
Regular
Posts: 35
Joined: Sun Mar 29, 2020 4:58 am
Contact:

Re: Extending... Character Dialog

#5 Post by Shocking Alberto »

Imperf3kt, you were right about using ATL. Works like a charm!

The only caveat is that the solution will require a good bit of coding in order to initialize everything as well as checking the voice timing so that the sprites switch at the right time among other things but it works. I probably should've turned on notifications next time so I'm not figuring this out a year later ahahah...

User avatar
Shocking Alberto
Regular
Posts: 35
Joined: Sun Mar 29, 2020 4:58 am
Contact:

Re: [SOLVED] Extending... Character Dialog

#6 Post by Shocking Alberto »

So I did find one flaw from using ATL versus extend.

Let's say we have a sequence where the character sprite changes midway through a voiced line:

Code: Select all

image scene01_char_a_01:
	"images/char_a/char a neutral.png"
	pause 1.0
	"images/char_a/char a happy.png"

Code: Select all

show scene01_char_a_01
voice "char_a_01"
char_a "My face is neutral. But then you said something and now I am happy."
Here, char a neutral.png would appear while the voice portion of "My face is neutral" is spoken, then switch to char a happy.png for the rest. Works fine if you don't skip around but if you decide to skip and not listen to the full clip, the transition to char a happy.png will happen anyway regardless if you skipped or not. This may not necessarily be noticeable with a 1 sec. pause but if you had a longer pause and had some other character sprite expression change soon after, the last line in the ATL sequence will trigger which will lead to some odd effects.

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

Re: [SOLVED] Extending... Character Dialog

#7 Post by Imperf3kt »

For that, you may need to add a hard pause, so the player cannot skip it. Probably want to link it to a settings option though, so the player can decide whether they want to be able to skip or not.
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

User avatar
Shocking Alberto
Regular
Posts: 35
Joined: Sun Mar 29, 2020 4:58 am
Contact:

Re: [SOLVED] Extending... Character Dialog

#8 Post by Shocking Alberto »

Fair point but I think for this project I'm working on, it will definitely ruin the pace to have to use hard pauses. After thinking about it over the weekend, the best solution I found was to insert the last character sprite change in the ATL sequence right after so even if a user skips through, the character will change expression anyway. Kinda redundant but better than nothing. '-')b

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], VESTED