Elseif error (cannot fall into else)

"How..how long was I out?" you ask.

She points behind you. You turn and see a shaky row of fifteen tiny scratches on the wood of the cot. "You made those, one each day."

You grasp her hand. "Thank you" you say.

*if take_tyres
	"Oh don't thank me, I don't have much else to do anyway. If you really want to thank someone it should be that fellow you came here with"
	
	"Tyres?" you ask surprised.
	
	"Is that his name? I never bothered asking. He came in here every chance he could and helped me, even shared half his rations so you wouldn't stave. And trust me, they don't give much around here. Said you he owed you."
*elseif take_tyres = false
	She cackles. "You think this was free? Salves and bandages don't grow out of the sand. You owe Mama Jay now."
	*goto walking_to_arena_no_whip

*label walking_to_arena_no_whip
You eat some cold food and return to bed. Hours later you wake up feeling rested and step out into the sun.

The fire beats down across your back immediately, sweat picks your skin and dampens the bandages. You look around but it seems you're alone out here. All the tents are empty. A slave runs past you, scampering downhill. 

I keep getting this error: It is illegal to fall in to an *else statement; you must *goto or *finish before the end of the indented block.

Any ideas why?

at the end of the *if take_tyres thereā€™s no *goto, it skips directly to the *elseif

Yup. Because you canā€™t fall into on else (which apparently also counts for an elseif) statement. Either end the block of text below the if statement with a goto or finish or change the elseif to an if. (Because you are allowed to fall in to an if statement.)

Thanks! fixed it (twentyyyyyyy)

Umm, not to be rudeā€¦ But itā€™s spelled Tires, not tyres.

P.S. Good way to find the correct pronunciation? Type the word in your search browser.

Just an FYI for other readers, thereā€™s actually two main ways to fix this:

*if foo
    true text
    *goto next
*else
    not true text
    *goto next
*label next

or

*if foo
    true text
*if (foo = false)
    not true text
*label next

@COGZealot Kinda a little rude, and youā€™re wrong. :-p (Seriously, never include ā€˜I donā€™t mean to be rudeā€™ or ā€˜Iā€™m not ___ butā€™ at the start of the sentence. All it does it put the idea that you are what youā€™re saying you arenā€™t in peopleā€™s minds.) (Oh, and, one of those things where you need to to exactly what you said.)

The intent wasnā€™t to be rudeā€¦ What did you think that I misspelled?

Guys Guysā€¦Tyres is the name of one of my characters, hence the capitalization. No harm done.

Also remember if using *elseif the last statement must be an *else

Really? I have other places where I ended with an elseif

Check the link above, just edited my post XD :slight_smile:

Did they pass randomtest, though? I had a terrible time with randomtest getting stuck for a while, until I realised it was because of not making sure to always end a string of mutually exclusive *ifs with an *else.

Yeah they do, they work fine, which is what confuses me.

*if take_tyres
	"Oh don't thank me, I don't have much else to do anyway. If you really want to thank someone it should be that fellow you came here with"
	
	"Tyres?" you ask surprised.
	
	"Is that his name? I never bothered asking. He came in here every chance he could and helped me, even shared half his rations so you wouldn't stave. And trust me, they don't give much around here. Said you he owed you."
	*goto walking_to_arena_after_recover
*elseif take_tyres = false
	She cackles. "You think this was free? Salves and bandages don't grow out of the sand. You owe Mama Jay now."
	*goto walking_to_arena_after_recover

This bit works fine

Yikesā€¦ Alright that is akward :laughing:. I apologize and hope that you all have a great weekend, Iā€™m out.

Thatā€™s interesting! Maybe because itā€™s not a choice sequence requiring *goto, and you could theoretically have done the same thing using @RETowersā€™s second example?

My frozen *ifs always revolved around redirecting after choices.

True, that section is standalone, it isnā€™t linked to a choice

Pretty sure that _should_nā€™t past random/quicktest. Thereā€™s a little more information on why thereā€™s requirements in the docs here. Basically itā€™s to prevent typos and ā€˜didnā€™t consider everythingā€™ errors.

@COGZealot http://grammarist.com/spelling/tire-tyre/

2 Likes

Tangential FYI, since itā€™s a name, but ā€œtyresā€ is the correct spelling of ā€œtiresā€ in British English.

I think it passed since it was a true/false. So I didnā€™t really need the elseif since there was only one other option