This is my first time with renpy and I'm very new to the coding world and the terms are still a tad confusing for me!
What I'm basically trying to do is changing a variable depending on how another is. Example a title is 'Asomething' when level 1 and 'Bsomething' when at level 5.
This is how I went about doing it;
Code: Select all
class Player(renpy.store.object):
def __init__(self, level=1, money=0, exp=0, rankName=""):
self.level = level
self.money = money
self.exp = exp
self.rankName = rankName
Code: Select all
if pc.level <=5:
$ pc.rankName = "Test1"
elif pc.level >= 6:
$ pc.rankName = "Test2"
elif and so on
Code: Select all
screen stat_screen:
add "gui/stat.png"
hbox:
vbox:
spacing 20
label "{b}Details:{/b} \n"
label "Level: [pc.level] ([pc.rankName])"
I tried changing the operators around and even made several titles and changed into == signs to test it out. And it appears as it can only be assigned to it once.
I even tried to have the if statements in the class code but same results. I feel like I'm using a method that is overcomplicating the process or simply missing something simple.