Game ending prematurely

Hi all, can anyone please kindly remind me what might cause a game to end prematurely?

Not to bug out with an error message, but to finish, showing show the Play again choice.

A brainstorm of any ideas would be helpful, as it could be caused by a number of things (likely connected to a bad sub-routine), and your ideas will help me work out where to look. For example, has anyone seen this occur with *return?

Annoyingly, this wasn’t picked up by the testing tools, I guess because the game ‘successfully’ ended?

(ps I’m not intending to post the sub-routine unless I have to because its long and boring, and multiple parts of the code would likely raise question marks : )

Is the subroutine in your final scene? If so, a misplaced *return might be causing the game to go straight to a *finish point. But as ever, hard to say without seeing the code…

5 Likes

Most commonly it’s what’s said above or indentation gone wonky that quicktest does not recognize as off.
A free paragraph in an if/if/if tree or if/else tree without correct indents can cause it, too

1 Like

No it isn’t

(thanks for the good suggestion)

How might a free paragraph be indented?

The same as the rest of it.
Like (gonna work with dots here)

Text
*if thing
...text
...text
...free line
*if not thing
...text
...free line
*finish

So yeah, could you show us the code?
The bit for what we see in thd screen will do

1 Like

Brainstorm may be easier! But okay, here it is. I appreciate the help.

Starting text file ‘Daneway’:
(This *sets a load of things for the next file)

	
*label arrival
*set region_path "destiny"
*set storylet_1_present true
*set storylet_1_signpost "I stumble upon an empty rodar camp."


*gosub_scene phrase_territory_phrases

*if daneway_known
	*gosub_scene operation_pc_page_title chapter_title
	
	*gosub_scene phrase_territory_phrases publish_generated_phrases
*if daneway_known = false
	*set daneway_known true


	*gosub_scene chapter_12_worlds_apart__hollo daneway_intro


*comment Setting glyfwalk directions

*set glyfwalk_1 "Northwest to Platbethuk, ${platbethuk_description}."
*set glyfwalk_1_territory_destination "territory_arantia_unabethuk_platbethuk"

*set glyfwalk_2 "North to Shaa, ${shaa_description}."
*set glyfwalk_2_territory_destination "territory_weg_vortlights_shaa"

*set glyfwalk_3 "Southeast to Platlonquin, ${platlonquin_description}."
*set glyfwalk_3_territory_destination "territory_arantia_unalonquin_platlonquin"

*set glyfwalk_4 "South to Laklung, ${laklung_description}."
*set glyfwalk_4_territory_destination "territory_arantia_unabethuk_laklung"

*set glyfwalk_5 "West to Laramie Plains, ${laramie_plains_description}."
*set glyfwalk_5_territory_destination "territory_lydia_aden_laramie_plains"

*set glyfwalk_6 ""
*set glyfwalk_6_territory_destination ""

*set glyfwalk_7 ""
*set glyfwalk_7_territory_destination ""

*set glyfwalk_8 ""
*set glyfwalk_8_territory_destination ""

*goto_scene operation_glyf_travelling

*label learn_more
*gosub_scene chapter_12_worlds_apart__hollo daneway_learn_more
*set {(area_territory_code&"_learned_more")} true
*return

*label storylet
*set storylet_1_signpost ""
*set {((((area_area_code&"_")&area_region_code)&"_")&area_territory_code)&"_storylet_1_read"} true
*gosub_scene chapter_12_worlds_apart__hollo daneway_giants


The above populates this (abbreviated) section of text file ‘Glyf-walking’:

  • The ‘storylet_1_present’ variable is now true and the choice says “I stumble upon an empty rodar camp.” which is the storylet_1_signpost set above
  • We then travel to the text of the ice giant attack storylet via the *gosub_scene
  • Then return at the end of the storylet
*label glyf_travelling
*set glyfwalking false
*if pashar_warning = 2
	*set pashar_warning 3
*if pashar_warning = 1
	*set pashar_warning 2
*if reader_has_read_all_iterations_of_12
	*goto_scene chapter_13_to_those_who_work__you

*if choice_quicktest
	*set area_area_code "two_kingdoms"
	*set area_region_code "riverrun"
	*set area_territory_code "waybrook"
	*set region_path "humanism"
	*set glyfwalk_1 "North to Fleece, ${fleece_description}."
	*set glyfwalk_1_territory_destination "territory_two_kingdoms_crownscourt_fleece"

*choice

	*if ((storylet_1_present) and ({(((((area_area_code)&"_")&area_region_code)&"_")&area_territory_code)&"_storylet_1_read"} = false)) #${storylet_1_signpost} 
		*gosub_scene {((((("territory_"&area_area_code)&"_")&area_region_code)&"_")&area_territory_code)} {(storylet_variation&"storylet")}
		*set storylet_variation ""
		*goto glyf_travelling


Now the storylet can be selected. Here is the end of the passage I screenshotted.
text file Chapter 12:
(the *label the above leads to is a few pages up and not included here)

*set important_choice false
*label 12051501
*set label_tag 12051501
*if (((reread = false) and (skip_forward)) and (important_choice = false))
	*goto_scene operation_reread_skip_forward skip_unimportant_text_and_choices
*if (((reread = false) and (skip_forward)) and (important_choice))
	*gosub_scene operation_reread_skip_forward read_important_choice
*gosub_scene operation_reread_skip_forward every_page
*gosub_scene operation_pc_page_title pc_2_current_pc_hollo_month_rsonith_year_1149_open_world

*if ((reread = false) and (discovered_nor = false))
	*if discovered_nor = false
		*achieve unlocked_lore_nor
	*set discovered_nor true
*if giant_fight != "run"
	Six turan dart past you to engage your assailants, muted cloaks the colour of the stone fluttering behind. 

Until their ambush, the newcomers had been as hard to notice as the nor. Light fails to escape the glyf streaming over their scales, making it harder to gauge the shadows' movements even as they each lob clay pots of glyf-stone at the 
*if giant_fight = "run"
	three 
*if giant_fight != "run"
	two surviving 
giants. 
*if giant_fight != "run"
	The one you'd wounded is destroyed in a parabola 
*if giant_fight = "run"
	Two are destroyed, screaming, in a parabola 
of green flame. But the third one escapes, melting into the ice, and the explosive jars thrown at it roll harmlessly on the soft snow where it had been moments before. 

Gathering into a small knot, spears pointed out towards innocuous-looking snow drifts, the six observe the landscape silently. The patrol only relaxes when one points at the retreating giant, surfacing some furlongs distant.

Two of the turan approach the wounded feaclaw, while a third questions to you. "Where did you come from traveller? That was quite some show
*if giant_fight != "run"
	of defiance."
*if giant_fight = "run"
	of speed."
The female looks to the snowy grey feaclaw, taking it's bloodied halter. 
*if end_giant_fight != "kill each other"
	"You saved a snowbred. The rodar will thank you."

You're grateful for the escort when the six shadows stay with you, going as far as their patrol area allows. When they depart once more, they point out a safer path. The suggested way is lower, though more circuitous, calculated to avoid lingering patches of snow. 

[i]Don't stay in Daneway,[/i] your rescuers warn. [i]Nor don't travel together often, as they are cannibals and prey upon one another. But where there are two or three together, there are always more.[/i]
*set chapter_twelve_destiny_path_survival_dance "I dance a moment of danger—three Nor giants in the snow."
*if reread = false
	*set pc2_survivalism + 1
*if (skip_forward = false)
	*return
*label skip_12051501

This is where the error occurs.

The *return there sends it back to text file ‘Glyf-walking’. The file ends like this (I’ve cut a load of choices out of the middle due to hitting the character limit!)

*label glyf_travelling
*set glyfwalking false
*if pashar_warning = 2
	*set pashar_warning 3
*if pashar_warning = 1
	*set pashar_warning 2
*if reader_has_read_all_iterations_of_12
	*goto_scene chapter_13_to_those_who_work__you

*if choice_quicktest
	*set area_area_code "two_kingdoms"
	*set area_region_code "riverrun"
	*set area_territory_code "waybrook"
	*set region_path "humanism"
	*set glyfwalk_1 "North to Fleece, ${fleece_description}."
	*set glyfwalk_1_territory_destination "territory_two_kingdoms_crownscourt_fleece"

*choice

	*if ((storylet_1_present) and ({(((((area_area_code)&"_")&area_region_code)&"_")&area_territory_code)&"_storylet_1_read"} = false)) #${storylet_1_signpost} 
		*gosub_scene {((((("territory_"&area_area_code)&"_")&area_region_code)&"_")&area_territory_code)} {(storylet_variation&"storylet")}
		*set storylet_variation ""
		*goto glyf_travelling


	*if not (((choice_randomtest) or (reread)) or (skip_forward)) 
		#Menu.
			*gosub_scene operation_menu
			*gosub_scene operation_reread_skip_forward every_page
			*if (((reread = false) and (skip_forward)) and (important_choice = false))
				*goto_scene operation_reread_skip_forward skip_unimportant_text_and_choices
			*goto already_there
	*if (reread) 
		#Return to page ${p}.
			*goto_scene operation_reread_skip_forward return_to_page_choice


*label already_there
You're already in ${area_territory}.
*goto glyf_travelling
*finish

So the file shouldn’t be able to reach the *finish. None of this will be particularly clear without time and the full file, which doesn’t fit here due to size (the last file unabreviated is 28,000 characters).

Anyway…assuming no-one wants to go into that.

Can I ask about the free paragraph suggestion? I didn’t quite understand - what is causing the error there? Sorry I’m slow on the uptake.

Did you show a problematic example, or a correct example of indentation?

I dunno what exactly is causing it, but i had it that an unindented free line in an indented block caused the text to fall through everything as it skipped everything up to the next suitable command

1 Like

Ah, I see, that’s interesting. I’ll check through to see if anything in the glyfwalking text file might be causing that.

Good luck

1 Like

Okay. I’m assuming that can’t be happening here, I’ve removed unindented spaces in that file and inserted another bit of text BUG at the end of the file. ‘BUG’ doesn’t appear when the error reoccurs.

Might be a combination or the error is elsewhere.

Mnnn… which bit is the line in thd screenshot?

This bit

[i]Don't stay in Daneway,[/i] your rescuers warn. [i]Nor don't travel together often, as they are cannibals and prey upon one another. But where there are two or three together, there are always more.[/i]
*set chapter_twelve_destiny_path_survival_dance "I dance a moment of danger—three Nor giants in the snow."
*if reread = false
	*set pc2_survivalism + 1
*if (skip_forward = false)
	*return
*label skip_12051501

Which is part of sub-routine that goes back this bit of a larger file.

*label glyf_travelling
*set glyfwalking false
*if pashar_warning = 2
	*set pashar_warning 3
*if pashar_warning = 1
	*set pashar_warning 2
*if reader_has_read_all_iterations_of_12
	*goto_scene chapter_13_to_those_who_work__you
*if choice_quicktest
	*set area_area_code "two_kingdoms"
	*set area_region_code "riverrun"
	*set area_territory_code "waybrook"
	*set region_path "humanism"
	*set glyfwalk_1 "North to Fleece, ${fleece_description}."
	*set glyfwalk_1_territory_destination "territory_two_kingdoms_crownscourt_fleece"
*choice
	*if ((storylet_1_present) and ({(((((area_area_code)&"_")&area_region_code)&"_")&area_territory_code)&"_storylet_1_read"} = false)) #${storylet_1_signpost} 
		*gosub_scene {((((("territory_"&area_area_code)&"_")&area_region_code)&"_")&area_territory_code)} {(storylet_variation&"storylet")}
		*set storylet_variation ""
		*goto glyf_travelling

Mnnn… the indents in the choices leading there are all correct?
There’s no chance it wont fall through at a choice?

Hiya,
It was incorrectly falling out of nested sub-routines (only one *return where 2 were needed),
and doing so on a text page that was not a listed chapter in startup,
therefore ending the story,
:mag:and proving it was professor plum in the conservatory, with the :dagger:

1 Like

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