This script leverages SugarCube 2's new template markup and API to create a complete, user configurable pronoun system.
Author | ChapelR |
Website | https://twinelab.net/custom-macros-for-sugarcube-2/#/pronoun-templates |
Story format | SugarCube 2 |
Last checked | Sun May 31 2020 |
License | Unlicense |
Download | pronouns.zip |
This script leverages SugarCube 2's new template markup and API to create a complete, user configurable pronoun system. Users are free to list their own pronouns by filling out a form, or choose from one of three presets "He/Him", "She/Her", and "They/Them". You can use the provided macro or JavaScript function to give the user access to the pronoun configuration dialog, and you can optionally allow the user to re-configure their pronouns from the Settings dialog at their pleasure.
See the documentation for more on template markup. Contractions he's
, she's
and they're
are represented with a hyphen (e.g., ?he-s
) rather than an apostrophe.
The templates included here are designed to make your writing as simple and painless as possible, so many names are available for each template. For example, the template ?he
and ?she
will both reference the template for subjective pronouns. The only gotcha here are the determiners (possessive adjective pronouns), which are followed by an underscore _
for the "his" and "her" determiner pronouns, since the use of "his" and "her" can be unclear. Consider the following:
The confusion here is that male pronouns and female pronouns both re-use the determiner as another form of pronoun, for the male pronoun, "his" is both the possessive and determiner form, for female pronouns, "her" is both the objective and determiner form. The non-binary "they/them" pronoun set, however, does not have this issue:
If you want to write your templates using the male or female pronouns, you will need to use the underscore where appropriate:
?hers
."?her_
car."?her
."?his
."?his_
car."?him
."To get a capitalized version of a template, for example, to start a sentence, simply capitalize the template. ?he
, for example, may return he
or she
, but ?He
will return He
or She
.
Here is the complete list of templates provided by this system.
Subjective | Objective | Possessive | Determiner | Reflexive | Nouns | Contractions |
---|---|---|---|---|---|---|
?he |
?him |
?his |
?his_ |
?himself |
?man |
?he-s |
?He |
?Him |
?His |
?His_ |
?Himself |
?Man |
?He-s |
?she |
?her |
?hers |
?her_ |
?herself |
?woman |
?she-s |
?She |
?Her |
?Hers |
?Her_ |
?Herself |
?Woman |
?She-s |
?they |
?them |
?theirs |
?their |
?themself |
?person |
?they-re |
?They |
?Them |
?Theirs |
?Their |
?Themself |
?Person |
?They-re |
?He went to the bank to find out what state ?his_ mortgage was in. For ?him, all that mattered was that the house remained ?his.
Configuration options are near the top of the un-minified script. The critical options you may want to change are showSetting
and default
. The former determines whether the user can access the Setting API dialog to change their pronoun at any time. If you aren't using the Setting API, or if you'd rather the choice be permanent, you'll need to set this option to false
. The default
option determines which pronoun preset is defaulted to in the pronoun configuration dialog when the user first opens it, and also what the pronoun templates return prior to the user configuring their pronouns. You can change this option to "male"
, "female"
, or "other"
.
This system uses a story variable (State.variable['%%gender']
by default) to store information in your game's state. You should avoid overwriting this variable, or change it using the configuration options.
This system adds a setting to the Setting API. By default the setting's name is gender
. You should avoid overwriting this setting, or change it using the configuration options (the name
property of config
). You can optionally disable the setting entirely via the config options.
This system creates a dialog with the class custom-gender
. You can use this class to target the dialog and anything inside it for styling, e.g. #ui-dialog-body.custom-gender input[type='text'] { color : violet; }
.
Demo Twee code:
:: Start ?He <<verb 'is'>> on the way. ?She<<verb "'s" "'re">> pretty cool. ?He <<verb 'ran'>> away. ?She <<verb 'goes'>> to the beach all the time.