Pre-release
AdventureJS Docs Downloads
Score: 0 Moves: 0
Tutorial explaining how to work with pronouns in AdventureJS. tutorial, pronouns

Customize Output:Gender & Pronouns

All AdventureJS assets have distinct gender and pronouns settings, though the distinction only matters for the player character. The reason for having both is so that the player character can be male, female, transgendered, etc but receive messages in first, second, third person, etc. For example: "I take the lamp." vs "You take the lamp." vs "They take the lamp."

The game itself also has a distinct game.settings.pronouns which may be used to set certain parser messages to use different pronouns. For example, the player might use second person pronouns while the parser uses first person pronouns, such as: "I don't know the word foo." This lets authors make it seem as if the parser and the player are separate entities.

All of AdventureJS's built-in responses to players (over 1,000 of them) are pre-formatted to support pronoun switching. The below example shows how to set pronouns for the game, the player character, and an NPC. Gender / pronoun settings can be changed dynamically during runtime.

MyGame.settings.set({ pronouns: "second", });
MyGame.createAsset({
  class: "NPC",
  name: "turtle",
  pronouns: "nonhuman",
  gender: "male",
});
MyGame.createAsset({
  class: "Player",
  name: "Hero",
  pronouns: "second",
  gender: "female",
});

AdventureJS comes with these pronouns out of the box: first, plural, second, male, female, nonbinary, and nonhuman. Pronouns are stored in a lookup table at game.dictionary.inflections. The table also includes a few common contractions and frequently used verb agreements. We use plural pronouns as lookup keys for our pronouns table, because every plural pronoun is unique (for example, consider our | ours vs his | his). See the table below for a complete list of substitutions.

Pronoun Lookup Table

First Plural Second Nonbinary Male Female Nonhuman
we I we you they he she it
us me us you them him her it
our my our your their his her its
ours mine ours yours theirs his hers its
ourself myself ourself yourself themself himself herself itself
ourselves myself ourselves* yourself themselves himself herself itself
we'd I'd we'd you'd they'd he'd she'd it'd
we've I've we've you've they've he's she's it's
we'll I'll we'll you'll they'll he'll she'll it'll
we're I'm we're you're they're he's she's it's
don't don't don't don't don't doesn't doesn't doesn't
haven't haven't haven't haven't haven't hasn't hasn't hasn't
weren't weren't weren't weren't weren't wasn't wasn't wasn't
have have have have have has has has
were was were were were was was was
are am are are are is is is

* "Ourself" and "ourselves" are admittedly a bit at cross purposes. "Ourself" represents a single entity that uses plural pronouns whereas "ourselves" represents multiple entities. We include "ourselves" for your hive minded characters.

Adding Pronouns

Authors can easily add new pronoun sets to a game, as shown below. (The example only shows the first couple of pronouns, but of course you'd want to add a complete set, as listed in the table above.)

MyGame.settings.set({ pronouns: "foo" });
MyGame.dictionary.inflections.foo = { we: "IFoo", us: "MeFoo", [...] }

Placeholder Text

In order to write text that adapts to the game's pronouns setting, use pronoun and contraction placeholders, as in the example below.

MyGame.createAsset({
  class: "Thing",
  name: "unexceptional thing",
  description: `{We} {don't} see anything special about the unexceptional thing. `,
});

In order to write text that adapts to the player's pronoun setting, use pronoun and contraction placeholders, as in the example below.

MyGame.createAsset({
  class: "Thing",
  name: "unexceptional thing",
  description: `{We} {don't} see anything special about the unexceptional thing. `,
});

In order to write text that adapts to the game's pronoun setting, use the same scheme but prepend p: to the placeholder to indicate that it should use the parser's pronouns setting. This applies to fewer messages. Here are some of them.

MyGame.settings.set({
  if_verb_is_unknown_print_this: 
    `{p:We} {p:don't} know how to {word} anything. `,
  
  if_word_is_unknown_print_this: 
    `{p:We} {p:don't} know the word {word}. `,

  if_word_is_common_print_this: 
    `{p:We} {p:don't} know of any {word}. `,

  if_parser_has_no_response_print_this: 
    `{p:We} {p:don't} know how to {input}. `,
});

Further Reference

To learn more about placeholders, see Customize Output: Placeholders.

To learn about adding custom pronouns, see Advanced Scripting: Custom Pronouns.