跳至内容

入门 / 引擎基础

代词系统

如何让玩家选择自己的代词,并让游戏记住这一选择。

本课目前仅提供英文版。

You may want to let players pick their pronouns, and have the game remember their choices. This is how! The goal will be to:

  1. Set up variables in the memory bank to hold the different versions of the pronouns a player COULD pick.
  2. Offer a choice to the player between pronouns early in your game.
  3. Based on the choice option they pick, use remember steps to set all of the variables you created with the relevant chosen pronoun.
  4. Refer to those variables in text to have the engine use the pronoun they selected!

Set Up Variables in the Memory Bank

To remember player input across multiple episodes, use variables in the memory bank. Learn Memory Bank basics here. Click on the orange Memory Bank button on the left, then add a new variable with the plus button at the top.

For a pronoun system, we'll want to create memory bank text variables for every kind of pronoun we may end up referring to the player as throughout the course of the game, and set their defaults. For example:

MC_her = hers
MC_her = her
MC_she = she
MC_hers = hers
MC_herself = herself
MC_Hher = Her
MC_Sshe = She
MC_Hhers = Hers
MC_Hherself = herself
MC_is = is
MC_was = was

You'll see above that Dorian variables aren't case sensitive, so if you want to have variables include capitalization, add in another letter (see above, MC_her vs MC_Hher). See how this looks in the Memory Bank below.

Memory Bank panel listing the pronoun text variables and their default values

2. Add a Choice for the player to pick pronouns

Somewhat early in your game, create a choice node that has options for the player to pick their pronouns.

A choice node offering the player options to pick their pronouns

In the node after each pronoun option, use remember steps to save the player's selection for every text variable you made. For example, to the right is the node after the player picked "he".

Your goal is to make sure you save the "he" version of all the iterations you could use of "he" just this once!

The node following the "he" choice, showing remember steps that set each pronoun variable

3. In the option nodes, use remember steps to save the pronoun they picked.

A list of remember steps saving each pronoun variable in an option node

Going forward, any time you want to refer to one of these pronouns, as long as your initial nodes set all the variables correctly, you can surround the variable name in curly brackets in text, and the engine will replace it with what you saved in the remember step. For example:

  • "I can't wait to see {MC_her} outfit!"
  • "{MC_Sshe}'s on her way over now."
  • "I can't believe {MCshe} {MCis} already ready."
Dialogue text using pronoun variables in curly brackets that the engine replaces

The curly brackets in the first step above are replaced by the engine to display what was saved. See Right.

4. Now you can refer to the variables you saved in text!

Rendered dialogue showing the saved pronouns substituted into the text

Your choice node should have an option for each possible pronoun selection, and link out to one node per pronoun.