Gender variables mix up when playtesting

Hi, I’m in some need of help yet again ^^;

A while back, I wrote in the gender variables with *create and *set, with the character’s gender changing depending on the player’s choice. I have one option for male, one for female and one for non-binary.
But a really weird issue has come up in the last few scenes when I playtest; when other characters refer to the player-character, they will sometimes say “zir” (the non-binary variable) instead of “him”, even though I’ve chosen male as the gender option.

It doesn’t always happen; for example, in one scene a character says “zir” in one line and then “he” in the next line. I have the male variables as the standard, with it changing only if the player chooses non-binary or female, so it’s not an issue of writing the wrong variable in the wrong place.

I’ve checked the script and the startup file and everything seems fine, so I’m at a bit of a loss.

Could you give us the code you use to set the variables?

Of course!

In the startup file:

*create sex “male”
*create he “he”
*create his “his”
*create mr “Mr.”
*create man “man”
*create himself “himself”

*create sex “female”
*create he “she”
*create him “her”
*create his “hers”
*create mr “Ms.”
*create man “woman”
*create himself “herself”

*create sex “other”
*create he “ze”
*create him “zir”
*create his “zirs”
*create mr “Mx”
*create man “person”
*create himself “zirself”

At the choice of gender:

*choice
#Male
*set sex “male”
*set he “he”
*set his “his”
*set mr “Mr.”
*set man “man”
*set himself “himself”

	*finish
#Female
	*set sex "female"
	*set he "she"
	*set him "her"
	*set his "hers"
	*set mr "Ms."
	*set man "woman"
	*set himself "herself"
	
	*finish
	
#I don't identify as either
	*set sex "other"
	*set he "ze"
	*set him "zir"
	*set his "zirs"
	*set mr "Mx"
	*set himself "zirself"
	
	*finish

This is an example when “he” - and with the male gender chosen - changes to “zir” in the index-html:

“I won’t hurt ${him}. Not intentionally, at least.”

The problem here is when you use the *create with the same variable names, it will replace that value; there is no need to create them for each sex. Leave the variables with no value until the player has made his choice. Make one variable for each pronoun, here is an easier way to do it:

*create sex “”
*create heshe “”
*create hishers “”
*create mrms “”
*create himher “”
*create manwoman “”
*create himselfherself “"

Leave them to be defined only when the player selects the option:

*choice
     #Male
          *set sex "male"
          *set heshe "he"
          *set hishers "his"
          *set mrms "Mr."
          *set himher "him"
          *set manwoman "man"
          *set himselfherself "himself"
          *finish
     #Female
          *set sex "female"
          *set heshe "she"
          *set hishers "hers"
          *set mrms "Mrs."
          *set himher "her"
          *set manwoman "woman"
          *set himselfherself "herself"
          *finish

You can do the same for NB as well; when it comes the time to use in the game, use ${himher} for example and it will be either “him” or “her” depending on the choice the player made.

On your example specifically, the ${him} was likely not working because in the choice you did not define it for male; this made so that the “him” variable was actually being overwritten by *create him “zir” in the NB section.

3 Likes

Oh, really? I didn’t know that was acceptable :o I will test that out, thank you!

Hey, unfortunately when the scene where the characters use the gender variables there is an error message saying that the variables don’t exist, because I didn’t create them in the startup file. So I don’t think it really works not to fill in the variables at all :confused:

Can you post the code? I use the same method in my game and I can confirm it works; there must be something else wrong.

Sorry, it does work now - kind of. I don’t get the error message, but instead of getting another variable in place of “him” in certain lines, I get nothing. For example, the scene that was supposed to say “I won’t hurt him” and instead says “I won’t hurt zir”, now says “I won’t hurt”, with no variable at all. It’s really strange…

Need to see the code to figure out what is wrong.

Oh, sorry!

Startup file:

*create sex “”
*create he “”
*create him “”
*create his “”
*create mr “”
*create man “”
*create himself “”
*create sir “”

*choice
#Male
*set sex “male”
*set he “he”
*set his “his”
*set mr “Mr.”
*set man “man”
*set himself “himself”

	*finish
#Female
	*set sex "female"
	*set he "she"
	*set him "her"
	*set his "hers"
	*set mr "Ms."
	*set man "woman"
	*set himself "herself"
	
	*finish
	
#I don't identify as either
	*set sex "other"
	*set he "ze"
	*set him "zir"
	*set his "zirs"
	*set mr "Mx"
	*set himself "zirself"
	
	*finish

And the scene example where the issue presents itself:

I won’t hurt ${him}.

You never defined the variable “him” if the player picks a male, so it will always be empty in this case.

You would need to place a:

*set him "him"

In the male choice route. I suggest you name the variables like I mentioned before so that you don’t end up confusing yourself with variables and actual text; especially if later you end up placing {her} instead of {him} (which is the variable name in your case). Having it like ${himher} makes things more clear that this is a variable.

Note on my example how I defined all variables for both sexes; you need to do the same here since they have no starting value.

Oh dear, you’re right… That’s embarrassing. I missed that one completely! Thank you so much for helping me see that :slight_smile: