Coding looks right (again) but the wrong situation keeps happening


#1

I’ve changed the coding at least five times with varying suspicions as to what’s going on, and I can’t determine what the cause is. Essentially, the character can be in a relationship, or single. And if they’re single, they have a choice to have a cat, dog, or no pet. I wanted to see what my pet pages looked like after coding them but kept getting caught up because the latter half of the relationship dialogue kept popping up - not even the portion with the choices, which actually does show up in the real relationship section.

Anyway. The way I’ve made my relationship flag is with a variable titled ‘relationship’ with a value of 0 starting at startup. I change it to 1 when a relationship is initiated, but if they say “I’m single” then I don’t write anything, I just leave it be - could that be the issue?

Here is the section I get when I WANT to get the pet section:
(note that my default pronoun is the male pronoun)

“I was told that Smith - you remember him? Smith, the man I took care of all of those years ago, was apparently trying to commit suicide, and used a chemical that had only ever been seen before at the bottom of the ocean. It had never been used as a poison, and yet, he did it. And so the government is planning to use the chemical, once they find it, for the military.”

He stares, unblinking. “That’s… intense. Why did they tell you?”

“I don’t know.”

The coding I am about to post is the relationship vs. the pet coding, and above that, the corresponding variables from startup.txt. Can you tell me if you see anything wrong with it? Thank you, again!

<pre \*create relationship 0 \*create dog false \*create cat false \*set relationship 0 \*if relationship=1 You arrive home shortly after your talk with the CoA - whose name you still don't know, despite the circumstances - and ${lover} rises from the couch. "You look... shaken." ${loverhe} says with a chuckle. "What happened?" Do you tell ${loverhim}? \*choice #Yes. I trust ${loverhim} completely. \*goto yestell #No! My job's on the line. \*goto notell \*label yestell "I was told that Smith - you remember him? Smith, the man I took care of all of those years ago, was apparently trying to commit suicide, and used a chemical that had only ever been seen before at the bottom of the ocean. It had never been used as a poison, and yet, he did it. And so the government is planning to use the chemical, once they find it, for the military." $!{loverhe} stares, unblinking. "That's... intense. Why did they tell you?" "I don't know." \*goto morning \*label notell "Nothing. Just a long day, that's all." You smile at ${loverhim}, and ${loverhe} gives a half-hearted grin back. "I believe you. Know that. But if... just... let me know if it's serious. Give me that gift, at least." With that, ${loverhe} flops back onto the couch, ending the conversation. \*goto morning \*if relationship=0 You arrive home shortly after your talk with the CoA - whose name you still don't know, despite the circumstances - and your pet greets you. What sort of pet do you have? \*choice #I have a cat, of course. \*set cat true \*goto kitty #I obviously have a dog. \*set dog true \*goto dog #You are mistaken - I don't have a pet. \*goto oops \*label kitty \*image kitty.jpg Your cat rubs against your leg, and you settle onto the couch, eventually falling asleep to the sound of a voracious purring. \*goto morning \*label dog \*image dog.jpg Your dog leaps up from the couch and attacks you lovingly, smothering your face in kisses. You settle down onto the couch, eventually falling asleep with the weight of your pet in your lap. \*goto morning \*label oops My mistake for assuming. You settle onto your couch and watch a TV show, falling asleep quickly. \*goto morning

#2

If relationship = 1, you go into the yestell or notell choice.

But if relationship != 1, it skips the yestell/notell choice and continues on to *label yestell with nothing to divert it.

You could do instead (remember to indent after the second *choice):

*if relationship = 1
	You arrive home shortly after your talk with the CoA - whose name you still don't know, despite the circumstances - and ${lover} rises from the couch. 
	
	"You look... shaken." ${loverhe} says with a chuckle. "What happened?"
	
	Do you tell ${loverhim}?
	*choice
		#Yes. I trust ${loverhim} completely.
			*goto yestell
		#No! My job's on the line.
			*goto notell
*else
	You arrive home shortly after your talk with the CoA - whose name you still don't know, despite the circumstances - and your pet greets you.
	
	What sort of pet do you have?
	*choice
		#I have a cat, of course.
			*set cat true
			*goto kitty
		#I obviously have a dog.
			*set dog true
			*goto dog
		#You are mistaken - I don't have a pet.
			*goto oops

*label yestell
[etc.]

#3

Oh my gosh, I didn’t even think of that. Thank you. Seriously. I’ve been at this for hours. Thank you.


#4

Once I’ve done all these little things a few times myself, it becomes a lot easier to spot them! :slight_smile:

P.S. - I edited my comment a couple of times to try to be clearer, just in case you saw the first version…