Side image condition switch?

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
Amie
Regular
Posts: 28
Joined: Tue Jun 06, 2017 4:48 am
Contact:

Side image condition switch?

#1 Post by Amie »

Hi everyone! I've run into another small problem and was wondering if someone might be able to help me, basically the problem is that I can't get side images to match the character if the character changes their outfit, the code below allows me to link a characters different costumes to a variable:

Code: Select all

image Alice Happy = ConditionSwitch (
    "Alice_Outfit == 1","AliceFormalHappy.png",
    "Alice_Outfit == 2","AliceClownHappy.png",
    "True", "AliceCasualHappy.png"
    )
So if I set the variable "Alice_Outfit" to 1 she'll be wearing formal clothes, if I set it to 2 she'll be dressed as a clown, etc. The problem is, I cant seem to give the side image (face picture) the same functionality. I tried to use:

Code: Select all

image side Alice Happy = ConditionSwitch (
    "Alice_Outfit >= 1","AliceClownHappySP.png",
    "True", "AliceCasualHappySP.png"
    )
But the above won't work for me, Does anyone know what I'm doing wrong? Or how I can go about creating side images that change costume along with the main character image? Thanks for any help :)

User avatar
Divona
Miko-Class Veteran
Posts: 678
Joined: Sun Jun 05, 2016 8:29 pm
Completed: The Falconers: Moonlight
Organization: Bionic Penguin
itch: bionicpenguin
Contact:

Re: Side image condition switch?

#2 Post by Divona »

It should be the same as the sprite condition switch, just change the file name to the correct side image file.

Code: Select all

image side Alice Happy = ConditionSwitch (
    "Alice_Outfit == 1","AliceFormalHappySP.png",
    "Alice_Outfit == 2","AliceClownHappySP.png",
    "True", "AliceCasualHappySP.png"
    )
Completed:
Image

User avatar
Amie
Regular
Posts: 28
Joined: Tue Jun 06, 2017 4:48 am
Contact:

Re: Side image condition switch?

#3 Post by Amie »

Oh, that works! Thanks for the help Divona! :D

Post Reply

Who is online

Users browsing this forum: Sugar_and_rice