Error in this sequence of code? Or does *looplimit not work on reselection within a *choice sequence

Hi all, just putting this in a different thread to my other help thread here as I’m not sure if this is the only problem in this game.

I’ve resorted to testing the game choice by choice with an *ending command to try and see if I can work out why I’m getting seemingly random recursion errors. At the moment, I’ve got the game only playing through the first story and it’s jamming up on this sequence of code with a recursion error every time. If I end it just before or after this sequence the randomtest goes through. Can anyone see an issue in the code please? I’ve looked and cannot see a problem.

The only possible issue could be it’s looping back three times to the start of the code in this sequence (I tried putting in some extra labels to see if that’s help but hasn’t changed anything but a label change may not.) It’s got a looplimit of like 1000000 or something. Does the looplimit command no longer work? Or is there something I’ve missed in the code which is causing the error? Thanks.

*label afterattack

*set nsew "n"

*page_break
*if not(choice_randomtest)
	*image story1_header.png


Hastily, I gather up the elemental representations that have slipped from fingers now numb with cold. Though seeming like only a momentary distraction, a glance towards the sky shows differently. The stars have wheeled through their nightly passage overhead, indicating the gap of hours that have passed. Had I remained entranced for much longer, I may not have had time to complete the ritual at all. As it is, time is in distressingly short supply. 

 
*label objects  
*label objects1
*label objects3

*if (nsew != "n")
	*page_break
	*if not(choice_randomtest)
		*image story1_header.png

	
*disable_reuse

*if (nsew = "n")
	North is the highest of the cardinal points. For a working such as this, it must always be the first of the points to be set. A strong anchor for the rest of the working. Without delay, I pace to the north, stopping just short of an ancient, gnarled tree stump. 
	
	Hesitating, I decide to place the physical representation of...
*if (nsew = "s")	
	With a deep breath to steady my nerves, I walk next to the south where I place the element of...
*if (nsew = "e")	
	Now two objects lighter, I track to the east. On this night, it will belong to the element of...
*if (nsew = "w")	
	Finally, I walk to the last remaining cardinal point. Here will belong to...
	

*choice
	#Earth.
		*if not(choice_randomtest)
			*image story1_header.png

			
		*if (nsew = "n")  
			*set northobject "earth"
			*set nsew "s"
			North is to the Earth that lies both beneath my feet and towers high above to form the mountain ranges of my home. It is rough, strong and reluctant to be moved. It is here that I place a chunk of smoky white quartz almost as large as my fist, pushing it firmly into the dark soil while whispering a secret word of power. 
			
			
			*if (element = "earth")
				The air quivers as I brush the dirt form my hands. 
				*set firstplace "yes"
				
			*if (element != "earth")	
				The air quivers uneasily as I brush the dirt form my hands. 
				*set firstplace "no"
			
			*set n1 "Kal"
			
			*goto objects1
			
		*if (nsew = "s")
			*set southobject "earth"
			*set nsew "e"
			South is to the Earth that lies both beneath my feet and towers high above to form the mountain ranges of my home. It is rough, strong and reluctant to be moved. It is here that I place a chunk of smoky white quartz almost as large as my fist, pushing it firmly into the dark soil with a whispered syllable. 
			
			
			*if (firstplace = "yes")
				Brushing the dirt from my hands, I concentrate on the task ahead. Already there is power stirring beneath my feet.
				
			*if (firstplace != "yes")
				Brushing the dirt from my hands, I concentrate on the task ahead. Power stirs sluggishly beneath my feet.	
			
			*set n1 "Tyr"
			
			*goto objects1
			
		*if (nsew = "e")
			*set eastobject "earth"
			*set nsew "w"
			East is to the Earth that lies both beneath my feet and towers high above to form the mountain ranges of my home. It is rough, strong and reluctant to be moved. It is here that I place a chunk of smoky white quartz almost as large as my fist, pushing it firmly into the dark soil. 
			
			*if (firstplace = "yes")
				Brushing the dirt from my hands, I set it in place with a word and rise once more.
			
			*if (firstplace != "yes")
				Brushing the dirt from my hands, I set it in place with a word and rise with power chiming discordantly along my veins.
				
			*set n1 "Sh"
			
			*goto objects1
			
		*if (nsew = "w")
			*set westobject "earth"
			West is to the Earth that lies both beneath my feet and towers high above to form the mountain ranges of my home. It is rough, strong and reluctant to be moved. It is here that I place a chunk of smoky white quartz almost as large as my fist, pushing it firmly into the dark soil. Power sings as I utter the final words of the chant, creating a ghostly image in my mind's eye as it flows around the clearing. 
			
			*page_break [i]Quickly now, I must contain the energy and put it to use before it is lost.[/i] 
			
			*set n1 "Car"
			
			*goto drawcircle
	
		*goto drawcircle
	
	#Fire.
		*if not(choice_randomtest)
			*image story1_header.png
	
		*if (nsew = "n")  
			*set northobject "fire"
			*set nsew "s"
			North belongs to Fire, fickle and fierce. Both giver and taker of life, it is the most volatile and difficult to contain of the forces with which I work. Drawing a flint from my pocket, I strike with practiced fingers sending a shower of sparks onto the carefully prepared tinder. Blowing gently, it catches alight, quickly growing to crackle hungrily as it devours the dried branches and leaves. 
			
			*if (element = "fire")
				A flickering orange glow overwhelms the silvered light of the moon as I set the element in place with a word causing the flames to flare brightly in response.
				*set firstplace "yes"
				
			*if (element != "fire")
				A flickering orange glow overwhelms the silvered light of the moon as I set the element in place with a word causing the flames to flare brightly in response, though the fire simmers down to little more than embers as I move my hands away.
				*set firstplace "no"	
				
			*goto objects
			
		*if (nsew = "s")
			*set southobject "fire"
			*set nsew "e"
			South belongs to Fire, fickle and fierce. Both giver and taker of life, it is the most volatile and difficult to contain of the forces with which I work. Drawing a flint from my pocket, I strike with practiced fingers sending a shower of sparks onto the carefully prepared tinder. Blowing gently, it catches alight, quickly growing to crackle hungrily as it devours the dried branches and leaves. 
			
			*if (firstplace = "yes")
				A flickering orange glow overwhelms the silvered light of the moon as I concentrate on the task ahead. Already there is power stirring beneath my feet. 
			*if (firstplace != "yes")
				A flickering orange glow overwhelms the silvered light of the moon as I concentrate on the task ahead. Power stirs sluggishly beneath my feet.	
			
			*goto objects
			
		*if (nsew = "e")
			*set eastobject "fire"
			*set nsew "w"
			East belongs to Fire, fickle and fierce. Both giver and taker of life, it is the most volatile and difficult to contain of the forces with which I work. Drawing a flint from my pocket, I strike with practiced fingers sending a shower of sparks onto the carefully prepared tinder. Blowing gently, it catches alight, quickly growing to crackle hungrily as it devours the dried branches and leaves. 

			*if (firstplace = "yes")
				A flickering orange glow overwhelms the silvered light of the moon as I set the element in place with a word and rise once more.
				
			*if (firstplace != "yes")
				A flickering orange glow overwhelms the silvered light of the moon as I set the element in place with a word and rise with power chiming discordantly through my veins.	
				
			*goto objects
			
		*if (nsew = "w")
			*set westobject "fire"
			West belongs to Fire, fickle and fierce. Both giver and taker of life, it is the most volatile and difficult to contain of the forces with which I work. Drawing a flint from my pocket, I strike with practiced fingers sending a shower of sparks onto the carefully prepared tinder. Blowing gently, it catches alight, quickly growing to crackle hungrily as it devours the dried branches and leaves. A flickering orange glow overwhelms the silvered light of the moon as I utter the final words of the chant. 
			
			Power sings in my veins and creates a ghostly image in my mind's eye as it flows around the clearing. 
			
			*page_break [i]Quickly now, I must contain the energy and put it to use before it is lost.[/i]

			*goto drawcircle		

		*goto drawcircle
	
	#Air.
		*if not(choice_randomtest)
			*image story1_header.png

		
		*if (nsew = "n")  
			*set northobject "air"
			*set nsew "s"
			North is home to Air, ethereal and free. Though formless and light, when incited it has the power to tear limbs from trees and whip the usually placid lake into crashing waves. People underestimate its power at their peril. Crouching down, I take an empty water skin and give it my breath before tying it tightly closed with a strip of hide. 
			
			*if (element = "air")
				Uttering a secret word of power, I place it lightly upon the soil where it almost seems to hover as if reluctant to touch its antithesis.
				*set firstplace "yes"
				
			*if (element != "air")
				Uttering a secret word of power, I place it lightly upon the soil where I feel a disjointed jolt at the contact. Slowly it lifts to hover just above the ground as if reluctant to touch its antithesis.
				*set firstplace "no"	
			
			*goto objects3
			
		*if (nsew = "s")
			*set southobject "air"
			*set nsew "e"
			South is home to Air, ethereal and free. Though formless and light, when incited it has the power to tear limbs from trees and whip the usually placid lake into crashing waves. People underestimate its power at their peril. Crouching down, I take an empty water skin and give it my breath before tying it tightly closed with a strip of hide. With a word, I place it lightly upon the soil where it almost seems to hover as if reluctant to touch its antithesis. 
			
			*if (firstplace = "yes")
				Already there is power stirring beneath my feet.
				
			*if (firstplace != "yes")
				Power stirs sluggishly beneath my feet.	
			
			*goto objects3
			
		*if (nsew = "e")
			*set eastobject "air"
			*set nsew "w"
			East is home to Air, ethereal and free. Though formless and light, when incited it has the power to tear limbs from trees and whip the usually placid lake into crashing waves. People underestimate its power at their peril. Crouching down, I take an empty water skin and give it my breath before tying it tightly closed with a strip of hide. With a word, I place it lightly upon the soil where it almost seems to hover as if reluctant to touch its antithesis. 
			
			
			*if (firstplace = "yes")
				Satisfied, I rise once more.
			*if (firstplace != "yes")
				Apprehensive, I rise once more. 
			
			*goto objects3
			
		*if (nsew = "w")
			*set westobject "air"
			West is home to Air, ethereal and free. Though formless and light, when incited it has the power to tear limbs from trees and whip the usually placid lake into crashing waves. People underestimate its power at their peril. Crouching down, I take an empty water skin and give it my breath before tying it tightly closed with a strip of hide. With a word ,I place it lightly upon the soil where it almost seems to hover as if reluctant to touch its antithesis.

			Power sings as I utter the final words of the chant, creating a ghostly image in my mind's eye as it flows around the clearing. 
			
			*page_break [i]Quickly now, I must contain the energy and put it to use before it is lost.[/i] 
			
			*goto drawcircle
		
		*goto drawcircle
			
	#Water.
		*if not(choice_randomtest)
			*image story1_header.png

		
		*if (nsew = "n")  
			*set northobject "water"
			*set nsew "s"
			North is where I will place the Water that falls from the sky to form the deep blue lake of the valley. Cool and malleable, it is the most intuitive and sensitive of the elements. I quiet the emotions causing my heart to beat a fast rhythm, before pouring the liquid from the unstoppered waterskin into a polished obsidian bowl. All forces must be equal here tonight. 
			
			*if (element = "water")
				*set firstplace "yes"
				I whisper a secret word of power and the liquid quivers in response. 
			
			*if (element != "water")			
				I whisper a secret word of power and the liquid ripples uneasily in response.
				*set firstplace "no"
			
			*goto objects
			
		*if (nsew = "s")
			*set southobject "water"
			*set nsew "e"
			South is where I will place the Water that falls from the sky to form the deep blue lake of the valley. Cool and malleable, it is the most intuitive and sensitive of the elements. I quiet the emotions causing my heart to beat a fast rhythm, before pouring the liquid from the unstoppered waterskin into a polished obsidian bowl. All forces must be equal here tonight. 
			
			*if (firstplace = "yes")
				Another whispered word, and the liquid quivers in response. Already there is power stirring beneath my feet.
			*if (firstplace != "yes")
				Another whispered word, and the liquid quivers strangely in response. Power stirs sluggishly beneath my feet.	
			
			*goto objects
			
		*if (nsew = "e")
			*set eastobject "water"
			*set nsew "w"
			East is where I will place the Water that falls from the sky to form the deep blue lake of the valley. Cool and malleable, it is the most intuitive and sensitive of the elements. I quiet the emotions causing my heart to beat a fast rhythm, before pouring the liquid from the unstoppered waterskin into a polished obsidian bowl. All forces must be equal here tonight. 
			
			*if (firstplace = "yes")
				Another whispered word and the liquid quivers in response. Satisfied, I rise once more. 
			*if (firstplace != "yes")
				Another whispered word and the liquid quivers in response. Apprehensive, I rise once more. 
				
			*goto objects
			
		*if (nsew = "w")
			*set westobject "water"
			West is where I will place the Water that falls from the sky to form the deep blue lake of the valley. Cool and malleable, it is the most intuitive and sensitive of the elements. I quiet the emotions causing my heart to beat a fast rhythm, before pouring the liquid from the unstoppered waterskin into a polished obsidian bowl. All forces must be equal here tonight. 
			
			Power sings as I utter the final words of the chant, creating a ghostly image in my mind's eye as it flows around the clearing. 
			
			
			*page_break [i]Quickly now, I must contain the energy and put it to use before it is lost.[/i] 
			
			*goto drawcircle
		

		*goto drawcircle
	
*label drawcircle
*if (choice_randomtest)
	*ending

*allow_reuse

*if not(choice_randomtest)
	*image story1_header.png


*set placement "complete"

Edit: Ok this is really weird. It seems to be pulling up an error in different areas within this code and in some cases it’ll go through and other times it wont. So for example this is the exact same choice sequence (air, water, earth, fire). One goes through, another does not.

image

I think I might have tracked this error down. It was interference of a first path setting with a secondary path setting. The second path setting was on random which is probably why some passes were ok if they didn’t clash and some failed causing this particular error if the if statements were messed up. (I’ll have to see if there’s any more but hopefully might be fixed if I’m lucky.) I still have no idea why it was showing up as such a random line error though because many of the errors thrown up seem to have nothing to do with it that I can tell. Have to check there’s no more bugs hiding in here.

1 Like

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