Choicescript is messing with me, and I can’t figure out what the cause is. I’m trying to fix a firstname + surename scene, but it just won’t work! Well, tbh the firstname part works fine, but after that I get errors like:
“line 89: increasing indent not allowed, expected 0 was 1”
or
“line 83: Invalid expression, couldn’t extract another token: ”
Why choicescript, why?
*label enter_your_firstname
"Here we are..."
*choice
#Riley
*set firstname "Riley"
*goto name_check_one
#Stella
*set firstname "Stella"
*goto name_check_one
#Bran
*set firstname "Bran"
*goto name_check_one
#Haley
*set firstname "Haley"
*goto name_check_one
#Jordan
*set firstname "Jordan"
*goto name_check_one
#Vincent
*set firstname "Vincent"
*goto name_check_one
#That's not it
Enter your first name.
*input_text firstname
*set firstname "${firstname}"
*goto name_check_one
*label name_check_one
So, ${firstname} is your first name?
*choice
#Correct.
Wonderful!
*goto enter_your_lastname
#False.
My apologies, let's get it right.
*goto enter_your_firstname
*label enter_your_lastname
What of your surename?
*choice
#Hawkins
*set surename "Hawkins"
*goto name_check_two
#Stevens
*set surename "Stevens"
*goto name_check_two
#Webster
*set surename "Webster"
*goto name_check_two
#Quinn
*set surename "Quinn"
*goto name_check_two
#Serrano
*set surename "Serrano"
*goto name_check_two
#Farley
*set surename "Farley"
*goto name_check_two
#That's incorrect
*input_text surename
*set surename "${surename}"
*goto name_check_two
*label name_check_two
Your surename is "${surename}"?
#Correct.
Perfect!
*goto name_check_three
#False.
I see, care to repeat?
*goto enter_your_lastname
*label name_check_three
Your full name is ${firstname} ${surename}, then?
*choice
#Correct.
*set name "${firstname} ${surename}"
*finish
#False.
My apologies...
*goto enter_your_firstname
I’ve tried redoing the indents manually but to no avail. I don’t know what the invalid expression refers to - but I might have just stared at the screen for too long… maybe you can spot something.
/Toco
Thanks! I’m pretty sure I’ve been using tabs all along. Does it look like I’ve been using the space button?
In any case, I’ll go through it again and see if I can get the indentation right. Because what you’re saying is that the text should be in three levels? Fyi, I can’t tell the difference. When I look at the scene, the choice commands + choices themselves, seem to be at the exact same indentation. I can’t spot a *choice that has 1 indentation in front of it instead of 0. Does that make sense?
Assuming I haven’t counted wrong, line 83 is the line that goes “*input_text surename”.
Does this have something to do with the startup file, then?
89 is “Your surename is “${surename}”?” (changed it to surname btw).
But that makes no sense. The error message is telling me there’s an indentation there but there isn’t!
Of course! I’m not too sure myself, but this is the part I rewrote:
See here
*label enter_your_lastname
What of your surname?
*choice
#Hawkins
*set surname "Hawkins"
*goto name_check_two
#Stevens
*set surname "Stevens"
*goto name_check_two
#Webster
*set surname "Webster"
*goto name_check_two
#Quinn
*set surname "Quinn"
*goto name_check_two
#Serrano
*set surname "Serrano"
*goto name_check_two
#Farley
*set surname "Farley"
*goto name_check_two
#That's incorrect
*input_text surname
*goto name_check_two
*label name_check_two
And, ${surname} is your lastname?
*choice
#Correct
Perfect!
*goto name_check_three
#False
Care to repeat, then?
*goto enter_your_lastname
*label name_check_three
Your full name is ${firstname} ${surname}?
*choice
#Correct
*set name "${firstname} ${surname}"
*finish
#False
My apologies...
*goto enter_your_firstname
I checked both the scene/startup/stat file for spelling mistakes, or capitalised words. Sorry if I’m being unspecific, but I really can’t remember there being any glaring errors…