Invalid indent, expected at least one line in 'if' true block

So i looked through the forum and none seem to have the same issue i am having this is what my code looks like

And the error i keep getting is chapter1 line 526: invalid indent, expected at least one line in ‘if’ true block the thing is it only appears if your playing as a female it works perfectly fine if your playing as male

1 Like

You have to indent the *choice

*if (gender = "Male")
  *choice
    #........
    #....
    #....
*if (gender = "Female")
  *choice
    #....
1 Like

I still got the same error

And its only with the female gender
chapter1 line 526: invalid indent, expected at least one line in ‘if’ true block

Can you directly post your code in this thread so we can get a closer look at it? Wrap it in ``` (found underneath the squiggly line on your keyboard) to format it correctly.

Squiggly line?

1 Like

Here I am trying not to say tilde to avoid confusing people and I end up confusing someone. :stuck_out_tongue: Press the highlighted key three times at the beginning and end of your code.

*choice
	#You had a preference for men...
		*set sexuality "gay"
		To them it was discusting,unnatural..they considered you a freak and while they never properly interacted with you to
		begin with, when they found out you had actually been dating anoter man...well lets just say things became colder than
		the artic..
		*goto sword
	#You liked both men and women..
		*set sexuality "bisexual"
		It was fine whenever you had a girl over...they would atleast be somewhat civil but when they caught sight of another guy
		with you...insults and harsh words were even more common..
		*goto sword
	#You liked women
		*set sexuality "straight"
		For the most part they never really bothered you about who you were dating..but there would always be snide comments saying
		how she was to good for the likes of you, or how short your relationship would last...
		*goto sword
*if (gender = "Female")
*choice
	#You had a preference for women...
		*set sexuality "lesbian"
		To them it was discusting,unnatural..they considered you a freak and while they never properly interacted with you to
		begin with, when they found out you had actually been dating anoter woman...well lets just say things became colder than
		the artic.
		*goto sword
	#You liked both men and women...
		*set sexuality "bisexual"
		It was fine whenever you had a guy over...they would atleast be somewhat civil but when they caught sight of another girl
		with you...insults and harsh words were even more common..
		*goto sword
	#You liked men
		*set sexuality "straight2"
		For the most part they never really bothered you about who you were dating..but there would always be snide comments saying
		how he was to good for the likes of you, or how short your relationship would last...
		*goto sword```

like that?

1 Like

Yep, I fixed it up. The issue is that you need to indent the choice trees underneath the *ifs. So, every line after the first *if and everything after the second *if needs another indent.

so the *choice to? Why does it give me the error on the female route only though?

Choicescript error testing is weird. :stuck_out_tongue: But yes, you need to do it for both *choices.

alright should i keep using the ~ or tab? Sorry for asking so many questions

The ``` are just so the forum correctly formats your code when you post it. Use tab for your actual code in your game. :slight_smile:

Here’s the syntax on using *if command (and subsequently, elseif/else)

*if (condition)
   text
   *goto labelname
*elseif (condition 2)
   text
   *goto labelname
*else
   text
   *goto labelname
1 Like
*if (gender = "Male")
	*choice
		#You had a preference for men...
			*set sexuality "gay"
			To them it was discusting,unnatural..they considered you a freak and while they never properly interacted with you to
			begin with, when they found out you had actually been dating anoter man...well lets just say things became colder than
			the artic..
			*goto sword
		#You liked both men and women..
			*set sexuality "bisexual"
			It was fine whenever you had a girl over...they would atleast be somewhat civil but when they caught sight of another guy
			with you...insults and harsh words were even more common..
			*goto sword
		#You liked women
			*set sexuality "straight"
			For the most part they never really bothered you about who you were dating..but there would always be snide comments saying
			how she was to good for the likes of you, or how short your relationship would last...
			*goto sword
*if (gender = "Female")
	*choice
		#You had a preference for women...
			*set sexuality "lesbian"
			To them it was discusting,unnatural..they considered you a freak and while they never properly interacted with you to
			begin with, when they found out you had actually been dating anoter woman...well lets just say things became colder than
			the artic.
			*goto sword
		#You liked both men and women...
			*set sexuality "bisexual"
			It was fine whenever you had a guy over...they would atleast be somewhat civil but when they caught sight of another girl
			with you...insults and harsh words were even more common..
			*goto sword
		#You liked men
			*set sexuality "straight2"
			For the most part they never really bothered you about who you were dating..but there would always be snide comments saying
			how he was to good for the likes of you, or how short your relationship would last...
			*goto sword
*label sword

is this right?

Yes, although I recommend changing the second *if to *else to make testing a bit easier. Otherwise, it’s correct.

im still getting the same error i have no idea what im doing wrong

Is it in the same location? What does the error say?