WhileSpeaking transitions?

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
terra0nova
Newbie
Posts: 6
Joined: Sun Oct 02, 2016 11:43 am
Completed: Too many to list...
Projects: Reality, Beyond the Stars
Github: davidmaletz
Skype: terra0nova
Contact:

WhileSpeaking transitions?

#1 Post by terra0nova » Sun Dec 11, 2016 12:39 pm

I'm trying to include a way to indicate who is speaking in my ren'py game, and I found this code snippet which gives the basic idea of how to do it:

https://www.renpy.org/wiki/renpy/doc/co ... d_Lip_Flap

Basically, I keep track of who is talking, and every character is a DynamicDisplayable that checks if they are talking, and if they are, they change the child displayable.

This works fine, except for the fact that it instantly switches between child displayables, and I want to smoothly transition between the displayables (with a dissolve, or an alpha fade in/out). And this is where I'm getting stuck.

My first experiment was to have the speaking displayable use At(...), and then have a transform that used a dissolve or linear alpha fade. However, this rarely works unless the transform's animation is repeating (and even then will cut to a random moment in the animation), because the time of the transform is set to the time of the sprite, so if it has been on the screen for a long time, then the animation of the transform is long past the start.

My second experiment was to call renpy.show(speaking, ...) in the speaker_callback to handle transforms on speaker change. This works if called elsewhere, but if called in the speaker_callback, it overwrites all previous transforms - my best guess is that because the speaker_callback is called while the displayable is changing (due to expression changes), that calling renpy.show at the same time is a bad idea.

My third experiment was to combine the two, hoping that calling renpy.show(speaking) with no arguments would reset the sprite time. Needless to say this didn't work, the sprite time seems to only reset if the sprite actually changes transform or expression.

Is this possible? Any ideas of how to get an animation or transition at the speaker change?

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot]