Question: Testing Variable Against Multiple Others?
Posted: Fri Mar 03, 2017 10:35 pm
Hi! Me again. I ran into yet another problem! Argh! Anyway, this one is pretty simple, I think. The answer is probably right under my nose!
Here's the code:
I'm trying to get the player's blood type to be set to a certain value based on how many points that variable got in the short quiz (not shown). So if the player took the quiz and got a score of 2 in 'O' and 2 in 'A', then 'O' variable would equal 2 and the 'A' variable would equal 2. The blood type should be set to whatever relevant variable got the highest score, but in events of a tie, for now I want a simple way to decide the type. I'll make it a bit more complex and story-friendly later, but right now for the purposes of testing the script and putting out a long-delayed Build, I just want this simple tiebreaker.
However, every time I get to that part in testing, I get an error. I've included the traceback.txt for reference.
PLEASE HELP!
Here's the code:
Code: Select all
label result:
if O > A:
if O > B:
if O > AB:
$ blood = "O"
jump quizend
elif A > O:
if A > B:
if A > AB:
$ blood = "A"
jump quizend
elif B > O:
if B > A:
if B > AB:
$ blood = "B"
jump quizend
elif AB > O:
if AB > A:
if AB > B:
$ blood = "AB"
jump quizend
elif O == A or O = B or O = AB or A == B or A == AB or B == AB: ## It's this part that's the problem.
na "Hmmm.... maybe one more question is in order..."
menu:
"Which of these letters do you like the most?"
"A":
$ blood = "A"
jump quizend
"B":
$ blood = "B"
jump quizend
"O":
$ blood = "O"
jump quizend
"Both A and B":
$ blood = "AB"
jump quizendHowever, every time I get to that part in testing, I get an error. I've included the traceback.txt for reference.
PLEASE HELP!