Problem with ConditionSwitch in image side

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
qcastro
Newbie
Posts: 7
Joined: Sun Apr 03, 2016 5:06 pm
Contact:

Problem with ConditionSwitch in image side

#1 Post by qcastro »

I am trying to change de image side according to the case, but I cannot figure out what is going wrong:
The idea is:

Code: Select all

init:
# Condition Switch for FAIXA side image
    image aluno = ConditionSwitch(
        "faixa == 'branca", "image-side/faixa-branca.png",
        "faixa == 'ponta amarela'", "image-side/faixa-ponta-amarela.png",
        "faixa == 'amarela'", "image-side/faixa-amarela.png",
        "faixa == 'ponta verde'", "image-side/faixa-ponta-verde.png",
        "faixa == 'verde'", "image-side/faixa-verde.png",
        "faixa == 'ponta azul'", "image-side/faixa-ponta-azul.png",
        "faixa == 'azul'", "image-side/faixa-azul.png",
        "faixa == 'ponta castanha'", "image-side/faixa-ponta-castanha.png",
        "faixa == 'castanha'", "image-side/faixa-castanha.png",
        "faixa == 'ponta preta'", "image-side/faixa-ponta-preta.png",
        "faixa == 'preta'", "image-side/faixa-preta.png",
        "faixa == None", "image-side/neofito.png",
        )

define e = Character('Eu', color="#00FF00", window_left_padding=150, show_side_image="aluno", xalign=0.0, yalign=1.0)
But I get an error message.

What am I doing wrong?
Last edited by qcastro on Wed Apr 06, 2016 5:02 pm, edited 1 time in total.

User avatar
korova
Veteran
Posts: 217
Joined: Sat Jun 27, 2009 5:15 pm
Completed: Ivy, Chocolate, Time, Clair Obscur
Projects: Writing exercises, The House [Nano18]
Tumblr: korova08
itch: korova
Location: Normandie, France
Contact:

Re: Problem with ConditionSwitch in image side

#2 Post by korova »

Your image and the variable of your condition have the same name.

qcastro
Newbie
Posts: 7
Joined: Sun Apr 03, 2016 5:06 pm
Contact:

Re: Problem with ConditionSwitch in image side

#3 Post by qcastro »

korova wrote:Your image and the variable of your condition have the same name.
Korova,

I changed the variable, but the error continue.

User avatar
korova
Veteran
Posts: 217
Joined: Sat Jun 27, 2009 5:15 pm
Completed: Ivy, Chocolate, Time, Clair Obscur
Projects: Writing exercises, The House [Nano18]
Tumblr: korova08
itch: korova
Location: Normandie, France
Contact:

Re: Problem with ConditionSwitch in image side

#4 Post by korova »

Can you post the error message and the new code ?

qcastro
Newbie
Posts: 7
Joined: Sun Apr 03, 2016 5:06 pm
Contact:

Re: Problem with ConditionSwitch in image side

#5 Post by qcastro »

korova wrote:Can you post the error message and the new code ?
Sorry,

I found my silly mistake: I forgot to end the quote in 'branca'. But now it's done.
Thanks for your attention

Post Reply

Who is online

Users browsing this forum: Ocelot