Changing Side image when there's No Dialogue?

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
marikodes
Newbie
Posts: 2
Joined: Mon Aug 31, 2015 5:26 pm
Tumblr: marikodraws
Contact:

Changing Side image when there's No Dialogue?

#1 Post by marikodes »

I've configured the side image for my main character to always be showing, and I'm wondering if there's a way to change which image is showing without giving the character dialogue? (For instance, to show their reaction to another character's dialogue, etc.)

If it helps clarify, here's the relevant code I've got going:

Code: Select all


init python:
    config.side_image_tag = "mc"

define mc = Character('[first_name] [last_name]', image ='mc')

image side mc = ConditionSwitch(
        "gender_pres == 'masc'", "sprites/mc/mc_m_normal.png",
        "gender_pres == 'femme'", "sprites/mc/mc_f_normal.png",
        "gender_pres == 'nb'", "sprites/mc/mc_nb_normal.png",
        )

image side mc annoyed = ConditionSwitch(
        "gender_pres == 'masc'", "sprites/mc/mc_m_annoyed.png",
        "gender_pres == 'femme'", "sprites/mc/mc_f_annoyed.png",
        "gender_pres == 'nb'", "sprites/mc/mc_nb_annoyed.png",
        )
# etc. for other emotions
And what I want to happen is something along these lines:

Code: Select all

chara1 "Wow, ur really lame [first_name]."
# change mc side image to annoyed
chara1 "Haha, just kidding."

User avatar
orz
Regular
Posts: 126
Joined: Tue Apr 21, 2015 10:19 pm
Contact:

Re: Changing Side image when there's No Dialogue?

#2 Post by orz »

Try just giving it an empty string " "

User avatar
marikodes
Newbie
Posts: 2
Joined: Mon Aug 31, 2015 5:26 pm
Tumblr: marikodraws
Contact:

Re: Changing Side image when there's No Dialogue?

#3 Post by marikodes »

orz wrote:Try just giving it an empty string " "
That does certainly work, it's just not as smooth as I'd like to be, since it still displays an empty textbox.

User avatar
orz
Regular
Posts: 126
Joined: Tue Apr 21, 2015 10:19 pm
Contact:

Re: Changing Side image when there's No Dialogue?

#4 Post by orz »

It's a dirty fix, but you could just do 'mc annoyed "{nw}"'.

If it were me I'd just keep track of the mc's mood in a variable, and use a ConditionSwitch based on that variable to show the different images.

Post Reply

Who is online

Users browsing this forum: Google [Bot]