I am tryign to make a game in renpy, and i implemented a small rpg like mechanic, and i was trying to show healthbars. it was working for a bit, but then it stopped and i don't know why. I checked my variables and everything seemed to be in order. maybe someone here can help me out. Below is the small rpg screen setting segment.
label rpg_test:
play music "Boss_Fight.wav"
$ attack = 0
if "dagger" in inventory == True:
$ player_attack + 2
$ kdragon_hp = kdragon_max_hp
define gui.bar_tile = True
define getting_attacked = "No one"
$ kdragon_max_hp = 50 * len(party)
$ kdragon_hp = kdragon_max_hp
screen simple_stats_screen:
frame:
xalign 0.01 yalign 0.05
xminimum 220 xmaximum 220
yminimum 100 ymaximum 100
vbox:
text name size 15 xalign 0.25
text "[player_hp] / [player_max_hp] HP" size 13 xalign 0.5
text "[player_sp] / [player_max_sp] SP" size 13 xalign 0.75
null height 2
hbox:
bar:
xmaximum 130
ypos 10
value player_hp
range player_max_hp
left_gutter 0
right_gutter 0
thumb None
thumb_shadow None
null width 3
if gilbert_in_party == True:
frame:
xalign 0.01 yalign 0.20
xminimum 220 xmaximum 220
yminimum 100 ymaximum 100
vbox:
text "Gilbert" size 15 xalign 0.25
text "[gilbert_hp] / [gilbert_max_hp] HP" size 13 xalign 0.5
text "[gilbert_sp] / [gilbert_max_sp] SP" size 13 xalign 0.75
null height 2
hbox:
bar:
xmaximum 130
ypos 10
value gilbert_hp
range gilbert_max_hp
left_gutter 0
right_gutter 0
thumb None
thumb_shadow None
null width 3
if guard_in_party == True:
frame:
xalign 0.01 yalign 0.35
xminimum 220 xmaximum 220
yminimum 100 ymaximum 100
vbox:
text "Guard" size 15 xalign 0.25
text "[guard_hp] / [guard_max_hp] HP" size 13 xalign 0.5
text "[guard_sp] / [guard_max_sp] SP" size 13 xalign 0.75
null height 2
hbox:
bar:
xmaximum 130
ypos 10
value guard_hp
range guard_max_hp
left_gutter 0
right_gutter 0
thumb None
thumb_shadow None
null width 3
if host_in_party == True:
frame:
xalign 0.01 yalign 0.5
xminimum 220 xmaximum 220
vbox:
text "TV Host" size 15 xalign 0.25
text "[host_hp] / [host_max_hp] HP" size 13 xalign 0.5
text "[host_sp] / [host_max_sp] SP" size 13 xalign 0.75
null height 5
hbox:
bar:
xmaximum 130
value host_hp
range host_max_hp
left_gutter 0
right_gutter 0
thumb None
thumb_shadow None
null width 5
text "[host_hp] / [host_max_hp]" size 16
frame:
xalign 0.99 yalign 0.05
xminimum 220 xmaximum 220
vbox:
text "Dragon king" size 22 xalign 0.5
null height 5
hbox:
bar:
xmaximum 130
value kdragon_hp
range kdragon_max_hp
left_gutter 0
right_gutter 0
thumb None
thumb_shadow None
null width 5
text "[kdragon_hp] / [kdragon_max_hp]" size 16
```
I tried to fill your screen with data and it worked fine. Check the variables you have, make sure you are showing or calling the screen, that's not in the piece of code you provided: call screen simple_stats_screen or show screen simple_stats_screen.