Preset and Choosing Gender for Characters?

I have literally no idea how to word this, so if there is a similar section, I would love to have a link. So if anyone has played Mecha Ace, you know how you have the choice of picking everyone’s genders at the start or having a randomizer do it? I’m trying to accomplish a similar thing (with player choosing everyone’s genders), though with preset genders instead of a randomizer for the second choice.

Does anyone have any idea how to code this? I’m still very noob-ish at this and learning quite slowly ahaha :sweat_smile:

It’s a matter of working out the different genders. You’ll want to make each character’s gender a different variable, including pronouns and all else that would change in the story. You’ll want to use text variables for all of that.

So basically, say you have two characters that will have customization genders. You create the different variables (char_one_gender = “male”, char_two_gender = “female”, char_one_name = “Jim”, char_two_heshe = “she”, and so on.) Ideally, these would be the preset genders you’re making available.

The player would simply choose the gender they want and your code should define the gender, name, and pronouns to go with it accordingly.

It’s really up to you how you want to do it. It’s not very difficult, you just have to be really thorough in making all of the gendered parts variables.

If you need clarification, let me know. This might not make any sense, lol! :stuck_out_tongue:

1 Like

You can always look at how Mecha Ace does it. The code is in the startup.txt file here:


After glancing at the Mecha Ace code, I have one small suggestion, which I’m currently using in my WIP for NPCs whose genders can vary.

When I name my variables, rather than numbering them, I use the Elverson pronouns with a leading letter indicator to differentiate between characters. Elverson pronouns are the same as “they/their/them”, but you cut the “th” off the front, getting ey/eir/em.

I find it easier to proofread a sentence like

$!{bey} reaches for ${beir} sword, but you raise a cautioning eyebrow at ${bem}, and ${bey} halts in mid-gesture.

than one like

$!{belgender1} reaches for ${belgender2} sword, but you raise a cautioning eyebrow at ${belgender3}, and ${belgender1} halts in mid-gesture.

Your mileage may vary, of course.


If it’s of any use I did something similar in one of my WIPs. It’s a bit messy since I wrote it a few years back and I’d undoubtedly do things a little different now but if it helps have a look. .

You could always do:

*set npc_gender "male"
*set npc_he_she "he"
*set npc_his_her "his"
*set npc_him_her "him"
*set npc_his_hers "his"

Repeat, replacing NPC with functions (ro1) or descriptions (punkrock_kid) or whatever.

The Alien Commander laughs evilly, raising ${alien_commander_his_her} blaster at you. "No one can save you now," ${alien_commander_he_she} hisses, and fires. You dodge and fire your own blaster, killing ${alien_commander_him_her}.
1 Like