Page 1 of 1

multiple images for one variable [solved]

Posted: Mon Oct 28, 2013 11:43 pm
by queergames
Variable is probably the wrong word. Anyway, My newest game is going to have 4 different appearance choices for the protagonist. I am trying figure out a way to do this which would be shorter than the way I did it in my last game. Last time I just did it as follows:

Code: Select all

if the_choice:
        show prot_masc at Position(xalign=1.0, yalign=0.35)
    else:
        show prot_fem at Position(xalign=1.0, yalign=0.35)
However, I was hoping there was a way I could do it so I could just say "show prot" I've been puzzling over this for a while, but so far the game has just whined at me about not expecting stuff, or it's displayed the last choice no matter what. Clearly I have no idea where to even start, so that's where you guys come in.

Solution: ConditionSwitch

Re: multiple images for one variable

Posted: Tue Oct 29, 2013 1:04 am
by Elmiwisa
Why didn't you use ConditionSwitch?

Re: multiple images for one variable

Posted: Tue Oct 29, 2013 1:29 am
by queergames
Because I don't know what that is, so explain it to me or link me to a page explaining it.

Re: multiple images for one variable

Posted: Tue Oct 29, 2013 1:59 am
by trooper6
Go to this page, and look up Condition switch.
http://www.renpy.org/doc/html/displayables.html

Re: multiple images for one variable

Posted: Tue Oct 29, 2013 5:00 pm
by queergames
Oh sweet. This is perfect. Thanks so much!