So working on a game and if the user picks a gender at the start of the game, I want to reflect that respective gender in the dialogue without resorting to copying all the same text and just change the pronouns manually for it. Is there a way to call out certain pronouns and input them to the dialogue when needed after the choice of a gender?
I was thinking using bool on this and make male and female to be false but not sure how it will work entirely if I do that.
For sure, you could do something like this…
Let’s say you have a few options: his/her , his/hers, him/her, he/she whatever 
You could give a special “Symbol” (just a special string of text) to indicate which you’d like to use.
I would use an int for the gender, personally. This would allow you to index into an array of options. You could set them up maybe like so:
int gender = 0; // using 0 or 1 (or 0, 1, 2.. if you might ever have 'unset')
string [] heshe = { "he", "she" };
Later, your string to modify might look like:
string phrase = "_HESHE_ was really happy";
// when using the phrase:
string newPhrase = phrase.Replace("_HESHE_", heshe[gender]);
2 Likes
You can also have an object for gender with all the relevant properties instead of an index into a number of lookup tables. No matter how you factor it, though, I can’t imagine doing anything other than the same basic idea expressed by @methos5k , above.
1 Like
Thanks you guys will try it out then. 