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.
*temp Gender 0
*rand Gender 1 2
*if Gender = 1
*set ExplorerGender "Male"
*if Gender = 2
*set ExplorerGender "Female"
*rand Gender 1 2
*if Gender = 1
*set ChefGender "Male"
*if Gender = 2
*set ChefGender "Female"
*if ((ExplorerGender = "Male") and (ChefGender = "Male"))
*set EntertainerGender "Female"
*set DiplomatGender "Female"
*return
*if ((ExplorerGender = "Female") and (ChefGender = "Female"))
*set EntertainerGender "Male"
*set DiplomatGender "Male"
*return
*rand Gender 1 2
*if Gender = 1
*set EntertainerGender "Male"
*set DiplomatGender "Female"
*return
*else
*set EntertainerGender "Female"
*set DiplomatGender "Male"
*return
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) 