It's me again, writing tips for those who are not familiar with python, but want to make a game with lots of variables. If you are one of that kind of developers, you may wonder - "How to make some variables dynamically updatable (Based on some conditions) on a screen?" The thing is - you must write a custom function for that. Those are a little hard to catch at first, but I'll give you a nice example here.
For example, you made a height slider for character creation screen.
init:
$ height_cm = 0
$ height = " "
init python:
def height_calc():
if height_cm <= 150:
height = "Low"
if height_cm > 150:
height = "Average":
if height_cm > 180
height = "Hight":
return height
screen character_creation:
$ height = height_calc()
frame xalign 0.5 yalign 0.5:
has vbox xalign 0.5
text "Choose your height"
bar xmaximum 300:
value VariableValue("height_cm", 200)
style style.slider
text "Your height is [height_cm] cm ([height])"
hbox xalign 0.5 yalign 0.9:
textbutton "Accept" xalign 0.99 action Jump("start")
That way you will immeadiately see on screen how properties of your height are updated. And you must define all the conditions only once in init section. If you need those in any other screen, everything you need is to assign "$ variable = function()" as a first line of the screen code. I hope it will help somebody.