I'm trying to add health/ MP/ stat bars to my game. So far so good, here's what I have for the main character's profile:
Code: Select all
init python:
show_profilestats=False
def stats_overlay():
if show_profilestats:
#ui.window(
#xalign = 20,
#ypos = 20,)
ui.image("profile.png",
xpos = 20,
ypos = 15)
ui.text("{color=#FFF}{size=-10}Kinmoku{/size}{/color}",
xpos = 172,
ypos = 52,)
ui.vbox(xpos = 164,
ypos = 95)
ui.bar(max_hp, profile_hp,
style="profile_hp_bar")
ui.close()
ui.vbox(xpos = 164,
ypos = 134)
ui.bar(max_mp, profile_mp,
style="profile_mp_bar")
ui.close()
config.overlay_functions.append(stats_overlay)
init -2 python:
#Health points
profile_hp=100
max_hp = 100
#Mana points
profile_mp=100
max_mp = 100
init -5 python:
#PROFILE HP BAR
style.profile_hp_bar = Style(style.default)
style.profile_hp_bar.xalign = 0.5
style.profile_hp_bar.xmaximum = 279 # bar width
style.profile_hp_bar.ymaximum = 36 # bar height
style.profile_hp_bar.left_bar = Frame("profile_HPfull.png", 0, 0)
style.profile_hp_bar.right_bar = Frame("profile_HPempty.png", 0, 0)
#PROFILE MP BAR
style.profile_mp_bar = Style(style.default)
style.profile_mp_bar.xalign = 0.5
style.profile_mp_bar.xmaximum = 263 # bar width
style.profile_mp_bar.ymaximum = 36 # bar height
style.profile_mp_bar.left_bar = Frame("profile_MPfull.png", 0, 0)
style.profile_mp_bar.right_bar = Frame("profile_MPempty.png", 0, 0)
Code: Select all
$ show_profilestats=True
pause 1
$ profile_hp-=50
$ show_profilestats=True
$ renpy.pause()
$ show_profilestats=False
E.G.
The first time you party, it will be You (profile), Nightshade (player1) and Celes (player2).
The next time you party, you will be with other characters: You (profile), Emarin (player1), Watto (player2) and Ivana (player3).
I understand I can choose not to show player 3 or 4 or whatever quite easily, but how do I define who player 1, 2, 3 and 4 are on a case by case basis? The reason for this is I'd like to customise each party member with their image and name. I also want to use the layout as I have in my design (see attached image) and not have awkward gaps because Nightshade (original player1) and Celes (original player2) are no longer present.
I hope I'm making sense! I'm really stuck on what to do next (I'm not a coder!) >_<
