Hello all,
I have managed a solution, inspired by the one proposed by @Zed in Recognize third person pronouns as the player - #7 by Zed plus the necessary addition to edit the LanguageDescriptorstable, which —to avoid rewriting the whole thing— I achieved leveraging the fact that Inform7 language kits (at least in the version of I7 that I’m using) have a currently-unused LanguageInitialiseI6 function.
As recommended by @jwalrus I’ve also added some handling for the case when the player uses my instead of your.
For the curious, this is the code I’m currently using:
Include (- Constant ME1__WD = 'you'; -) replacing "ME1__WD".
Include (- Constant ME2__WD = 'yourself'; -) replacing "ME2__WD".
Include (-
Constant YourPossessive = 'your';
[ LanguageInitialise ;
LanguageDescriptors-->1 = YourPossessive;
]
-) replacing "LanguageInitialise".
Before printing a parser error (this is the wrong possessive rule):
if the player's command includes "me/my/myself":
if the player's command matches the regular expression "\bmy (.*)$":
let M be "YOUR [the text matching subexpression 1]";
say "What makes you think I could find [M] here?" instead;
otherwise:
say "You are not here if not through me, why are you referring to yourself?" instead.