How to code variables for orientation/preference correctly?

I thought I knew what I was doing (vaguely) enough to continue with content. I have 15 *goto_scene txt files that I’ve gotten through up until this point, and I am stuck. I don’t know what I am doing wrong. I’ve checked spelling and retyped the ‘non-existent variables’ on the file and in startup but it has continued.
I use to alpha-test (because I can’t figure out how to test it independently), could using dashingdon be the problem?
Is it that there are two underscores within the variable?
Am I just blind and can’t spell??
Any help would be appreciated.

Within the choicescript_stats.txt the same variable are existent and display correctly. Up until I get the error on this page it display correctly with uknown in the place of the variable.

I am romatically interested in {romantic_orientation_preference} and attracted to {sexual_orientation_preference}.

I keep getting “Nonexistent variable” and it alternates from “non-existent variable: romantic_orientation_preference” and “non-existent variable:sexual_orientation_preference”.
Within the startup.txt I created
*create sexual_orientation_preference “unknown”
*create romantic_orientation_preference “unknown”

My code looks like this:

*label orientation_chapter1

"$!{first_name}", the voice changed, echoed thousands
I remember. Strangers, friends, and even more personal.
"$!{first_name}," the voice repeated, softer resounding
[i]that[/i] person.

	#A man I once knew.
		*set sexual_orientation_preference "men"
		*set romantic_orientation_preference "men"
		*goto_scene scene3_chapter1
	#A woman I once knew.
		*set sexual_orientation_preference "women"
		*set romantic_orientation_preference "women"
		*goto_scene scene3_chapter1
	#The voice is resounding both of a man and a woman.
		*set sexual_orientation_preference "men and women"
		*set romantic_orientation_preference "men and women"
		*goto_scene scene3_chapter1
	#A man I was romantic with, but not sexually.
		*set sexual_orientation_preference "none"
		*set romantic_orientation_preference "men"
		*goto_scene scene3_chapter1
	#A woman I was romantic with, but not sexually.
		*set sexual_orientation_preference "none"
		*set romantic_orientation_preference "women".
		*goto_scene scene3_chapter1
	#The voice of my best friend.
		*set sexual_orientation_preference "none"
		*set romantic_orientation_preference "none"
		*goto_scene scene3_chapter1

Preformatted text

My dollar sign symbols are gone $$$

Are your dollar signs missing in your code, or just in your post?

Can you post your code as pre-formatted text? (i.e., post it between <code></code> tags)

Aside from the missing dollar signs ($) I dont see a problem. Please use the symbol that looks like this </> to pre-format the txt.

I fixed the post with the formatting code and my dollar signs are back.

But within the txt file they were always there.

Where are your '*create’s located? At the top of startup after title and author, right?

Could it be the period after "women" that’s causing this issue? (Assuming it’s not a typo.)

Also, if you’re not already using it, I highly suggest CSIDE to write your game as it has an built-in testing method and will tell you the exact line in your document that’s causing the issue, hopefully pinpointing things further.


Yes. A whole list of them, but these two are near the bottom of the list.
Does location on it matter?
I’ve tried to put them in order by which they are established.

I think the period is a typo. (Lol) most of testing has been on the first option, a man, and it just halts at that point.
CSIDE? Can you point me to some info regarding that. I dont believe I’m familiar.

As long as they’re with the rest of the *creates and not under a *label or something, it shouldn’t matter.

Have you double checked spelling as well as dashes?

Also, you can find a link for downloading cside here.

I’d suggest it as well, especially since it comes in with a built in test which helps save you time/frustration when trying to find the bugs yourself.

1 Like

The orientation_chapter1 code seems correct.

Can you post the code from the page you’re getting the error on? The page with “I am romatically interested in {romantic_orientation_preference} and attracted to {sexual_orientation_preference}”?

If you’re willing to post the Dashingdon link to your game, that’d be the fastest way to figure out what’s going wrong.
Sorry for the length for no reply. Here is the link if you don’t mind! Thank you if you do!

Think I might have found your issue. When through and chose the first answer for sexual orientation and for the error I got ‘sexual_orientation_prefernce’ (notice, preference is spelled wrong (edit: A bit more info, specifically in scene3 chapter1).

One thing I want to ask, how are you setting up your scenes- are you sending everything to a completely new page, or all on one page?

1 Like

I’ll double check all the spelling for the variables! Thank you! I guess I am just blind!
Each new scene I set up a new page. Is that the correct thing to do?

Also. I love cside. Thank you!

It might be easier to put portions in one so you don’t have a bunch of different pages all saying the same thing. I took a quick peek through dashingdon and I noticed you had about three of each scene. Generally, beginning stuff like that gets put in startup (or chapter 1, or what have you). And then, if there are differences in text (hence the three different scenes for each of the same thing), you can condense it with *if variables or even *fake_choices (these don’t require a *goto to continue on).

1 Like

Thank you! I plan to learn more to use those and decrease the number of text files by doing so, but I thought before I made things too complex to make sure I had a good basis for the beginning.
I really appreciate your assistance, even if it was for something as simple as a misspelling I couldn’t find :slight_smile:

Not a problem, and glad I could help! Let me know if you have any more questions :slight_smile:

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.