Error occuring in naming-scene


#1

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? :sob:

*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. :rofl:
/Toco


#2

I don’t see anything wrong structure-wise, but I notice that you use 3 spaces for the first indentation, and 4 spaces for the 2nd level indentation.

Perhaps this is the case.
All level of indentations is should be the manifold of the first level (which in your case, threefold).

Therefore, I recommend using tabs for indentation instead of spaces. More obvious spacing, less press required.


#3

Well, one thing, *input_text is enough on its own. You don’t need an extra *set below that; the *input_text itself sets it.

I’m not sure that’s what the error is, though. Which line is line 89 and which is 83? That would help pin it down.

Also, just to note, the word is “surname” rather than “surename.”


#4

Thanks! I’m pretty sure I’ve been using tabs all along. Does it look like I’ve been using the space button? :hushed:

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? :confused:

@TSSL Thanks for the heads up!

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! :frowning_face:


#5

@Szaal
@TSSL
Thank you, it works now!! ; _ ; :heart:
I rewrote the latter part, since it worked fine up until the surnames, and that did the trick! :smiley:


#6

If I’m allowed to be curious, what things are changed? :eyeglasses:


#7

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… :rofl: