Code for gender and pronouns

hello, I am new to coding and choice script, but I would like to learn how to give my protagonist (the player) gender and give them pronouns in both coding and which scene I should place them under.

gender I will leave as male, female, and non binary. I do believe in other genders, but to write them out would be a bit taxing. if the code is simple enough, I may write a few more, but as for now, my main focus is how to “assign” gender and pronouns to the protagonist/player throughout the story.

thank you very much in advance.

Looked up a couple of threads that might help. This one is newer and includes they/them pronouns:

This thread is older and has no option for they/them, but the dropbox link has a few useful pointers like setting up relationship variables:

1 Like

this is awesome, thank you so much!! :pleading_face::two_hearts:

1 Like

Hey, I know of two different methods you can do this.

The first and most common way is to assign each pronoun and gender-specific word by making variables that can be chosen in a gender choice ingame. You do this by using *create in startup.txt to make the different pronouns, for example:

*create he_she ""
*create him_her ""

Then, later when you want the player to choose their gender, you can make a choice like this:

*choice
   #Male
      *set he_she "he"
      *set him_her "him"
   #Nonbinary
      *set he_she "they"
      *set him_her "them
   #Female
      *set he_she "she"
      *set him_her "her"

Then when you want to enter those pronouns you can use ${} to enter the variable’s text, like “${he_she} is going to bed.” You can add as many variables for as many gender-specific pronouns as you plan on using in your game.

As for the second more complicated method, you can use the Multireplace @{} command by assigning a number to the variables for potentially more in-depth descriptions according to gender. This would scroll between potential prompts you may want to show. To do this, you first create the variable:

*create gender 1

Then for the choice:

*choice
	#Male
		*set gender 1
	#Nonbinary
		*set gender 2
	#Female
		*set gender 3

And finally, when you want to use this, you can use the @{} command to do something like:

“I don’t know about that. @{gender He is going to bed.|They are going to bed|She is going to bed.}”

And to see that in-game, with a female example, it would look like this:

"I don't know about that. She is going to bed."

Hope that makes sense.

3 Likes

I found this rather helpful, thank you so much! I have added this code to my notes list so I don’t forget it. thank you once again!! :two_hearts:

You’re welcome :smiley:

This is a good way to do it too.

For they/them pronouns, you need to indicate that they are plural, or you’ll run into errors like “they doesn’t”. The wiki page has an example for this: Multireplace | ChoiceScript Wiki | Fandom

2 Likes

It’s no problem. Getting into this type of coding can be pretty hard, so I suggest looking at the code of other ChoiceScript games that you might like. It can be very insightful.

1 Like