[SOLVED] Sprite not switching in certain circumstances

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
Vialixia
Regular
Posts: 111
Joined: Sat Feb 16, 2013 8:27 am
Location: UK
Contact:

[SOLVED] Sprite not switching in certain circumstances

#1 Post by Vialixia » Thu Mar 29, 2018 6:38 am

Hi there!

I'm quite rusty with Ren'py so I'm sure what I'm doing wrong is probably very obvious, but any help would be appreciated! I used the search but can't quite find what I need help with as I can't figure out what's wrong.

In certain circumstances, my character sprite will not switch expression.
When selecting Rose and Lemon tea, this expression does not change;

Code: Select all

 e "Well actually, it's my first time! As you say, at home we only ever drink the normal kind of tea..."
        show RachelHappy at left
        with dissolve
        r "Ah, well make sure to come back and try the rest of them too!"
The whole segment is below :) I could be structuring the whole thing incorrectly so general advice is okay as well!

Code: Select all

menu:

    "English Breakfast, please.":
        r "Ah, the classic! I think even though we have lots of different teas, this one is still the most popular."
        r "It'll take a little while to prepare. We use tea leaves, rather than bags, so it needs to be pressed through the tea strainer and be left to brew for the full flavour!"
        jump Tea1

    "Ginger and cinnamon, please.":
        r "Oh! An interesting combination, don't you think? This one is sure to warm you up on a cold day like today."
        r "It'll take a little while to prepare. We use tea leaves, rather than bags, so it needs to be pressed through the tea strainer and be left to brew for the full flavour!"
        jump Tea1
        
    "Peppermint, please.":
        r "Ah! Peppermint is such a delicious, refreshing kind of tea, don't you think? If I've eaten cake, I always finish the meal with a peppermint tea."
        r "It'll take a little while to prepare. We use tea leaves, rather than bags, so it needs to be pressed through the tea strainer and be left to brew for the full flavour!"
        jump Tea1

    "Rose and lemon, please.":
        scene TeaInside
        show RachelHappy at left
        with dissolve
        $ rachel_relationship += 1
        r "Ah - you picked my favourite! Rose and lemon! It's a little different but I promise you it's delicious."
        r "Most people play it safe, you know - the English Breakfast."
        r "I happen to be quite passionate about tea! The flavour of the rose and lemon is so delicate, but refreshing. The gentle rose paired with the tangy lemon, ah! Perfect."
        show RachelShy at left
        with dissolve
        r "Have you had this type of tea before?"
        e "Well actually, it's my first time! As you say, at home we only ever drink the normal kind of tea..."
        show RachelHappy at left
        with dissolve
        r "Ah, well make sure to come back and try the rest of them too!"
        r "This particular tea takes a little time to prepare. We use tea leaves, which go through a special tea filter and then it needs to be left to brew to get the full flavour."
        
        jump Tea1
I have another example of this issue as well - at the end, instead of hiding Rachel, it shows RachelSad.

Code: Select all

show RachelNormal at left
    with dissolve
    play sound "welcome.wav"
    
    r "Welcome to The Rose Garden. I'll be with you in just a short moment!"
    
    hide RachelNormal 
    with dissolve
    
    "She whisks herself away again, and gently sets the teapot and teacups on the couples table, and promptly returns to greet me properly."
    
    show RachelSad at left
    with dissolve
    
    r "Gosh, you poor thing, getting caught out in the rain like that. Come and have a seat by the fire now, you'll soon be dry and warm."
    "She looks me up and down, her face showing genuine concern."
    
    show RachelHappy at left
    with dissolve
    
    r "The Rose Garden opened just last week - we have a large variety of teas and homemade cakes!" 
    
    r "I'm Rachel. I'll give you a minute to get settled, and I'll come back to take your order, okay?" 

    "Her smile is warm, but a little reserved."
    
    "I nod enthusiastically."
    
    hide RachelHappy
    with dissolve
    
    "I've been given a prime seat by the hearth. The flames are flickering merrily and the heat is warming my whole body." 
Thanks in advance!
Last edited by Vialixia on Thu Mar 29, 2018 6:56 am, edited 1 time in total.

User avatar
Vialixia
Regular
Posts: 111
Joined: Sat Feb 16, 2013 8:27 am
Location: UK
Contact:

Re: Sprite not switching in certain circumstances

#2 Post by Vialixia » Thu Mar 29, 2018 6:56 am

Ah, as soon as I posted this I figured it out. It's because I did not have a space between the image name and image expression e.g RachelHappy, RachelSad. I think that caused it to create new layers that weren't getting deleted. I changed everything to Rachel Happy, Rachel Sad, Rachel Shy etc. and it fixed it. :)

Post Reply

Who is online

Users browsing this forum: ShadowBoxGames