I currently have a problem which i can't figure out.
I want a dynamic status bar on top. My Issue is that I don't know how to call a function and in general have no idea how a function is composed.
I'd like to be it a function, since I belive this way is the faster and cleaner approach. Feel free to prove me wrong.
My Statusbar has a variable "A", which changes Value during choice making. ( $ A += 1 )
What I want is that after choice which changes "A" a function runs and checks:
Code: Select all
if A <= 5:
B = "Bad"
if A <= 10:
B = "Neutral"
else:
B = "Good"
Here is my screen code (Which makes probably no sense.. to me neither. Renpy doesn't complain tho.):
Code: Select all
init python:
def fc_al(al):
self.hero_align = al
if al == 0:
self.hero_align = "Neutral"
if al == 1:
self.hero_align = "Bad"
else:
self.hero_align = "Good"
screen Statusbar:
style_prefix "Stat"
frame:
xalign 1 ypos 0
hbox:
text "A = [al]"
text "B = [hero_align]"
Btw.: This Forums Thread search gives me always 504 no idea if thats just on my end or the forum itself.