QuickTest fail (illegal to fall out of *choice error)

So, I’ve run the quick test before and never had this issue until recently. The file in question hasn’t been changed in a long while so I’m not sure why this is an issue now.

The quick test fail states that the code is attempting to fall out of a *choice statement without a *goto or *finish or the like, but that’s simply not true. The *Choice code is extremely simple and straightforward so I can’t figure out why it’s tripping up the quick test.

*choice
	#Go to the Galaxy Map
		*gosub_scene routines event_roll
		*if (event_chance <= 80)
			*goto_scene Galaxy_Map

		*elseif (event_chance >= 81)
			*rand event_choice 1 2
			*label event_reroll

			*if (event_choice = 1)
				*if (roy_and_rebel_event = 0)
					*set roy_and_rebel_event 1
					*set num_events_visited +1
					*goto_scene interaction_events roy_and_rebel_event
	
				*elseif (num_events_visited < 2)
					*set event_choice +1
					*goto event_reroll

				*else
					*goto_scene Galaxy_Map

			*if (event_choice = 2)
				*if (roy_and_penelope_event = 0)
					*set roy_and_penelope_event 1
					*set num_events_visited +1
					*goto_scene interaction_events roy_and_penelope_event
	
				*elseif (num_events_visited < 2)
					*set event_choice +1
					*goto event_reroll

				*else
					*goto_scene Galaxy_Map

			*elseif (num_events_visited < 2)
				*set event_choice 1
				*goto event_reroll

			*else
				*goto_scene Galaxy_Map
	#Go to the Cargo Bay
		You head inside the ship's elevator and select "Cargo Bay." Once the elevator doors close, you feel the slight shift as it begins descending.
		*goto_scene cargobay
	*selectable_if (demo_version = false) #Talk to Penelope
		*goto_scene Penelope
	*selectable_if (demo_version = false) #Talk to Argile
		*goto_scene Argile
	*selectable_if (demo_version = false) #Talk to Roy
		*goto_scene Roy

The error is for the choice “Go to the Cargo Bay”. As you can see, it’s pretty basic, there’s a short description following the choice and a *goto_scene right after. And yes, the file for that scene exists.

If I delete that choice segment and run the quick test, the test succeeds, no errors. The indentation is all fine, I’ve typed it and retyped it to check… but it fails every time. I haven’t yet tried moving the choice’s position in the order but it really shouldn’t matter if I did, right?

Am I missing something obvious?

		*elseif (event_chance >= 81)
			*rand event_choice 1 2
			*label event_reroll

Try changing the *elseif (event_chance >= 81) here to just *else?

5 Likes

That isn’t where I get the error from though. it’s this:

When I delete that choice segment (and only that choice segment) the error disappears.

Why did that work…?

If you use *if and *elseif the last possibility should be *else

So for example…(ignore formatting as quickly written on my phone)

*if (this)
Go here
*goto here
*elseif (that)
*goto there
Go there
*else
Stay where you are.
*goto nowhere

5 Likes

As I understand it, *else basically tells Quicktest, ‘This is the catch-all for all other options’. (For instance, what if event_chance = 80.5? Quicktest doesn’t know that it can’t.)

1 Like

OOOOOH I’m just stupid… *elseif checks for a *goto for both a pass and a fail of the “if”… so if I don’t have a *goto at some point on both sides of that pass/fail check, it’ll cause an error… Idk why I didn’t realize that before.

1 Like

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