I’m having trouble with quicktest failing although the code works
the error i get is “QUICKTEST FAILED
Error: boat line 204: It is illegal to fall out of a *choice statement; you must *goto or *finish before the end of the indented block.”
This is the code that is apparently wrong:
#Grab the monkey
Seizing the initiative you leap from your chair and rush towards the monkey. He rushes towards you and two primates lock together in battle.
*choice
#Fight
*goto monkey_fight
*if (instant_win = true) #Instant Win
*goto win
Quicktest is not failing for the followibg code though, which is the same:
Many thanks, here is the code before that. Grab money is 204
*if (gun = true) #Shoot the monkey
*if (bullets_number > 0)
*goto monkey_gun
*if (bullets_number = 0)
*goto click
#Grab the monkey
Seizing the initiative you leap from your chair and rush towards the monkey. He rushes towards you and two primates lock together in battle.
*choice
#Fight
*goto monkey_fight
*if (instant_win = true) #Instant Win
*goto win
In fact there are a lot of options in this section, I can paste the entirity of code if that is useful? (428 lines!)
*choice
#Grab banana from fruit tray
You have the banana in your hand and the monkey looks in your direction. It starts capering towards you as diners rush to get out of it’s way.
*choice
#Throw banana out of porthole
*set porthole true
You wave the banana enticingly at the monkey and maneuver towards a porthole. You open it with one hand while you continue to coax with the other. The transfixed monkey moves ever closer and at the last minute you throw the banana out of the porthole. The monkey leaps to follow and seconds later a splashing sound confirms that he has fallen into the icy waters.
*line_break
Some of the occupants of the dining room frown and turn away, others boo and you can hear cries of “For shame”. The band ironically play a few bars of the funeral march. The man in the safari suit looks disconsolate. The man in black continues to stare at you, a faint smile on his lips.
*label violinist
The violinist is reunited with his instrument and the band play on. The man in dark glasses continues to stare fixedly at you throughout. After coffee has been served at the end of the meal some space is made for dancing. Something draws your attention to the far side of the dining room. You notice the bald headed man from the lecture hurriedly leaving through a door. A flash of silver from his wrist confirms to you that it is the same man!
*choice
*if (monkeyfight = true) #Ask Lady Jane to dance
"I'm sorry Jack but watching you beat that monkey senseless in the middle of the dancefloor hasn't really put me in the mood for a dance. I guess it's a lesson for us all really. We think we are better than the animals, but I wonder if we aren't worse?"
You apologise.
*choice
*if (nomap = true) #Return to cabin
*goto cabinnormal
*if (mapsafe = true) #Return to cabin
*goto cabinransacked
*if (mappocket = true) #Return to cabin
*goto cabinpocket
*if (porthole = true) #Ask Lady Jane to dance
"I'm sorry Jack but watching that monkey fall to it's lonely death in cold, dark waters hasn't really put me in the mood for a dance. I guess it's a lesson for us all really. The dangers of fixating on something and how that can blind us to other dangers and opportunities."
You apologise.
*choice
*if (nomap = true) #Return to cabin
*goto cabinnormal
*if (mapsafe = true) #Return to cabin
*goto cabinransacked
*if (mappocket = true) #Return to cabin
*goto cabinpocket
*if (monkeybrain = true) #Ask Lady Jane to dance
"I'm sorry Jack but watching you blow that monkeys brains out hasn't really put me in the mood for a dance. I guess it's a lesson for us all really. Would we fare any better if a more advanced race took us prisoner and transported us into an alien environment we couldn't possibly understand or be equipped for?"
You apologise.
*choice
*if (nomap = true) #Return to cabin
*goto cabinnormal
*if (mapsafe = true) #Return to cabin
*goto cabinransacked
*if (mappocket = true) #Return to cabin
*goto cabinpocket
*if (cloche = true) #Ask Lady Jane to dance
You take Lady Jane’s hand and escort her to the dance floor. The feel of her hand in yours is not dissimilar to the feeling you get when a rare treasure is in your palm. The gentle swell of the ship and of the music transports you and all too soon the evening is at an end. As you leave the dancefloor you catch sight of a small yellow tattoo on Lady Jane’s right shoulder. It looks like a dragon.
Lightheaded you make your way back along the swanky hallways, occasionally breaking into dance when you are sure the path is clear.
*choice
*if (nomap = true) #Return to cabin
*goto cabinnormal
*if (mapsafe = true) #Return to cabin
*goto cabinransacked
*if (mappocket = true) #Return to cabin
*goto cabinpocket
#Intimidate the man in dark glasses
You pull up a seat opposite the man in black. He continues to stare forward. You lean in and start to speak.
“Now listen here, you have stared at me all evening. Don’t think I am intimidated by you because I am not. I don’t know what kind of game you think you are playing but it wont work on me.”
Jabbing a finger in his chest for emphasis you end with:
“Do” (jab) “You (jab) “Understand?” (jab)
He opens his mouth to reply but before he speaks a figure behind him gently places a hand on his shoulder. A young lady carefully takes his arm and helps him up. She then bends down and picks up his cane from the seat of the chair next to him.
“Did you have a nice evening Grandfather?”
A tear runs down his cheek and she dabs it away with her handkerchief.
“There, there PopPop we all miss Grandmama”
she says and leads the blind man away.
Your ears fill with a whistling sound and your face burns with shame. You rush from the dining room and along the hallways to your room.
*choice
*if (nomap = true) #Return to cabin
*goto cabinnormal
*if (mapsafe = true) #Return to cabin
*goto cabinransacked
*if (mappocket = true) #Return to cabin
*goto cabinpocket
#Chase after the bald man
The dance floor is starting to fill as you wind your way to the other side of the dining room past tables of diners drinking coffee and couples making their way to the dance floor.
Finally you reach the door on the other side and go through. The door swings open to a quite narrow promenade deck with a white safety railing. The sea air is cold and bracing, the wide black sea stretching out forever. You hear the muffled sounds of the band striking up inside. Two masked figures dressed in black emerge from their concealment in the shadows behind you. One jams the door shut with a wedge and the other taps a sap back and forth into his hand.
“We wouldn’t want to be disturbed now would we”
says the figure with the sap before swinging at you.
You must fight the
*line_break
[b]Hired Goons[/b]
*line_break
[b]Skill 5 , Stamina 7[/b]
*choice
#Fight
*goto goon_fight
*if (gun = true) #Use gun
*if (bullets_number > 0)
*goto set_bullet_damage
*if (bullets_number = 0) #Use gun
*goto click1
*if (instant_win = true) #Insta Win
*goto goonwin
#Use banana with cloche
*set cloche true
You grab a dining cart from a nearby waiter on his way back to the kitchen. He has become transfixed by the unfolding horror. Taking the huge metal domed plate cloche in one hand, you place the banana on the cart and push it gently towards the gibbering simian. Keeping your distance you watch as the monkey cautiously climbs onto the cart and grabs the banana. Sitting happily on the trolley he peels it slowly and you creep round so you are behind him. The entire dinning saloon holds its breath as you get close enough to slam down the cloche. A clang proclaims your success as the annoying anthropoid is trapped under the dome!
With one hand on the lid and the other on the trolley you wheel the ape entree over to the keeper. When he has safely taken over the lid and the trolley you relinquish your grip. The flustered keeper thanks you profusely and gives you a lucky rabbits foot as thanks.
*set empty_inventory false
*set rabbitsfoot true
*set luck+1
[i]Your luck is increased by 1 [/i]
As you return to your table the keeper realises his predicament as to how exactly he is going to progress from here. Fortunately that isn’t really your problem. You return to your table to the sound of clapping and the warm smiles of your companions.
*goto violinist
#Throw banana at monkey
The banana lands at the monkeys feet. He picks it up and eats it calmly and then looks at you for more. With none forthcoming he capers towards you through fleeing diners until eventually leaping on you in a rage.
*choice
*if (instant_win = true) #Instant Win
*goto win
#Fight
*goto monkey_fight
#Wave banana enticingly
You wave the banana at the monkey in a beckoning fashion. It leaps onto you in a rage.
*choice
*if (instant_win = true) #Instant Win
*goto win
#Fight
*goto monkey_fight
*if (gun = true) #Shoot the monkey
*if (bullets_number > 0)
*goto monkey_gun
*if (bullets_number = 0)
*goto click
#Grab the monkey
Seizing the initiative you leap from your chair and rush towards the monkey. He rushes towards you and two primates lock together in battle.
*choice
#Fight
*goto monkey_fight
*if (instant_win = true) #Instant Win
*goto win
#Do nothing
As you are deciding what to do you mistakenly catch the monkey's eye. You look away but you know it is too late. The enraged monkey bounds towards you, leaping tables and cowering diners until it is on you.
*choice
*if (instant_win = true) #Instant Win
*goto win
#Fight
*goto monkey_fight
*label monkey_fight
[Quicktest automatically plays through the code as a normal player would, but when encountering a *choice statement or an *if statement, Quicktest makes multiple copies of itself and attempts to run them. (The copies run one at a time; for example, we test the true lines of an *if statement before we test the *else lines.)
To save time, Quicktest “cheats.”
…
But Quicktest “cheats” in another way, too, by testing both sides of *if statements even if the lines are not actually possible for a player to reach. This can cause Quicktest to identify “fake” bugs: bugs that can’t actually happen in real life.](https://www.choiceofgames.com/make-your-own-games/testing-choicescript-games-automatically/)
Looks like it tried to test for bullets_number < 0.
Many thanks, I see how you have used *else to fix this and in fact fixed some other similar errors in my new code because of the same basic concept explained in your post
Everytime I think I am getting better something else trips me up!
Having said that, tiredness creeps in because I found one error where I forgot to type *choice
Cheers and Thanks! No more coding for me now until next weekend!