Trouble with IF statement and possibly first/then macro Sugarcube 2.31.1

So I’m writing a dialogue scene, in which I want you to have the power to ask three questions, and ask them in whatever order you want. and Im kinda of using a path variable system.
But whenever I get to the part with with the path variables where hes asking about the victims I get an error message that says . “error: Unexpected identifier” I’ve gone over the code and cannot find what it is.
Can anyone see what Im doing wrong?
Or is there a better way to achieve this?

My code looks like this:

<<first>>
<<if $hugo.localtrustscore lt 2>>	
<<say 'William Hensley' 'images/coachman1.jpg'>>Sorry...I don't mix personal details with business. I'm sure the Talbot's are much more eager to answer your questions...
<</say>>

<span class="neutral">[[Very well.|Carriage2]]</span> 

	
	
	<<elseif $hugo.localtrustscore gte 5>>	
<<say 'William Hensley' 'images/coachman1.jpg'>>I am, as a matter of fact...I grew up on a little farm just outside the city. My grandfather built it with his own two hands. Still stands today. 
<</say>>

<span class="info">[[So you must know some of these victims then?|coachmaninv1][$hugo.detectiveskill += 2]]</span>

<<else>>	
<<say 'William Hensley' 'images/coachman1.jpg'>>Sorry...I don't mix personal details with business. Nothing against you...Though I know the Talbot's are very eager for your arrival. Shall we start towards them?
<</say>>

<span class="neutral">[[Very well.|Carriage2]]</span> 

<</if>>

<<then>>

<<say 'William Hensley' 'images/coachman1.jpg'>>Oh please sir, don't refer to them as..."victims"...because I have, as a matter of fact, known many of them on some level...
The Talbot's are reletively new around town...But I knew the local priest's wife very well...and Ronald was on bad times but...he didn't deserve to go the way he did...
<</say>>

<span class="info">[[What can you tell me about Stacey Talbot?|coachmaninv1][hugo.detectiveskill += 2, set $path1 to true]]</span>

<span class="info">[[Tell me about the priests wife. What was her name? What happened to her?|coachmaninv1][$hugo.detectiveskill += 2, set $path to true]]</span>

<span class="info">[[Who's Ronald?|coachmaninv1][$hugo.detectiveskill += 2, set $path3 to true]]</span>

<<then>>

			<<if $path1 is true>>
<<say 'William Hensley' 'images/coachman1.jpg'>>Not a lot, I'm afraid. Sylus Talbot and his wife-can't recall her name righ this moment-just moved to town the end of this last Summer. I saw her at Church. She was a well behaved young lady. I hope for the best...but can only assume the unfortunate...  
<</say>>

<span class="info">[[Tell me about the priests wife. What was her name? What happened to her?|coachmaninv1][$hugo.detectiveskill += 2, set $path2 to true]]</span>

<span class="info">[[Who's Ronald?|coachmaninv1][$hugo.detectiveskill += 2, set $path3 to true]]</span>



					<<elseif $path2 is true>>

<<say 'William Hensley' 'images/coachman1.jpg'>>Alexandra Lathbury...I know this is your work detective...but I have a long and solitary drive to Victoria...I'd rather not have those thoughts so fresh on my mind in the darkness... 
Her case is old now...most the folks around town would be able to answer just as much about it as me...anything else I can help with...
<</say>>

<span class="info">[[What can you tell me about Stacey Talbot?|coachmaninv1][$hugo.detectiveskill += 2, set $path1 to true]]</span>

<span class="info">[[Who's Ronald?|coachmaninv1][$hugo.detectiveskill += 2, set $path3 to true]]</span>



				<<else>>

<<say 'William Hensley' 'images/coachman1.jpg'>>All the little babes around town call him, 'Ol' Ronnie'. Like Mrs. Lathbury, I grew up with Ronald. 
He never had it all together...had a drinking problem since we were young...became a vagrant after his mother died in the fire...
They found him nude...and headless beneath a bridge leading out of town...
<</say>>

<span class="info">[[What can you tell me about Stacey Talbot?|coachmaninv1][$hugo.detectiveskill += 2, set $path1 to true]]</span>

<span class="info">[[Tell me about the priests wife. What was her name? What happened to her?|coachmaninv1][$hugo.detectiveskill += 2, set $path2 to true]]</span>


<</if>>
<<then>>


<</first>>

It’s probably things like this:

[[...][hugo.detectiveskill += 2, set $path1 to true]]

The “set” shouldn’t be there.

Also, you have an extra/unnecessary <<then>> at the end there.

And if you’re going to show non-standard macros in your code, please link to where they come from.

1 Like

Then is there becasue it’s going to continue past this. I find it easier to bug check as I go.
and the missing $ sign is there in my code, so I think that was a weird copy and paste glitch.
But it was the set! thank you!