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)
I’ve done a small update to the original sample code to include an example of using a verb variable such as ${freddie_says} (which is set to “say” or “says” during the gender selection) rather than @{freddie_singular says|say}. This is quicker and reduces errors - hooray! (I can’t believe I had gone through three games with gender-selectable characters before my wife did this in her WIP and we both realised how much easier it would make things.)
I’ve also added a version which uses ${npc_they}/${npc_them} etc. This helps removes the need to mix variables using the different kinds of her/her or his/his, if such things bother you like they do me. It also makes it easier to spot mismatched verb agreements if players are testing the game with PCs/NPCs who use singular verbs (which is the most common configuration).
I’ve been following Lynnea Glasser’s approach, which is to rely mostly on s, es, re, and ve variables for a character who could use either singular or plural pronouns – so say/says becomes just another use of the s-variable, say${s}. Or say${f_s} for Freddie – when I have NPC-specific variables, I tend to type just one or two letters as an identifier, rather than their whole name.
I can see how the four-variable approach could get cumbersome the more of those characters you have in the game, though, and how just multireplacing a f_plural variable for Freddie’s verbs, with e.g. f_say for super-frequent verbs, would be an attractive alternative.
Yeah, I find it easier to type a whole word - it doesn’t feel quite as intuitive to have a dollar sign in the middle of the word like say${f_s}. Very much to personal taste though, of course!
What is weird is that I use ${npc_he} in Royal Affairs and ${npc_they} in Honor Bound and the change took a little getting used to but is now second nature. But when an old character from a previous game showed up as a cameo in Honor Bound, using ${npc_he}, it was a real bamboozling moment and I started accidentally using ${npc_he} for HB characters who have never used it. So, the lesson is that my muscle memory is very much like a sponge, and it’s better not to mix whatever method that’s been decided on. (Though I am very pleased with the decision to move to ${npc_they} - it’s been helpful for a number of reasons.