Sample Code for Multiple Pronouns ("She/They", "He/They", Etc) for Player Characters

I’m curious if other games have an easy/efficient method for allowing the player character to use multiple sets of pronouns (for example, “he/they”, “she/they”, etc). Below, I’ll share a method I came up with that I’ll most likely end up using in my game.

This is the code I started with for establishing pronouns (using @HannahPS’s excellent pronoun sample code):

*label pc_she

*set pc_he “she”
*set pc_him “her”
*set pc_his “her”
*set pc_singular true

*return

And in the game’s text:

“Of course ${pc_he} do@{pc_singular es|}. I can even get ${pc_him} in for free.”

This produces:

“Of course she does. I can even get her in for free.”

To change Hannah’s code to allow for multiple pronouns, I added a second set of pronoun variables, and just kept the second set the same as the first set for players who only use one pronoun.

So if pronouns are she/her:

*label pc_she

*set pc_he “she”
*set pc_him “her”
*set pc_his “her”
*set pc_singular true
*set pc_he2 “she”
*set pc_him2 “her”
*set pc_his2 “her”
*set pc_singular2 true

*return

Both sets are set to she/her.

And if pronouns are she/they:

*label pc_she_they

*set pc_he “she”
*set pc_him “her”
*set pc_his “her”
*set pc_singular true
*set pc_he2 “they”
*set pc_him2 “them”
*set pc_his2 “their”
*set pc_singular2 false

*return

The first set is set to she/her and the second is set to they/them.

And then in the game’s text:

“Of course ${pc_he2} do@{pc_singular2 es|}. I can even get ${pc_him} in for free.”

This would produce for she/her:

“Of course she does. I can even get her in for free.”

And for she/they:

“Of course they do. I can even get her in for free.”

Without having to write the same line in the game’s text twice.

I initially thought, because I have pronouns set up using multireplace, that I’d need to type out a second version of some sentences where multiple pronouns would occur (because you can’t nest multireplaces inside one another), but creating a second set of pronoun variables for everyone eliminates this problem. You just keep the second pronoun set identical to the first one for single-pronoun Player Characters.

Anyway, once I’ve implemented this in my game I’ll probably put a little sample on dashingdon for people to use in their games too & update this post with a link. (Assuming it works well, and no one else has a better/more efficient way of doing this! I’d love to hear from anyone else who has addressed this in their game, or knows of games that allow for multiple pronoun sets!)

Thanks for reading :slightly_smiling_face:

11 Likes

There is probably also a way you can randomly select between 1 and 2, so that you don’t run the risk of unbalanced usage.

1 Like

Probably the simplest version that I’ve come across. I don’t remember which game I found it in.

*if (gender = "female")
    *set gender_him "her"
    *set gender_his "her"
    *set gender_he "she"
*if (gender = "male")
    *set gender_him "him"
    *set gender_his "his"
    *set gender_he "he"
*if (gender = "Non-Binary")
    *set gender_him "them"
    *set gender_his "their"
    *set gender_he "they"

You’d need a lot more code to get that to accept two pronoun sets.

I didn’t make this clear enough, I was just trying to point out a way to simplify it so you don’t have to make so many labels for every combination. You can have all the code within one label.

I could be wrong since I’m not a programmer, but I actually think that would end up with more code overall, since you’d need labels for every single combination rather than just two sets of labels.

You would just need to double the amount of code and set pc_singular to true or false for the multi-replace, instead of creating a *label pc_she_they or other combinations that are suggested above.

For example:

For this, you’d have to make another label for pc_him_they, and two more for the rest. Or you can condense it all into less than thirty lines of code.

I think I’m still not understanding how you get from if statements that aren’t in labels at all to a small set of labels.

Actually, why are we even using labels? Shouldn’t we be using variables?

What I’m suggesting is that we condense all of the variables into one label instead of several, if I am understanding what was suggested above. The variables for the gender of the player are already set by the time we get to the pronouns. *gosub would go to the correct labels for the suggested example.

*label pc_she
*set pc_he “she”
*set pc_him “her”
*set pc_his “her”
*set pc_singular true
*set pc_he2 “she”
*set pc_him2 “her”
*set pc_his2 “her”
*set pc_singular2 true

*return

*label pc_she_they
*set pc_he “she”
*set pc_him “her”
*set pc_his “her”
*set pc_singular true
*set pc_he2 “they”
*set pc_him2 “them”
*set pc_his2 “their”
*set pc_singular2 false

*return

As shown before, they need to type the same variables into each label. However, we can put all of them into one label, or use *fake_choice to skip *gosub.

*if gender = "female"
    *set gender_him "her"
    *set gender_his "her"
    *set gender_he "she"
*if gender = "male"
    *set gender_him "him"
    *set gender_his "his"
    *set gender_he "he"
*if gender = "non-binary"
    *set gender_him "them"
    *set gender_his "their"
    *set gender_he "they"
*if gender2 = "female"
    *set gender2_him "her"
    *set gender2_his "her"
    *set gender2_he "she"
*if gender2 = "male"
    *set gender2_him "him"
    *set gender2_his "his"
    *set gender2_he "he"
*if gender2 = "non-binary"
    *set gender2_him "them"
    *set gender2_his "their"
    *set gender2_he "they"

Oh, so you’re saying that the labels should set gender rather than set pronouns, and then afterwards you can use if statements to determine pronouns from the gender. I was thinking you were trying to replace the entire thing with just these gender-sets, which wouldn’t work because they wouldn’t be referenced anywhere.

Are you talking about labels or the command *label? You might also be confused by how I named my variables to set pronouns.

Wait, is there a difference? I just assumed we were talking about the command *label.