Assistance with Wayhaven Fanfic please

So, I have decided to right a Choice of games Fanfic for the Wayhaven searies, located on "Hosted games, on the Choice of Games app.
However, I am running into a bit of a problem with some of the code, and all the *if stuff related to the different gender spapsific paths and such.
If I put my current code that I have currently, would someone be able to assist me in fixing it a bit? Please? I don’t want to mess this up.
Anyway, here is the code. It’s. I think it’s long, the hole thing is around 500 or so lines, so…

*title Wayhaven fanfick, book 2.01
*author: Jason 1Alpha8
*seene_list
	startup
	chapter 2
	chapter 3
	chapter 4
*comment TODO ETC.
* create Charming 50
*create Intimidating 50
*create impulsive 50
*create Cautious 50
*create sarcastic 50
*create Genuin 50
*create strength 10
*create heart 50
*create mind 50
*create Friendly 50
*create stoic 50
*create EasyGoing 50
*create Stubborn 50
*create optimist 50
*create Pessimist 50
*create Team player 50
*create Independent 50
*create logic 50
*create emotional 50
*create diplomicy 50
*create direct 50
*create careing 50
	*create doesn't give a shit 50
*create gender "male"
*create he "he"
*create him "him"
*create his "his"
*create man "man"
*create sir "sir"
*create mr "Mr"
*create gender "female"
*create her "her"
*create hers "hers"
*create herself "herself"
*create woman "woman"
*create ms "ms"
*create name "name"
*create surname "surname"
*create fullname "fullname"
*create orientation true
*create hedero_sexual true
*create homo_sexual true
*create valentine "valentine"
*create bloodbonded "bloodbonded"

*comment Relationships
*create Morgan 50
*create Avva 50
*create Fera 50
*create Nat 50
*comment Male_variables
*create Adam 50
*create Felix 50
*create Mason 50
*create Nate 50
Prologue.
*line_break
I grunt, putting my device down, rubbing my eyes, even though I don't need to see.
The idea of getting up at 4.45 in the morning is good, but when I stay up tell 2, well... Kind of shits on it now, doesn't it?
Grimaceing, I slide into bed, putting my phone on it's little table.
*line_break
 Scowling, I push myself out of bed, and put my phone back on my desk... After all, don't need to have it beaming rays into my head the hole dam night... If it does that, but better safe... After all, my mind is all I have...
I mutter something crude, stumbleing back to bed, and flopping down under the sheets, pulling them up. I sleep naked now, since it is warm enough to do so now.
 I am not quite sure, when the weather cools, if I won't just keep doing it...
"Speaking of which... What am I, anyway?
*choice
	#I am a man.
		Yes, I am a man... I like sleeping naked because... Well, that's my business...
		*set gender "male"
	# I am a woman...
		"Yes, I am a woman... I like sleeping naked because... Well, that's my business...
		*set gender "female"
*goto prologue_second
*label prologue_second
Shrugging, I role onto my back in my large, 2 person bed...
"Weight... "If this is a 2 person bed... "A, fuck it, it's 2 in the fucking morning, on a Friday... Might as well be dirty now...
"If I had a choice, and the willing option... Who would I want in this bed with me?
*choice
	#I want a woman in this bed...
	Of course, A woman... What am I thinking? "No, don't answer that... It won't end well for you... Not this early in the morning...
*if gender "male"
			*set "orientation" hedero_sexual
*else
				*set "orientation" homo_sexual
			# A man.
					Of course, I want a man in this bed with me... What am I  thinking? No, don't answer that, it won't end well for you... Not this early in the morning...
*if gender "female" 
						*set "orientation" hedero_sexual
						*else
						*set "orientation" homo_sexual
							*goto prologue_third
*label prologue_third
I close my eyes, I don't actually need to do so, being able to sleep with my eyes open, or be awake with them closed might be fun to do, to troll people, and sleep... I hope that I will have some interesting dreams... I want some stuff to right, after all...
*page_break "Your wish, and all that...
							*goto first_page
*label first_page
I hit something, hard. I grunt in surprise more than pane, slapping my hands down to see if I rolled off my dam bed or something, but...
"Why am I on wood? This isn't my floor... "What the...
Then, I feel a pressure in my mind. It's faint, almost not there, but... I can feel other things, shadowed within it, pane? "Yes, pane... So, much...
It's emotional, and it's growing, along with the pressure. Fast...
I can here voices. 4 of them, talking. I hunch, noticeing that I am still naked...
"This is one fucked up dreem, I think. Then...
The pane grows, massivley. Along with it, I can feel? No, here? Screams? Agganized, terrafide, pittiose screams of torment...
I start to get angry. I know where they are comeing from... I want them out..... I want to stop the fucker who is doing this... They must be purged...
"Get out of my head! Get out of my head! Get out of my head! I snarl, curling in on myself as if that alone will shield myself from the fucking pane, the screams, the rage? "Shit, that last one is not mine...
I snarl, hurling myself forward towards the fucking screams...
I, though dimley, here a surprised grunt, then I hit something with full force, the thing moveing back. My fists lash out. 1, 2, 1, 2, 1, 2, 1... I can also, dimley, here a howling noise... I think it's me? Not that I care... Just...
Most of my blows don't land, but some do. A jaw? Perhaps. I don't...
*set Morgan -5
Strong arms rap around my torso, trapping my arms at my sides, yanking me back. Snarling, I slam my head back, hard. It doesn't hit anything.
After I recover from almost breaking my dam neck, which herts... "Didn't think you could feel pane in dreams? "Perhaps I am lucid dreeming... "Finally! "Not for now...
 I snarl, yanking, still snarling, trying to get at the screams, to punch the one torturing in it's face... To free the inosint, for I know they, the one screaming is inosint... Punish the guilty... Get the fucking emotions that are not mine out of my dam head...
Then, I feel more pressure, along with something else.
*choice
	# A fealing of peace, calm. Tranquility? The calming of the storm that rages inside me...
		*set Nat +10
		I feel it flood through my body. It soothes my rage, calms my fear, the pane, and screams retreating...
		*goto next_first
	# Unyielding strength, stoic calm, the knowing that I will always stand? It will always stand between me, and the pane... The fear... the howling...
		*set Avva +10
		It flows through my body, the fear, rage, screams all breaking like waves on a wall of unyielding will ... Soon, I calm...
		*Goto next_first
	# A feeling of joy, happyness that rushes over me, although there is something else, shadowed in it, but for now, I don't care... It drives the pane, rage, fear away... Leaving nothing but a glowing light... "How do I know that? "I don't even know what, Light, is...
		*Set Ferra +10
		It flows through me with such strength that I can't help grinning like an idiot... Soon, I calm... How could I not?
*goto next_first
	# I feel, gruff annoyance, frustration. However, not directed at me... Directed for, me
		I feel the knowing that it, the feeling? "No, the person behind... Can take anything, and keep on going... Will take anything...
		*Set Morgan + 10
		It soon overwelms the pane, rage, fear... It soon calms me...
* goto next_first
*lable next_first
I relax in the grip, blinking. Then, I feel the cold air across my entire body, and remember I am naked...
"Fuck, I mutter. Should have warn dam pants... Ugg, next time...
I here a gruff laugh, and a shushing sound in a much genteler voice at that...
I reach back, 1 hand landing on something... It's...
*goto first_page_second
*label first_page_second
*if "male"_heddero_sexual
	*goto_female_variable
*if "male"_homo_sexual
		*goto male_variable
*if Female_hedero_sexual
			*goto "male"_variable
*if "female"_homo_sexual
				*goto female_variable
*label female_ variable
	I feel something. It's round, and soft, and... "O, fuck... I think. That's just swell... I grimace... "Need, better...
Then, my horror grows as I feel all my blood start going down...
"Everyone can see...
"Would it be too much to ask if I just died right now? I think, then, because I have to say something, I open my mouth...
 "I... "I didn't... I mumble, before a wave of tiredness crashes over me, and I collapse backwards, adding insult to injury by my head bouncing off the same brest...
*if Nat = 60
	*goto Nat_first
		*if Avva = 60
		*goto Avva_first
*if Morgan = 55
			*goto morgan_first
*if Ferra = 60
			*goto Ferra_first
*label male_variable
My hand lands on something. It's solid, but...
"O, I mutter. It's...
My horror grows, as I feel something... "O, I mutter.
Everyone can see now...
"Would it be too much to ask if I just died now? I think... "Then, since I do have to say. Something, I open my mouth...
"I didn't meen... "I didn't...
A wave of tiredness flows over me, and I collapse backwards, adding insult to injury by my head bouncing off the same solid chest...
*if Nate= 60
*goto Nat_first
	*if Adam=60
		*goto Avva_first
*if Mason = 55
			*goto Morgan_first
*if Feelix=60
				*goto Fera_first
*label Nat_firsst
*if "male_hedero_sexual Nat looks at the form, currently slumped against her. She is, confused. Not something she is very used to being...
*if "female"_hedero_sexual Nate looks at the form, currently slumped against him. He is, confused. Not something he is very used to being...
*if "male" He is sleeping now. she can tell that, even without the gentle breaths rushing over her skin.
*if "female" She is sleeping now. she can tell that, even without the gentle breaths rushing over her skin.
		"Ha, Morgan quips. "Should have warn pants... "That's funny... "Then, what happened right after... "I wish I could record that... "I would watch that over and over again...
		Nat glowers at her, annoyed.
		She blinks, startled. "Why would she be annoyed? By Morgan, of all people?
		"What's this... The detective says, entering, and looking around.
*if "male"_hedero_sexual			"Nat? Why is there a naked man half lying on you?
*if "male"_homo_sexual "Nate? Why is there a naked man half lying on you?
*if "female_hedero_sexual "Nate? "Why is there a naked woman half lying on you?
*if "female"_homo_sexual "Nat? "Why is there a naked woman half lying on you?
							"I would think something like that from Morgan, but you?
							Nat grimaces. *if "male" "He was punching Morgan, so I grabbed him? Then...
*if "female" "She was punching Morgan, so I grabbed her? then...
									"Detective? Morgan says, her grey eyes locked on the man, "Look down?
									"What the... The detective says, after
*comment TODO Find way to insurt gender here, so don't have to put so many *if's
*if detective_"male" He looks up. "I don't need to see that... "I don't want to see that...
*if detective_"female" After she looks up. "I don't need to see that... "I don't want to see that...
											Morgan, Nat scolds.
											"What? Morgan says, grinning.
											"Detective, Ferra chimes. "Do you happen to have some spare pants?
											The detective blinks, turns to her, and...
*goto pants
*label Avva_first
*if "male"_hedero_sexual Avva looks at the man, currently slumped against her. She did not quite know what to think, which made her... Not nervus, but...
*if "female"_hedero_sexual Adam looks at the woman, currently slumpepd against him. He is not quite sure what to think, which... Not worries, but...
*if "male" 
He
*if gender_"female"
She
						is a Human. Smells like a human, looks like a human. Fights like a Human. A very scaired one, at that...
However... She grimaces, shakeing any more thoughts out of her mind, as she heres Morgan's chuckle.
"Well, well. Morgan says, still chortling. Strange, considering her normal adatude to most things.
"Looks like your speachless?
Avva just glares. She then notices the man's hand is still on her chest. Scowling, she shakes it off. The hand flops to the side, catching on her hip...
"If it's anything to go by, Morgan says. "Think he would be more mortafide than you if he were awake...
"I am not, Avva growls. Mortafide... She was not. The human had done this on axadent. That was all.
Even if he had not... Well, he was not going to be here for long...
"What's going on? the Detective says,  entering the room.
"Avva? Why is there a naked *if "male"
	man slumped against you?
*if "female"
		Woman slumped against you?
Morgan, and Ferra both birst out laughing at that, while Avva scowls. Nat just sighes.
"It's, complecated... Avva growls.
Ferra turns to the detective. "Do you have any pants? She asks, eyes twinkling at Avva.
"Why would he... The detective glances down, grimaceing.
"I don't want to know...
*goto pants
*label Morgan_first
The man slumps against Morgan. She is...
She rubs her jaw. It doesn't heart, he is just a Human after all, but... She rubs it again. He had surprised her, rare for a Human.
He is sleeping now, breth comeing in, out. In, out. Hand still on her brest, which... "Well, he doesn't look half bad...
She turns, to see Nat glowering at her. "What? she asks.
"I know what your thinking, Nat says, tone sharp.
"What? Morgan asks. "He does not look...
"What's going, the detective's voice rings out, before 
*if
"male"
	"Why do you have a naked man slumped against you? "Well, why here?
*if "female"
"Why do you have a naked woman slumped against you... "Well, here?
Morgan shruggs. "They can't keep away, I guess...
The detective sighs. "I don't want to know...
Ferra's voice chimes, pulling Morgan's atencion to her.
"Detective, Ferra asks, eyes twinkiling at Morgan. "Do you happen to have any pants?
The detective blinks once, twice, then...
"Yeah... "Why...
"Don't, Nat warns, but the detective has allready looked down.
"I didn't need to see that... "I did not want to see that...
Ferra's face falls.
*goto pants
*Ferra_first
The *if "male" man slumps  against Ferra.
	*if "female" Woman slumps against Fera.
		She holds him up, since he would otherwise fall, given his current pozission.
He smells like swet, and fear. Fera grimaces. She does not like fear from Humans. She does not like fear, periad, but especially from Humans... Well, not unless they are guilty, and this one didn't seem like it...
Fera glances to the rest of the teem. Avva had her arms folded across her chest. Nat stands, relaxed, in a poze that Fera knows meens she is thinking.
		Morgan is looking at Fera, smirking...
"What's going on? The Detective's voice jolts Fera out of her thoughts.
* if "male"_hedero_sexual 
	"Fera? Why are you holding a Naked man?
*if "male"_homo_sexual
		" Feelix? "Why are you holding a naked man?
*if "female"_hedero_sexual
			"Feelix? "Why are you holding a naked woman?
*if "female"_homo_sexual
				"Ferra? "Why are you holding a naked woman?
*goto Fera_explenation
*label Fera_explenation
"It's... Fera starts, then stops. "Complecated, Morgan growls. "It's complecated...
	Fera smiles, and Morgan scowls.
"Detective. Morgan growls.
"Do you have any pants?

Also, yes, there is a good reason that the *author, is the way it is. If I get the OK to finish this, if it goes well, and if I do it well enough tthat the author might possibly put my character into the mane timeline, you will find out why…
So, yeah, if someone could help me out a bit. The indentation is a pane, but I should have that, if I don’t get distracted… More just all the *ifs, and if there is a better way to do that…

2 Likes

Quick question. What do you use for the indentation: tab, space, a set of spaces?

I try to use tabs. I got tired of hammering the Space Bar a bunch of times after a while.

I’m editing your code as I write this, but there’re some pointers I want you to understand.

  1. So, you have this snippet:
    *create gender "male"
    *create he "he"
    *create him "him"
    *create his "his"
    *create man "man"
    *create sir "sir"
    *create mr "Mr"
    
    All the way with its female counterpart. This is unnecessary. You're creating a set of double variables which are going to overwrite themselves.

    What you need to do is to put empty string/text during this variable declaration, once. Thus:

    *create gender ""
    *create he ""
    *create him ""
    *create his ""
    *create man ""
    *create sir ""
    *create mr ""
    

    And then do the set up on the story, in the gender choice.

    #I am a man.
    	Yes, I am a man... I like sleeping naked because... Well, that's my business...
    	*set gender "male"
    	*create he "he"
    	*create him "him"
    	*create his "his"
    	*create man "man"
    	*create sir "sir"
    	*create mr "Mr"
    

    Do the same for the woman counterpart. And you might want to consider for the non-binary gender.

  2. You can't have whitespace character in your variable. Here, you have:
    *create Team player 50
    *create doesn't give a shit 50
    
    Two variables with spaces in it. CS can't recognize variables with space. Use underscore instead.

Otherwise, there're bits of typos here and there. Also some unnecessary labeling. I took the liberty to fix them, but not changing your writing otherwise. I'll post it here when I'm finished.
2 Likes

I haven’t gone over the entire code, but here’s what I’ve seen so far.

I wasn’t sure at first if the space between the asterisk and the word create would cause a problem. So I just tested it with CSIDE… and it absolutely caused a problem. Specifically, it failed to create the variable, and issued no warning that it failed to create the variable. The code test continued on until it tried to check the variable, at which point it finally gave an error due to a “nonexistent variable.”

Yes, the purpose of the game engine is to read what you’ve written and make a game out of it. However, you should assume the game engine is incredibly obsessive over correct spelling and spacing. Don’t trust it to understand what you meant! Assume the game engine never looks at a word as a word. Assume it instead looks at a word as a string of symbols entirely independent of each other. Almost like a password or a magic spell.

As @Szaal said, these look like they may be duplicate variables.

  • Do you actually want it to be possible for a player to have both hedero_sexual and homo_sexual true at the same time?
  • Do you actually want it to be possible for a player to have both false at the same time?
  • What will happen if a player has orientation false but one or both of the others true?

While I don’t actually know your goals, I suspect it will fit your goals much more closely if you instead use a single variable, something like this:

*create orientation " "

*choice
	#I'm asexual.
		*set orientation "asexual"
	#I'm bisexual.
		*set orientation "bisexual"
	#I'm homosexual.
		*set orientation "homosexual"
	#I'm heterosexual.
		*set orientation "heterosexual"

Then, when you want to check the variable, you can do something like:

*if orientation = "asexual"
	You wouldn't want to sleep with anyone.
*if orientation = "bisexual"
	You might want to sleep with a man or a woman, if you like either of them.
*if orientation = "homosexual"
	*if gender = "female"
		You might want to sleep with a woman, if you like her.
	*if gender = "male"
		You might want to sleep with a man, if you like him.
*if orientation = "heterosexual"
	*if gender = "female"
		You might want to sleep with a man, if you like him.
	*if gender = "male"
		You might want to sleep with a woman, if you like her.

While this isn’t the only way to handle it, I suspect it will be easier to keep your code under control to start this way. I’ll mention another way later.

Moving on,

There’s a lot going on here, and much of it isn’t right.

To start with, every #option of the *choice needs to be indented the same amount:

*choice
	#I want a woman in this bed...
	#I want a man in this bed...

Once that’s sorted, then the stuff that happens as a result of choosing a specific option gets indented one more layer:

*choice
	#I want a woman in this bed...
		Of course, I want a woman... What am I thinking? No, don't answer that... It won't end well for you... Not this early in the morning...
	#I want a man in this bed...
		Of course, I want a man... What am I  thinking? No, don't answer that, it won't end well for you... Not this early in the morning...

And that also includes the *if statements:

*choice
	#I want a woman in this bed...
		Of course, I want a woman... What am I thinking? No, don't answer that... It won't end well for you... Not this early in the morning...
		*if gender = "female"
		*if gender = "male"
	#I want a man in this bed...
		Of course, I want a man... What am I  thinking? No, don't answer that, it won't end well for you... Not this early in the morning...
		*if gender = "female"
		*if gender = "male"

Note, however, that whatever an *if statement actually does has to be indented one more layer.

*choice
	#I want a woman in this bed...
		Of course, I want a woman... What am I thinking? No, don't answer that... It won't end well for you... Not this early in the morning...
		*if gender = "female"
			*set orientation "homosexual"
		*if gender = "male"
			*set orientation "heterosexual"
	#I want a man in this bed...
		Of course, I want a man... What am I  thinking? No, don't answer that, it won't end well for you... Not this early in the morning...
		*if gender = "female"
			*set orientation "heterosexual"
		*if gender = "male"
			*set orientation "homosexual"

It may help to work in “steps” the way I did in this example, instead of beginning at the top and trying to work straight to the bottom in order.

Several things going on here, too.

First, the ChoiceScript game engine needs to know which variable is supposed to contain the value you’re comparing. You can’t just say *if "male", you need *if gender = "male".

A true-false variable (also called a “boolean” variable) might at first appear different, because you can do *if homosexual… but note how it isn’t *if true? In full, it’s *if homosexual = true, and it’s the second part that’s getting shortened. The specific variable being checked is always identified. Even a boolean can only drop the value, not the variable’s name.

Second, there are at least two ways to check two variables at once. I already gave an example of one:

*if gender = "male"
	*if orientation = "homosexual"
		You're a homosexual man.

Or you can condense it down to one line, by using parentheses and an “and”. Like this:

*if (gender = "male") and (orientation = "homosexual")
	You're a homosexual man.

Note that if you really wanted to keep homo_sexual as a boolean variable, you could do this:

*if (gender = "male") and (homo_sexual)
	You're a homosexual man.

But I suspect that boolean variables won’t actually do what you want in this case. (Remember what I said earlier about “both at once” or “neither at all”? That’s when booleans are useful. If you want the player to be one or the other, but not both, and not neither, boolean isn’t the best variable type.)

What you want for this section probably looks something like this:

*if (gender = "female") and (orientation = "homosexual")
	*goto female_variable
*if (gender = "female") and (orientation = "heterosexual")
	*goto male_variable
*if (gender = "male") and (orientation = "homosexual")
	*goto male_variable
*if (gender = "male") and (orientation = "heterosexual")
	*goto female_variable

Lastly, a couple things to note:

  • Every *goto command is indented the same amount.
  • The underscore symbol is only used within a variable’s name or a label’s name.
  • Variables and their values need to be spelled exactly the same way every time. No switching between female and Female, no switching between hedero_sexual and heddero_sexual. Treat your code as a password or magic spell: The game doesn’t care what you meant, it only cares about a specific set of symbols in a specific order.

I don’t think ChoiceScript will much appreciate the apostrophe in the variable name, either. I haven’t tried it in vanilla CS, but it throws an error in CSIDE:

(Pictured is a screenshot of CSIDE, showing the following error message: line 11 of startup: Invalid expression, couldn’t extract another token: 't_give_a_shit true)

2 Likes

Thank you for all the examples. I think I understand this a bit better now. Not quite sure what’s with the “” in the "gender create ariable, but… Meh, it works. I use a fridge, and I don’t know how it works, mostly…
With this all set up, now, when setting the different paths, when I do the *ifs, would I have to do something like:

"Flaver text.
*if (gender = "male")&("orientation" = likes_men)
"Flaver text...

Something like that?
Once I figure out the hole filename TXT thing, should be able to run this on Firefox, and beta test it… Need to find a way to figure that out with screanreader… Meh, learning experience.

Be sure to use the actual word “and” spelled out rather than the ampersand you have there, the code will throw an error otherwise.

2 Likes

When doing something like:

Her skin. His skin...
Currently I am putting *ifs down for each...
Is there a more officiant way to do this.
So, just to clarify, I want it to go:
Okay, you are a man, but you like men, so “he”
Stuff like that.
I hope that clarifies it a bit.

Yes.

You can store a character’s pronouns as values within variables. Then, when you want to display those pronouns, you can display the variable. That way, you don’t need *if statements for every sentence that needs to change.

For example, if your players choose their characters genders with a *choice like this:

*choice
	#Female
		*set gender "female"
		*set they "she"
		*set them "her"
		*set their "her"
		*set theirs "hers"
	#Male
		*set gender "male"
		*set they "he"
		*set them "him"
		*set their "his"
		*set theirs "his"

Then you can come in with a sentence like:

"That's ${their} car."

And then the game will show either “That’s her car.” or “That’s his car.”, based on the value of the their variable.

Likewise, you could come in with:

"The car is ${theirs}."

And then the game will display either “The car is hers.” or “The car is his.”, depending on the value of the variable.

And a trick: If you need “himself” or “herself”, you can do something like:

"$!{they} told me ${them}self."

Which will output either “She told me herself.” or “He told me himself.”, depending on the values of the two variables used.

Edited to continue:

You’re not limited to that!

Now, that previous extended example only covered one character’s pronouns. Which might be fine. You might only have one character in your story who could have different pronouns!

But what if you have other characters who can change pronouns?

Well, it’s basically the same thing. But instead of simply naming a variable after the neutral pronoun, the variable’s name should also include a reference to which character uses the variable.

Let’s start a new example, with three characters this time. We’ll say one is the “Main Character,” and call them MC for short. We’ll say the next is A, because they’re introduced to MC first. Then we’ll say the third is B, because they’re introduced to MC second. For the sake of simplifying the example, we’ll have the player choose for MC, then automatically set A to the same as the MC, and automatically set B to the opposite of MC. (Those could be handled individually at separate points if automatic isn’t useful.)

So with three characters, two set automatically, a gender choice may look something like this:

*choice
	#Female
		*comment Main Character pronouns first.
		*set mc_gender "female"
		*set mc_they "she"
		*set mc_them "her"
		*set mc_their "her"
		*set mc_theirs "hers"
		*comment Character A pronouns next.
		*set a_gender "female"
		*set a_name "Alicia"
		*set a_they "she"
		*set a_them "her"
		*set a_their "her"
		*set a_theirs "hers"
		*comment Character B pronouns last.
		*set b_gender "male"
		*set b_name "Brandon"
		*set b_they "he"
		*set b_them "him"
		*set b_their "his"
		*set b_theirs "his"
	#Male
		*comment Main Character pronouns first.
		*set mc_gender "male"
		*set mc_they "he"
		*set mc_them "him"
		*set mc_their "his"
		*set mc_theirs "his"
		*comment Character A pronouns next.
		*set a_gender "male"
		*set a_name "Andrew"
		*set a_they "he"
		*set a_them "him"
		*set a_their "his"
		*set a_theirs "his"
		*comment Character B pronouns last.
		*set b_gender "female"
		*set b_name "Bridget"
		*set b_they "she"
		*set b_them "her"
		*set b_their "her"
		*set b_theirs "hers"

From there, you could do things like:

"I can't believe it!" ${a_name} slammed ${a_their} hands on the table.
I grabbed my coffee mug before it could tumble to the floor.

"${b_name} is so damn selfish," ${a_they} said, ignoring ${a_their} own mug as it teetered toward the edge.

Depending on the variables set in the example’s previous *choice, it would output as either:

“I can’t believe it!” Alicia slammed her hands on the table. I grabbed my coffee mug before it could tumble to the floor.

“Brandon is so damn selfish,” she said, ignoring her own mug as it teetered toward the edge.

Or it could be:

“I can’t believe it!” Andrew slammed his hands on the table. I grabbed my coffee mug before it could tumble to the floor.

“Bridget is so damn selfish,” he said, ignoring his own mug as it teetered toward the edge.

1 Like

Can you only do that with your player character? I’m doing something where the player character is mostly doing first person, but every once in a while, usually when a player character gets knocked out, which is going to happen a good amount, it cuts to a secondary character. Currently I’m trying to do that for the secondary character, and putting all the star ifs in. Would I be able to do something like that for the non-first person player character?
Also, {, }, what are the keystrokes for that on a standard keyboard? I’m not sure if I’ve come across that before.

Sorry, I forgot to reply to this earlier.

The keystrokes for the curly bracket are, on my keyboard and most I’ve seen, the pair of keys to the right of the letter P. The key closest to the P is the left bracket, and the next key right is the right bracket.

Or at least, that’s true when Shift is held. Without Shift, those keys type the square brackets [ and ] instead. So it’s, on my keyboard, shift plus the key to the right of P for the { left curly bracket. And shift plus the key to the right of that (two to the right of P) for the } right curly bracket.

I don’t know how widely standard this is, but it might be a good starting place.

I am sort of trying to do that, although it’s going to depend on your MC’s orientation.
Here is my code for now… Indent is screwee, but I can fix that…
Just, please tell me if 1, this works, and 2, how I can do it better?
Here is the code now:

*choice
	#I am a man.
		Yes, I am a man... I like sleeping naked because... Well, that's my business...
		*set gender "male"
*set they "he"
*set them "him"
*set their "his"
*set theirs "his"
		*goto prologue_second
	# I am a woman...
		"Yes, I am a woman... I like sleeping naked because... Well, that's my business...
		*set gender "female"
*set theirs "hers"
*set they "she"
* set themself "herself"
*goto prologue_second
	# Yes, I am a non-binary person...
		I like sleeping naked because... Well, that's my business...
*create gender non-binary "non-binary"
*set them "their"
*set themselves "themselves"
*set themselve "themselve"
*create person "person"
*create their "their"
		*goto prologue_second
*label prologue_second
Shrugging, I role onto my back in my large, 2 person bed...
"Weight... "If this is a 2 person bed... "A, fuck it, it's 2 in the fucking morning, on a Friday... Might as well think about this stuff now..... Not like I am going to have many chances... meh...
"If I had a choice, and the willing partner of course. Who would I want in this bed with me?
*choice
	#I want a woman in this bed...
		Of course, A woman... What am I thinking? "No, don't answer that... It won't end well for you... Not this early in the morning...
		*set "orientation "likes_women
			*set N_gender "female"
			*set N_name "Nat"
*set N_them "her
*set N_ them "her"
*set N_their "her"
*set N_theirs "hers"
*set A_gender "female"
*set A_name "Avva"
*set A_they "she"
*set A_them "her"
*set A_their "her"
*set A_theirs "hers"
*set M_gender "female"
*set M_name "Morgan"
*set M_they "she"
*set M_them "her"
*setM_their "her"
*set M_theirs "hers"
*set F_gender "female"
*set F_name "Ferra"
*set F_they "she"
*setF_them "her"
*setF_their "her"
*setF_ theirs "hers"
*set M_gender "female"
*setM_name "Morgan"
*set M_they "she"
*set M_them" her"
*setM_their "her"
*set M_themselve "herself"
		*if (gender = "male") and ("orientation" = likes_women)
			You are a heterosexual man.
			*goto prologue_third
		*if (gender= "female") and("orientation" = likes_women)
			You are a homosexual woman.
			*goto prologue_third
		*if (gender = "non_binary") and ("orientation" = likes_women)
			You are a person who likes women.
		*goto prologue_third
	# A man.
		Of course, I want a man in this bed with me... What am I  thinking? No, don't answer that, it won't end well for you... Not this early in the morning...
		*set "orientation" likes_men
		*if (gender = "female") and ("orientation" likes_men)
			You are a heterosexual woman.
*if (gender = "female") and ("orientation" = likes_ women)
			You are a homosexual woman.
		*if (gender = "non-binary") and ("orientation = likes_men)
			You are a person who likes men.
				*goto prologue_thurd

Will finish the other parts of the code, still need to do the male portion, but tired now… Need to sleep… Starting to hit the rong keys on my keyboard, and that usually meens I am tired…
Good night, or what ever time you are all currently in…

It looks like you’re on the right path!

There are still some issues to address, and you’re right about the indents. I’ll leave the indents alone for now. Here’s what I see.

For every character that gets variable pronouns, take care to make sure every one gets all four of the basic, core pronouns. So that’s:

  1. The pronoun for when the character is the subject of the sentence (they, she, he). Example: She owns the car, he owns the bicycle.
  2. The pronoun for when the character is the object of the sentence (them, her, him). Example: The car belongs to her, the bicycle belongs to him.
  3. The pronoun for when the character is the dependent possessive of the sentence (their, her, his). Example: That’s her car, that’s his bicycle.
  4. The pronoun for when the character is the independent possessive of the sentence (theirs, hers, his). Example: The car is hers, the bicycle is his.

The reflexive pronouns (themself, themselves, herself, himself) can be useful, especially when beginning to code. You can make them optional with clever coding, but it’s fine to make variables instead.

I bring this up because, in the current version of your code, some of the characters are missing some of the pronouns.

If the player chooses male for their own character, the gender variable and all four of the basic pronouns are set correctly! That’s he, him, his, and his, in order. Perfect! But the reflexive pronoun (himself) is omitted. Since it’s included in the section for a female player character, it should probably be included here to match.

If the player instead chooses female for their own character, the gender variable is still correctly set. So are the variables for the independent possessive, subjective, and reflexive pronouns (hers, she, and herself in order). However, the objective and dependent possessive pronouns are missing. Those would be “her” and “her” in this case. For a male character, those same pronouns would be “him” and “his.”

If the player chooses non-binary for their own character, several things go a bit off the rails at once.

  1. Several commands say *create when they should say *set. All variables should be created at the top of the startup file.
  2. When the gender variable is set, “non-binary” is accidentally written twice.
  3. The variable for the objective pronoun is given the wrong value. It currently reads *set them "their" when it needs to read *set them "them".
  4. You have two different reflexive pronoun variables: “Themselves” and “themselve”. Is that intentional? I can see a use for separate singular reflexive (themself) and plural reflexive (themselves) pronouns, so it’s not wrong, but there are several ways of handling it.
  5. The person variable could be useful! But female and male characters didn’t get it. If they did, the commands would be something like *set person "woman" and *set person "man", respectively.
  6. The pronouns included are the objective (them), dependent possessive (their), and two versions of reflexive (themselve and themselves). The subjective pronoun (they) and independent possessive pronoun (theirs) are both missing.

Some of the other characters experience similar issues slightly later in the code.

For character N, N_they is skipped while N_them is included twice.

The others have their four basic pronouns handled perfectly.

Character M has most of their *set commands repeated: M_gender, M_name, M_they, M_them, and M_their all get duplicated. Note: This won’t actually cause any problems. It’s not the most efficient thing, but since both sets match, nothing will get messed up.

Character M is also the only one with a reflexive pronoun: M_themselve. All the characters should probably match in having it or not having it.

Pretty minor, all told, and it’s clear you’ve got an idea of what will be useful as you write the rest of the game.

If the player chooses to want a man in bed, one of the *if statements seems to check for the wrong values. It currently reads:

*if (gender = "female") and ("orientation" = likes_ women)
	You are a homosexual woman.

Which just doesn’t seem appropriate in context. I suspect it should instead say:

*if (gender = "male") and (orientation = "likes_men")
	You are a homosexual man.

This was, after all, part of the choice to sleep with men. And female characters who sleep with men were already accounted for by the lines directly above these.

The last issue I see is a single one, but it shows up in a number of places.

It’s the quotation marks around the orientation variable. The quotation marks need to be around the value contained by the variable, not around the variable’s name. So:

  1. *set "orientation "likes_women should be *set orientation "likes_women"
  2. Every instance of "orientation" = likes_women should be orientation = "likes_women"
  3. Likewise, every instance of "orientation" = likes_men should be orientation = "likes_men"
  4. Because underscores are only needed in variable names and label names, "likes_women" and "likes_men" could be "likes women" and "likes men" if you prefer. That’s entirely optional, but it might be easier to type.

Now, finally getting back to the questions you actually asked:

First: Yes, it works. The details need a little touch-up, but it’s on the right track.

Second: There actually isn’t very much I’d do differently. Maybe two minor things?

During the long lists of *set commands, where different characters are getting all their pronouns set at once, I might use comments to separate one character’s variables from the next. It’s just easier for me to avoid mistakes (and to check for mistakes later) when I can say “All of this character’s variables go in this one place, all of that character’s variables go in that other place.”

One last thing I might do differently: When write a *choice, I like to code any commands like *set immediately after the #option, and before any narration or dialog. So instead of:

*choice
	#option
		words
		words
		words
		*set thing "this"

I prefer:

*choice
	#option
		*set thing "this"
		words
		words
		words

I personally feel it’s easier for me to find my own mistakes if the commands are immediately after the #option. It just… feels more obvious when I read it that way? It makes no functional or mechanical difference.

4 Likes

Thanks. All of this really helps, especially the examples.
One more question though. Well, 1 more for now…
Currently, I have: ```
*if orientation = "likes women
*set N_gender “female”
*set variable
*set variable
*set variable
ETC.
*if orientation = “likes men”
*set N_gender “male”
*set variable
*set variable
*set variable
ETC

I have that for the rest of the characters, along with the MC, more or less.
Does that work, or will the fact I have the same N/A/M/F for both sets make it run duplacits?
Note. Only used spaces, because, surprise, it won't let me put a tab. Takes me to the reply button...
LOL. Kind of amused I only figured this out now? Considering how long I have been messing around on the net...
Meh. Learning experience.

Yes, that’s fine. And not duplicate, either, since a player will only trigger one of those sets (not both). For example, this would be duplicates:

*if orientation = "likes women"
	*set N_gender "female"
	*set N_gender "female"

While this isn’t duplicates, it’s just normal use:

*if orientation = "likes women"
	*set N_gender "female"
*if orientation = "likes men"
	*set N_gender "male"

I discovered that the hard way a while back. I think it became the first time I had to edit one of my posts! These days, I try avoid repeating that little mistake by writing my code samples in Notepad++ or CSIDE, then copy-pasting them into the forum.

1 Like

What’s the command if you want to go to the next signe, but don’t want to put a *finish?
Like, if I have some lables, each going to the next signe if you pick them…
"I think it’s: *goto_next_signe? Something like that. I red it a while ago, but have since forgotten…
Also, Variables on Detective? I am probubly going to have to put something in where you select what detective you want for this game, tell I can, hopefully, find a way to slot the saves you get from Wayhaven 2 into it, although if that even happens, won’t be for a while… Each book takes, what, on avrage… 2 years or so? Takeing out the time to get edited and such… Around, 16 or so months?
Anyway…

Quick question.
If I wanted to in-state a temp variable, such as, temp character name Rob, would it be the same formatting as the other variables, such as the dollar { variable }?
Also, if possible would you please be able to give me an example?

Temp variables are variables which will only be used in the scene they are in. A *goto_scene or anything that reloads a different file will break them. So if you want to give the pc a resource, or they meet a culture that gives them a title or something that will only ever be used in that scene file, you could use a temp variable. If there is even a chance you will need to print that variable again, or use its value in your stat calculations after that scene, just make it a regular variable.

If you’re asking about printing that variable, with ${variable} then yes, you would still do that as normal. The only difference between a temp and permanent variable is that a *finish or *goto_scene command will erase it (and its value) from memory.

I am a little bit unclear about setting relationship variables., I’ve got everything created, but just the formatting. Right now I have,
I tried doing them the same as the other ones, just to make things simple. So I’m not sure how that will work sense by their very nature, the move around. Where are the other ones I was doing, kind of stay more or less the same.
So something like,

*set N relationship N “relationship”
Not fire if that is correct.

A few things. First, you can’t have multiple-word variable names separated by a space. So N relationship would either need to be written as n_relationship or NRelationship.

Second, you have that as a string variable, which is to say it is just for holding some text. So you might write it as N_relationship “friend” “romantic” etc.

Though you certainly can do it that way, that’s usually not the way relationship variables are handled. Usually you would make them a numeric variable, say N_relationship 20, which would start them at a base relationship value of 20 then either specifically *set n_relationship 20, 30, whatever, to a specific hardcoded value every time it changed, or *set n_relationship %+5, to use the fairmath system to change the relationship value proportionally rather than setting it at a hardcoded value.

You could then do something like

*if n_relationship<40
  N still doesn't trust you. 
*if (n_relationship >50) and (n_relationship<80) 
  You and N are close friends. 
*if (n_relationship > 80) and (interested_gender) 
  You and N are romantically involved. 
1 Like