Impossible QuickTest Error?

In my first chapter, the character has the ability to choose their gender early if they make a choice indicating that they’re into an RO that is gay. This seems to be causing issues with a check I implemented later in the chapter, where the original gender choice occurred. Specifically, QuickTest returns the following error:

Error: 9 line 460: invalid @{} at letter 7; 'g' is equal to 0 which is not a positive number 

I am really not sure why this is happening. The check I created checks if the gender variable g is equal to 0. If it is, the player is directed to the gender choice. If it’s not, the player simply states the gender they chose before. But for some reason, if the check goes to the version where they state the gender, it gives me the error that g = 0, which shouldn’t be possible because that version of the text is only accessible if g != 0.

Code

Code for the early gender selection, which is one of six choices on a choice tree:

*choice
	#Uh, actually, I [i]like[/i] like Adrian. Like, a lot.
		*set disable_likes_boys true
		*set mc_likesadr true
		*set adr +6
		*set wall +1
		Oooo, okay. That's completely understandable. After all, you spend a lot of time with him, and you both know each other super, super well. Plus, it doesn't hurt that Adrian is quite attractive. Anyone with eyes would be attracted to him.
		
		There's just one major obstacle. Adrian is gay, and he only dates people who identify as male. Apologies for the brusqueness, but do you?
		*choice
			#I do!
				*set g 1
				*set he "he"
				*set his "his"
				*set him "him"
				*set himself "himself"
				Well then, here's wishing you well in your pursuit!
			#No, I identify as female.
				*set g 2
				*set he "she"
				*set his "her"
				*set him "her"
				*set himself "herself"
				*goto toughluck
			#No, I identify as non-binary.
				*set g 3
				*set he "they"
				*set his "their"
				*set him "them"
				*set himself "themself"
				*set plural true
				*label toughluck
				Ouch. Tough luck, huh? Maybe in another universe.

And here’s the gender check implemented at the regular gender scene:

*if g = 0
	Sabrina looks at you, expectantly. A bit of a strange question, but you appreciate that she's at least being considerate enough to ask instead of assuming.
	*label genchoice
	*choice
		#"I'm male."
			*set g 1
			*set he "he"
			*set him "him"
			*set his "his"
			*set himself "himself"
		#"I'm female."
			*set g 2
			*set he "she"
			*set him "her"
			*set his "her"
			*set himself "herself"
		#"I'm non-binary."
			*set g 3
			*set he "they"
			*set him "them"
			*set his "their"
			*set himself "themself"
			*set plural true
*else
	"I'm @{g male|female|non-binary}," you reply.
	*page_break

The code executes fine during gameplay (if you choose your gender early, you only state it later, etc.), so my only concern is getting this fixed so that I can say that the game passes QuickTest during submission to HG. It also makes my life easier when testing the game. Any help is greatly appreciated!

As far as I understand, QuickTest will check for things that aren’t necessarily possible. :thinking: In my game, it checked using a blank string for the MC’s name, even though blank names weren’t allowed. I eventually got around this by just giving the MC a default name, which changed absolutely nothing in the actual choice, but stopped QuickTest from getting upset. :sweat_smile: Maybe you could start with g equal to 4, and change the @ to @{g male|female|non-binary|ERROR} or something like that. :thinking: (It shouldn’t ever say “ERROR”, but readers will spot if it does. :stuck_out_tongue_winking_eye: )

Yeah, quick testing multi replace is picky like that. If I’m going to use a numerical multi replace I start the variable at 1 - so MC starts as female until stated otherwise, for instance - which only works if you keep an eye on the narrative. The Error works nicely though, and is more easily spotted if something goes awry!

Well, I just somehow solved my own problem? I had g initialized to 1 because a while back, CSIDE was throwing errors at the start because I had g starting at 0 (despite never giving me this error at any other point in time on any other project). My workaround was to start g at 1 and then set it to 0 at the start of the first chapter. I just removed that from the chapter and now the QuickTest passes.

So, long story short: what? How?

Regardless, the issue has been fixed. Thanks for the help y’all!

2 Likes

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