I’d like to cross-post your code links into the “It’s A Matter of Respect” with your permission. This code dovetails very nicely into that thread’s topic.
Wow thank you so much @HannahPS Hannah, this is really helpful.
Perhaps we should dedicate a thread to code snippet archives, where we can post code snippets of how a special thing was handled. Since in programming sometimes you get something that works, but is bulky, if you could see how other people handled that, that might be helpful.
I originally thought I could write a game without using “hers” for the gender-variable characters. I was wrong – though to be fair, I made it a couple hundred thousand words in before I finally got sick of writing around it and added the variable.
Having variables for the pronouns is not too bad. What I find very tedious is dealing with plural/singular (she says/they say). Do you people use the multi replace? Do you write everything in the past tense (she did/they did)? What’s your approach?
Thanks @Goddess. That almost works, but it would give you “they fly/she flys” instead of “she flies”. I guess you can slightly change verb: “they escape/she escapes”
I do it similarly to @Goddess. There’s a character_singular variable that gets set to true or false depending on their gender. For example, in the sample code I’ve created a variable called freddie_singular - if Freddie’s pronouns are he/him or she/her, it’s set to true, and if it’s they/them, it’s set to false. Then in the text, this is how I do it, with multireplace:
When you meet Freddie, ${freddie_he} @{freddie_singular introduces|introduce} ${freddie_him}self.
like @Havenstone I tend to avoid it, but if it comes up in the writing, yes you would want to do that!
I’ve just written by own gender randomisation code and used this thread as inspiration. My need is a little different (and might be something others are interested in, so will post my code). I want to maintain an even split in genders across a pool of characters, in this example, 2 males and 2 females.
You can add other gender classifications and you’ll need to add the pronoun code on top as well, this is just the basic principle. You will also need to expand it for if you have more than 4 characters.
Essentially works on the premise that if the first two characters share the same gender, then the remaining two characters must be the other gender. Or if the first two differ, then whatever the third character comes out as, the fourth must be the opposite.
For more characters you ‘lock in’ point just moves (for odd numbers, you’ll just have to decide what to do with the odd one out).
For more than 2 genders then you’ll have to figure it out as I can’t be bothered (and if you aren’t sure how, just ask and I’ll sit and think on it)