Making a sprite stop talking when dialogue stops?

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
nagoya29
Newbie
Posts: 5
Joined: Sat Sep 07, 2019 11:15 pm
Contact:

Making a sprite stop talking when dialogue stops?

#1 Post by nagoya29 »

Hello, a newbie here, so I came across live composites and condition switch the other day, to make a character blink and talk, and the result is pretty much what the tutorial said it'd do. But is it possible to make the sprite stop talking when the dialogue stops, or at least not repeat while the player is still reading the dialogue? Also, is there a way to make elena_talk = True automatically when Elena is speaking? The current code I have is pretty inefficient I believe, cuz I'm not really good at this, so any help would be greatly appreciated:D Thank you in advance!

Code: Select all

default elena_talk = False

define e = Character("Elena")

image img1 = "img1.jpg"
image elena_mouthstill = "mouth1.png"

image elena_talking:
    "mouth1.png"
    0.2
    "mouth2.png"
    0.13
    "mouth3.png"
    0.13
    "mouth2.png"
    0.13
    "mouth3.png"
    0.13
    "mouth2.png"
    0.13
    "mouth1.png"
    3.4
    repeat


image elena_eyes:
    "eyes1.png"
    choice:
        3.4
    choice:
        5.1
    choice:
        4.2
    choice:
        3.9
    "eyes2.png"
    .09
    "eyes3.png"
    .09
    "eyes2.png"
    .09
    "eyes1.png"
    .09
    repeat


image elena = Composite((700, 960),
    (0, 0), "base.png",
    (0, 0), ConditionSwitch(
        "elena_talk", "elena_talking",
        "True", "elena_mouthstill"),
    (0,0), "elena_eyes")

label start:

    scene img1 with dissolve
    show elena with dissolve
    play music "bgmusic.ogg"
    
    $ elena_talk = True
    e "Hey, didn't see you there."
    $ elena_talk = False
    "Oh hey Elena, could you help me with something real quick?"
    $ elena_talk = True
    e "Sure, I don't have much to do now anyways."

    return

User avatar
Kia
Eileen-Class Veteran
Posts: 1040
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Discord: Kia#6810
Contact:

Re: Making a sprite stop talking when dialogue stops?

#2 Post by Kia »

if I remember correctly, there was a lip flap code example using the character call back doing exactly what you want. try searching "lip flap" on the forum and see if you can find it

nagoya29
Newbie
Posts: 5
Joined: Sat Sep 07, 2019 11:15 pm
Contact:

Re: Making a sprite stop talking when dialogue stops?

#3 Post by nagoya29 »

Ah yes, I've found it! Thank you so much:)

Post Reply

Who is online

Users browsing this forum: Ocelot