Illegal to fall out of choice statement?


#1

So i have this problem with the
“it is illegal to fall out of the *choice statement, you must *goto or *finish” error. The problem is, that even though i have *goto at the end of the choice, it still displays. (I have tested this with QuickTest so it may be a bug of it?)

*choice
 #Shoot.
  *if Gunshooting = 55
   arara
   *page_break
   *goto shuto
 #I try to reason with them..
  *if Focus = 60
   tututuu
   *page_break
   *goto rum
  *else
   blahblahblah
   *page_break
   *goto amnesia

"It is illegal to fall out of a *choice statement; you must *goto or *finish before the end of the indented block."
#2

Oh,also, the mesage says that the “I try to reason” choice is the error.


#3

It can be a bit of a butt at times.
But I can spot several problems:

  • the #shoot option has nowhere to go if one does not have exactly 55 in gunshooting
  • the else might stumble over the flavor text. is this the only option that leads to the amnesia label?

#4

The #shoot will have an *else that leads to and amnesia label.
Wait, now it passed.


#5

try replacing the ifs with

*if (gunshooting >=55)
*if (focus >=60)

respectively and see how it fares then.

If the error still pops up, try replacing the elses with

*if (gunshooting <55)
*if (focus <60)

#6

That’s not a bug. The problem is that your *goto statement was walled off behind the *if statement. So when a value other than 55 came along, it couldn’t reach the *goto and simply fell through to the #choice beneath.


#7

Okay so I know there is another topic with this name, but I don’t have much of a choice (I couldn’t possibly waste an opportunity for a good pun at a time like this).

… I’ve searched everywhere. Tried everything I could think of. As far as I know, my code is great.

But this error keeps popping up:
THIS%20BUG%20WONT%20LEAVE%20ME%20ALONE%20%20%3B'(

(“chapter2 line 137: It is illegal to fall out of a *choice statement; you must *goto or *finish before the end of the indented block.”)

I’ve taken out all the stuff I’ve written to make the little excerpt a lot shorter (easier to go through). If someone could take a look to see what I’m doing wrong, I would greatly appreciate it. Because I’m dyin’ over here :upside_down_face:

*choice
   #CHOICECHOICECHOICECHOICECHOICECHOICECHOICECHOICE
      THIS IS A CHOICE WAHOO
      *choice
         #Absolutely!
            *if Acrobatics > 4
               *if (peterscat=true)
                  MISSION SUCCESSFUL YAY
                  
                  *goto thepath2
                   
               *else
                  MISSION SUCCESSFUL YAY 2
                           
                  *goto thepath2
                      
            *if Acrobatics < 4
               *if (peterscat=true)
                  FAILED THINGY
                       
                  *goto thepath2
                       
               *else
                  FAILED THINGY 2

                  *goto thepath2
           
         #THIS IS THE LINE THAT KEEPS BUGGING OUT 
            *if (peterscat=true)
               HASCAT
               *goto thepath2
            *else
               NOCAT
               *goto thepath2
                              
   #CHOICE DENIED
      BORING 
      *goto thepath2


*label thepath2
THE PATH YAY

I’ve been stuck on this problem for about a week trying different things. The best I’ve done is just put another bug in its place because i was feeling frustrated and sassy. I’m sick of losing progress and losing motivation over it…


#8

Just to make certain it isnt this:
Remove the free lines in the entire choicebody.


#9

thanks for trying @MeltingPenguins but I still got the error… even after overdoing it and getting rid of all of the free lines in the entire document, it still pops up.
Mocking me. Goading me into smashing my laptop violently against the very internet itself. It knows no such thing as mercy. It is relentless in its determination to infuriate me beyond all meaning.


#10

Try replacing the else with

*if (thing false)

Like

*if (thing)
   Thing true
   *goto here
*if (thing false)
   Thing false
   *goto here

#11

It’s possible that the error is not on the line that’s reporting a problem.

Looking at the option that reads #Absolutely!, I see the code can handle a player whose character has more than 4 acrobatics (see: *if Acrobatics > 4). And I see the code can handle a player whose character has less than 4 acrobatics (see: *if Acrobatics < 4). But the game cannot proceed if the player’s character has exactly 4 acrobatics. There’s simply no code for that possibility.

Try replacing *if Acrobatics < 4 with *else.

I’ll examine the rest of the sample in more detail now. Maybe there’s something important I’m overlooking.


#12

Or turn one qualifier to either => (equal or higher) or =< (equal or lower)
Might be that its <=/>= im not certain


#13

@Minnow i am not an emotional person but you make me want to cry with joy

IT WORKS

thank you and thank you @MeltingPenguins as well

how did i never think of this…

thank you so much seriously :heart::sob::heart:


#14

The pair is >= and <=.

I suggested *else not because it has any different effect, but simply because ChoiceScript isn’t as clever as an actual person, and I wanted to make sure the game knew, without a doubt, that all alternatives were accounted for. It 100% should work fine with <= or >=, but I’d want to test it before I trusted it, if that makes sense?

Hooray!


#15

<3

yeah, but i saw it that else seems to ignore a goto after a flavortext sometimes. You cant win with this thing at times shruggage