<aside> 💡 While the most obvious use for text substitution is in customizing simple aspects like player name and gender, the system is immensely powerful. In this guide, you’ll learn how to insert customized sentences and sentences with pronouns that reflect the player choices. To learn more advanced features, read the advanced guide here: Objects
</aside>
Any string, numerical variable, or attribute can be referenced using curly brackets. In the following example, we’re giving the variable PLAYER
the name “Bob”.
[set: PLAYER "Bob"]
Once we have this, we can now reference PLAYER.name
at any point in the script, and it will call in Bob. We’d write that like this:
I'm named {PLAYER} after my father.
The code above will display as “I’m named Bob after my father.” You can use these substitution commands on choices too – this way you can allow players to choose names, pronouns, and more! Check out the example below. Remember to change PLAYER
to whatever your main character’s Unique ID is.
What would you like to name your character?
* Bob [set: PLAYER "Bob]
* Miguel [set: PLAYER "Miguel"]
* Kaori [set: PLAYER "Kaori"]
* Sage [set: PLAYER "Sage"]
[join]
You may want to let players select pronouns for their characters. No problem! We can do this by using the set command paired with the character’s Unique ID, the attribute .gender
, and either the male
, female
, or nonbinary
identifiers.
In the following example, we are setting TAYLOR
to use she/her pronouns.
[set: TAYLOR.gender "female"]
The text on the left will be substituted for the appropriate pronoun on the right:
{ID.he}
he, she, ze{ID.him}
him, her, zir{ID.his}
his, her, zir{ID.hers}
his, hers, zirs