Continuing to navigate treacherous seas, and soliciting input of much more capable sailors than myself. In my WIP I am being pretty diligent about not assuming anything about the player, wrt gender, preferences and pronouns. This is not so hard to do (and only occaisionally clumsy) for a second person UI situation.
However, with NPCs it is much more intrusive into text. I have been creatively sidestepping things successfully until the introduction of the PC’s love interest. While still being pretty circumspect about not assuming anything about the PC, NPC pronouns could be a minefield. For one, they can start to read really clumsily over time.
adv3 seems to have a fairly usable model of pronoun management between the isHim
, isHer
, and isPlural
properties, effectively giving three options: him, her, them. Granted, these are not fully flexible in this day and age, but for an NPC, is this reasonably accommodating of player preferences? (Let’s assume for purposes of this discussion I have engineered an extremely tasteful and respectful way to even ask the question.)
Assuming so, it is then a technical matter of leveraging the parameter substitution capability to let messages tailor themselves. For those unfamiliar, the Technical Manual has a section on this: Message Parameter Substitution.
It is really just a question of creating a ‘global’ object selector that you can use… everywhere. There are many ways to do this, but a pretty easy way is to
// effectively adds luvobj as available param substitution for all verbs
modify Action
getMessageParam(objName) {
if (objName == 'luvobj') return loveInterestNPC;
else return inherited(objName);
}
;
The original getMessageParam
already provisions ‘magic’ objNames, so I didn’t feel too bad about that. This makes the ‘luvobj’ identifier available to all verbs in the game. (The standard mechanism would want to be executed verb by verb.)
Then, I use a method in the appropriate Actor
loveInterestNPC : Person
setGender(pref) {
if (pref == 'them') isPlural = true;
else {
isPlural = nil;
isHim = (pref == 'male');
isHer = !isHim;
}
}
[&etc]
;
All that’s left is to diligently populate descriptions and messages with these hooks to keep things on the beam. ie
loveInterestNPC : Person 'true love' 'true love'
"{It luvobj/he} {is} everything you hoped for in a partner. "
uselessToAttackMsg = 'Why would you do that to {it luvobj/her}? '
// ...and so on
;
Note you COULD use {it dobj/him}
in a lot of cases (ie when the NPC is the dobj of the command), but I find it is more auditable to force myself to use luvobj anyway. Special attention needs be paid to the verb handling for ‘they’ vs ‘he/she’, as in ‘they are cool’ ‘he/she is cool’, which is the purpose of {is}
above.
Anyway, any thoughts on the appropriateness/technical validity of this approach?