4
\$\begingroup\$

At the start of my RenPy game, the player chooses a male or female character. The game plays out the same for both, save for some details.

The problem is that I want to write:

show hero normal

and get the image of the correct sex of the character chosen at the start.

I started to write a python function to do this, but it looks wrong because there seems to be enough ATL language to do this, even if I can't find a way.

Any idea?

\$\endgroup\$
5
\$\begingroup\$

ATL doesn't have an if statement at the moment. You can use DynamicDisplayable for this - the code looks like:

image hero normal = ConditionSwitch(
    "male", "male_normal.png",
    "True", "female_normal.png")

I've added an ATL if statement to the list of things I'll add to Ren'Py in the future, since it really should be there.

\$\endgroup\$
2
  • \$\begingroup\$ I did see this solution on the wiki and tried to use it but it didn't work and I was in a hurry, so I did use the less flexible but instantly working choice ATL block statement instead. \$\endgroup\$
    – Klaim
    Apr 22 '11 at 9:51
  • \$\begingroup\$ Any updates on this answer? oris this still the way to go? \$\endgroup\$
    – Goot
    Jan 19 '16 at 12:21
2
\$\begingroup\$

Someone on this forum showed me that I could use choice in ATL :

image hero normal:
    choice( hero_sex == "man" ):
        "hero_man_normal.png"
    choice( hero_sex == "woman" ):
        "hero_woman_normal.png"

Not perfect solution but simple enough to solve my problem.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .