- Aug 13, 2019
- 1,898
- 2,923
So, I have a problem. I want a textbox to change depending on specific conditions. However, I, for the life of me, can't find a way to make this work. Here's my code:
Obviously, that doesn't work with Character Object, because I need a python line, but that doesn't work because the arguments repeat themselves.
How can I implement a changing textbox? It doesn't need to be on the character object, but I even tried in the screen file and that sends me this.
I tried some variations of that, but same result.
Python:
if inpsyche == True and clock.psychename == ["CHARLOTTE"]:
background Image("gui/textboxcharlotte.png", xalign=0.5, yalign=1.0)
elif inpsyche == True and clock.psychename == ["LAURA"]:
background Image("gui/textboxlaura.png", xalign=0.5, yalign=1.0)
elif inpsyche == True and clock.psychename == ["VALERIE"]:
background Image("gui/textboxvalerie.png", xalign=0.5, yalign=1.0)
elif inpsyche == True and clock.psychename == ["LAURA"]:
background Image("gui/textboxlaura.png", xalign=0.5, yalign=1.0)
Python:
define narrator = Character(
conditional='if inpsyche == True and clock.psychename == ["CHARLOTTE"]: window_background="gui/textboxcharlotte.png", xalign=0.5, yalign=1.0',
conditional='elif inpsyche == True and clock.psychename == ["LAURA"]: window_background="gui/textboxlaura.png", xalign=0.5, yalign=1.0',
conditional='elif inpsyche == True and clock.psychename == ["VALERIE"]: window_background="gui/textboxvalerie.png", xalign=0.5, yalign=1.0',
conditional='elif inpsyche == True and clock.psychename == ["LAURA"]: window_background="gui/textboxlaura.png", xalign=0.5, yalign=1.0)')
How can I implement a changing textbox? It doesn't need to be on the character object, but I even tried in the screen file and that sends me this.
Python:
style window:
xalign 0.5
xfill True
yalign gui.textbox_yalign
ysize gui.textbox_height
if inpsyche == True and clock.psychename == ["CHARLOTTE"]:
background Image("gui/textboxcharlotte.png", xalign=0.5, yalign=1.0)
elif inpsyche == True and clock.psychename == ["LAURA"]:
background Image("gui/textboxlaura.png", xalign=0.5, yalign=1.0)
elif inpsyche == True and clock.psychename == ["VALERIE"]:
background Image("gui/textboxvalerie.png", xalign=0.5, yalign=1.0)
elif inpsyche == True and clock.psychename == ["LAURA"]:
background Image("gui/textboxlaura.png", xalign=0.5, yalign=1.0)
else:
background Image("gui/textbox.png", xalign=0.5, yalign=1.0)
Code:
File "game/screens.rpy", line 139: end of line expected.
if inpsyche == True and clock.psychename == ["CHARLOTTE"]:
^