I'm trying to jump to a separate file when you reach another chapter in the game, and then define what route you're on based on the points of the first chapter. But it always defaults to one specific route, even if I didn't do anything to activate it.
Essentially, it's like this:
Code: Select all
label start:
$ an_pre = 0
$ az_pre = 0
$ mi_pre = 0
$ s_pre = 0
$ y_pre = 0
$ an_r = False
$ az_r = False
$ mi_r = False
$ s_r = False
$ y_r = False
label Chapter_01:
menu:
"Wrong answer":
pass
"Right answer":
$ y_pre += 1
By the time you finish chapter 01, you'll have X amount of points, and whichever route has the most is the one you'll be on for the rest of the game. But even if I specifically avoid choosing any options that would increase the amount of an_pre points, it always proceeds as though I did. I think this is most likely because the conditional statement regarding the an_pre points when it decides what route you're on is on top.
So, I think there are potentially two things I'm doing wrong here. The conditional statements (most likely), or somehow I messed up the jump procedure. I've tried a few things, so I don't THINK it's the latter, but I'll show what I did anyway.
At the end of script.rpy:
Code: Select all
"End of Chapter 01."
jump Chapter_02
Code: Select all
label Chapter_02:
"Let's see if it worked...!"
if an_pre >= az_pre and mi_pre and s_pre and y_pre:
$ an_r = True
elif az_pre >= an_pre and mi_pre and s_pre and y_pre:
$ az_r = True
elif mi_pre >= an_pre and az_pre and s_pre and y_pre:
$ mi_r = True
elif s_pre >= an_pre and az_pre and mi_pre and y_pre:
$ s_r = True
elif y_pre >= an_pre and az_pre and mi_pre and s_pre:
$ y = True
if an_r:
"Anisha's route!"
elif az_r:
"Azami's route!"
elif mi_r:
"Mori's route!"
elif s_r:
"Snake's route!"
elif y_r:
"Yui's route!"
return