Quicktest error that isn't an error?

I’m having trouble with quicktest , I am running it via CSIDE.
I am getting the error
QUICKTEST FAILED
Error: lecture line 70: It is illegal to fall out of a *choice statement; you must *goto or *finish before the end of the indented block.

The code works though and I can’t see anything wrong:

			#Downstairs
				*goto downstairs

The fuller version is this

#Ask lecturer a question
		You push your way to the front of the crowd and the professor agrees to take one more question before he leaves. “You mentioned that the Tanzanian location may have been explored previously?” “Yes indeed, Randolph Marsh was the inspiration for our Himalayan quest and he did subsequently travel also to Tanzania”.
		*choice
			#Go to bar
				*goto bar
			#Go upstairs
				At the top of the stairs is a statue of Pixiu, a lions head with a dragons body. You stroke it’s head down to the tail for luck. To the left is the club’s museum and to the right the shop. It’s shutter is up and it is open for business.
				*choice
					#Museum	
						*set museum true
						The adventurers museum is utterly chaotic. Stuffed birds, flying animals and various mobiles hang from the ceiling. The walls are covered in maps, charts, paintings and photographs and everywhere are glass cases and shelves loaded with discoveries and equipment. It is a tribute and a treasure trove, albeit in need of a good dusting and proper cataloging. You rapidly scan the cases and soon you find one labeled Randolph Marsh. In the case is a blowgun and dart, a pith helmet with an arrow sticking out of it and what looks like a dried apple of some kind.
						*choice
							#Examine blowgun
								*set map true
								*set empty_inventory false
								The blow gun has been decorated beautifully with intricate patterns of butterflies and flowering vines. Holding it up to inspect the bore you are surprised to see that there is a roll of paper inside! With a puff the rolled up paper is shot from the gun and you retrieve it. On unraveling it you can see that it is a map! In a spidery script is written “The Forbidden City”. Before you can take in any detail you can hear someone coming up the stairs. You quickly put the map in your inside pocket and stand in front of the case with your back to the stairs, hoping this covers your movements as you put the blowgun back. A bell rings. The club will be closing soon.
								*choice
									#Shop
										*gosub shop
							#Examine apple
								The apple has a leathery feel and is pleasantly squashy. As you turn it in your fingers you feel some rough stitches. You look closer and a small face looks back at you, the eyes and lips of the shrunken head sewn shut. You return him to the case and make a note to wash your hands as soon as possible. A bell rings. The club will be closing soon.
								*choice
									#Shop
										*gosub shop
							#Examine helmet
								You turn the pith helmet upside down and look inside. The tip of the arrow has just pierced through. Undoubtedly this helmet saved the life of the wearer. A bell rings. The club will be closing soon.
								*choice
									#Shop
										*gosub shop
					#Shop
						*gosub shop
			#Downstairs
				*goto downstairs

	#Follow the four

Are you using *choice or *fake_choice?

1 Like

I am using *choice
It works in the game, it takes me to the bit I labelled downstairs
I do have the same label in the previous scene but I cant think that makes any difference?

I’m sure this isn’t the case but is the double line breaks intended?

			#Downstairs
				*goto downstairs

	#Follow the four

Otherwise, I’m not CS-IDE user so I can’t really tell what is happening.

@Jonnysaxc Are you using implicit control flow? If you have the latest version of ChoiceScript (which you should with CS-IDE), try going to your startup file and writing *create implicit_control_flow true (this is a function that the author of Choice of Robots, @kgold, developed that’s helped me tremendously with those pesky ‘falling out of choice statement’ errors). See if that helps!

2 Likes

I don’t think the problem is the #Downstairs option but the others where you head to the shop – try adding *goto after each *gosub, since when it returns from *label shop there are no *goto at the end of the indented blocks for the game to continue.

1 Like

Many thanks, I added the implicit control and that seemed to work, then randomtest got stuck in a loop. I have run it again and the fall out error has returned.

It’s really hard to use cside once you have started in Notepad ++, I am only using it because I don’t know how to test without it

I am not sure what I am going to do now

I copied your code to my file and tried to run tests.

  1. #Ask lecturer a question and #Follow the four have different indentation when they shouldn’t. I don’t know if it’s like this in your file or just a result of copying the code in the comment and the 1st line having the wrong indent as a result.
  2. The problem lies in all those options with *gosub shop commands. After I added *goto commands after them, test was passed.
    Currently, some options in your code are like this:
#Examine helmet
    Text about helmet.
    *choice								 
        #Shop
	    *gosub shop

The program goes to *label shop, does its thing, returns, and doesn’t know where to go next.
These options should be more like this:

#Examine helmet
    Text about helmet.
    *choice								 
        #Shop
	    *gosub shop
            *goto where_to_go_after_shop

Why do you need choices with 1 shop option, I don’t know.
Hope that helps.

Many Thanks all again, the error was because I used gosub and not goto
As pointed out, gosub will return and this is not correct

1 Like

This topic was automatically closed 24 hours after the last reply. If you want to reopen your WiP, contact the @moderators.