*labels in choices

I’m looking to try and streamline a bit of code. In a simple example it currently goes like this (sorry for the horrible formatting, I had to copy and paste from notepad in the end.)

*label STARTLABEL
Would you like some fruit?
*choice
	#1 BANANA
		You sure?
		*choice
			#Yes
				*goto ENDLABEL
			#No
				*goto STARTLABEL
	#2 ORANGE
		You sure?
		*choice
			#Yes
				*goto ENDLABEL
			#No
				*goto STARTLABEL
	
*label ENDLABEL

What I would like to be able to do is rather than saying No after an “Are you sure?” is to offer one of the other choices and then go to that are you sure dialogue. So it would go :
Would you like some fruit -> Banana -> Are you sure -> Yes/Actually how about an orange with the latter bit of the last one then going to another Are you sure -> Yes/Actually how about a ?

Unfortunately any labels created within the choice are not recognised.

Now I could just copy and paste the code and have another nested choice offering the other options. But I have 4 choices and that’s a lot of duplication. And what happens if they want to check out all four options, suddenly that’s 4 deep and way too much code duplication.

Is there any way to jump to another option within a choice? I’m realising after typing this all up that it could cause a loop which breaks a quicktest so maybe it’s NOT possible but can anyone think of a tidier solution to doing this?

edit: too much clicking backwards and forwards when presented with 4 choices and yes no. Need a better structure and thinking if you don’t have to “click back” to the menu i’ve just halved the number of button presses and hopefully halved how annoying people find it!

That certainly shouldn’t be the case. This ought to work just fine:


*label STARTLABEL
Would you like some fruit?
*choice
	#1 BANANA
        *label banana_choice
		Banana.  You sure?
		*choice
			#Yes
				*goto ENDLABEL
			#No, orange please.
				*goto orange_choice
	#2 ORANGE
		*label orange_choice
        Orange. You sure?
		*choice
			#Yes
				*goto ENDLABEL
			#No, banana please.
				*goto banana_choice
4 Likes

Hmm maybe I’ve got an indent wrong somewhere then. I’ve deleted the code already but I’ll retry and let you know. Thanks for the (scarily) quick response times people :slight_smile:

Yup! It works. Wow that just saved me literally hours of jumping down the wrong rabbit hole. Thank you so much for your help :smiley:

1 Like

Happy to help. :slight_smile: +20

4 Likes