Page 1 of 1

How to modify parts of text according to the player's gender?

Posted: Mon Aug 22, 2022 6:42 am
by TheBullet
I guess this doubt has already been solved in another thread but I have not found it.

For our games we usually use a code similar to this: [Gender: he, she]. If the gender of the player is male then "he" appears, otherwise "she" appears. This allows us to use the same string for both genders.

Is it possible to do something similar using Dialogue System?

I have tried to call to an own function that modifies the text to show in StardardUISubtittlePanel.SetSubtitleTextContent but for some reason that I don't know, I cannot call to our code from the scripts of your asset.

Thanks!

Re: How to modify parts of text according to the player's gender?

Posted: Mon Aug 22, 2022 8:56 am
by Tony Li
Hi,

This post explains one way to do it. This post contains another example.

Alternatively, you can set a Dialogue System variable to the player's gender. For example:

Code: Select all

DialogueLua.SetVariable("playerPronoun", "she");
Then use the [var=variable] tag, such as: "I think [var=playerPronoun] is very nice.".

Re: How to modify parts of text according to the player's gender?

Posted: Tue Aug 23, 2022 11:48 am
by TheBullet
Thanks! The second example has helped us a lot!

Re: How to modify parts of text according to the player's gender?

Posted: Tue Aug 23, 2022 12:02 pm
by Tony Li
Glad to help!