Indent Problem, Unsure of issue

Below is my code.

My problem is that after making the choice below (& so far it’s the only choice with this problem), it says “increasing indent not allowed, expected 2 was 4”

Problem is that it’s the line below the choice itself (so in this case, line 4). I’ve never had this problem before and been unable to fix it. Before when I had it, I just added a new line (so line 4 would become line 5, line 4 would have (text here) in it’s place while everything below it moved down one line) and that fixed it.
Just moving that line back however erases everything below the choice, and I get a new error

So what will you do now?
*choice
  *selectable_if (((time1 = "1") or (time1 = "2")) or (time1 = "3")) #Gather Natural Cordage
    *if ((item1 = "Yes") or (item2 = "Yes"))
      (text here)
      *set cord1 +5
      *if (time1 = "1")
        (text here)
        *set time1 2
        *goto (label title) 
    *if ((item1 = "No") or (item2 = "No"))
      (text here)
      *set cord1 +2
      *if (time1 = "1")
        (text here)
        *set time1 2
        *goto (label title)
1 Like

Where is the *goto statement that goes with that choice? Did you just leave it out?

1 Like

Sorry, it is in there but I forgot to put it in this code lol

1 Like

Try removing the whole “**if ((item1 = “No”) or (item2 = “No”))*” block of code, and see if you still get the error. Since the two if clauses are formatted the same way, that should help you narrow down the exact location of the problem.

1 Like

Same problem. Same exact issue “increasing indent not allowed, expected 2 was 4”

1 Like

Try un-indenting the *goto statement by two spaces.

1 Like

Nope, same issue still. This is driving me nuts

1 Like

Hmm. Maybe there should be a catch-all *goto statement at the very bottom of the choice block.

1 Like

A catch-all *goto ? What to do you mean by that?

1 Like

Under “Gather Natural Cordage”, you have a couple of *if clauses. There is always a possibility that the code won’t enter either of them. That means that you reach the end of the choice with no *goto statement and the program doesn’t know what to do next. “catch-all” just means “what happens if none of the sub-conditions are met?”

1 Like

Also, I tried to put both gather choices under one choice. Same issue for both choices.

Ex:

What will you do?
*choice
  #Gather Wood
    *if (item1 = "Yes")
      (text here)
      *set wood +5
      *if (time1 = "1")
        (text here)
        *set time1 2
        *goto (label title) 
    *if (item1 = "No")
      (text here)
      *set wood +2
      *if (time1 = "1")
        (text here)
        *set time1 2
        *goto (label title)
  #Gather Cordage
*if ((item1 = "Yes") or (item2 = "Yes"))
      (text here)
      *set cord1 +5
      *if (time1 = "1")
        (text here)
        *set time1 2
        *goto (label title) 
    *if ((item1 = "No") or (item2 = "No"))
      (text here)
      *set cord1 +2
      *if (time1 = "1")
        (text here)
        *set time1 2
        *goto (label title)
1 Like

Ah, I’ll try to change that & see if it works

1 Like

So i changed my code to what I posted above, no issues with #Gather Wood

But now I get the indent problem with #Gather Cordage (& the *if is not that indented in my actual code by the way)

1 Like

It is always a good idea to end ifs, with an else, so the programm knows what to do if there is no suiting if. Is it wanted that the if after the #Gather Cordage is before the choice?

2 Likes

The difference is that you have a more complex condition, so it’s more likely that you “fall out” of the if clause without ever reaching a goto statement.

1 Like

I did place an *else for the cordage this time

#Gather cordage
  *if ((item1 = "Yes") or (item2 = "Yes"))
    (text here)
    *set cord1 +5
    *if (time1 = "1")
      (text here)
      *set time1 2
      *goto (label name)
  *if ((item1 = "None") or (item2 = "None"))
    (text here)
    *set cord1 +3
    *if (time1 = "1")
      (text here)
      *set time1 2
      *goto (label name)
  *else
    (text here)
    *set cord1 +3
    *if (time1 = "1")
      (text here)
      *set time1 2
      *goto (label name)
1 Like

But then why am I getting the indent error? (I’ve only been working w the ChoiceScript IDE for a few weeks)

1 Like

The error messages that CS gives aren’t always the most intuitive. You could be getting an indent error because the engine is expecting a goto statement that’s indented a certain amount, and instead gets a statement that logically belongs to another block. “Wrong indent” can be its way of saying to you “I’m not done with this logic block, tell me what to do next”. Hence the fall-back goto statement. That’s your way of saying to the engine “if all else fails, do this”.

Edit: OK, it’s eleven PM here so I gotta turn in. Good luck.

1 Like

Ah ok.

Well now I’m getting a new error completely unrelated to this (so time for a new post I think), But thanks so much guys!

1 Like

Do you have a *finish at the very end of the choice?

1 Like