Accessing Stored Pronouns

In terms of something like,

set pronouns from the magic ring. 

is there a way to actually access/read out those variables?

You can list what they currently are by using the “PRONOUNS” debugging feature while playing, but is there a way to (for instance) store their current values into another variable?

Documentation seems very scarce on this feature, which makes me think it might require some I6 hack or something I have no clue about.

How about something like:

[spoiler][code]“Pronoun Access”

Include (-

[DereferencePronoun index o;

o = LanguagePronouns-->index;

! print “<”, index, " points to object #", o, “>”;
return o;
];
-)

Table of Pronoun Index Values
pronoun position
“it” 3
“him” 6
“her” 9
“them” 12

To decide which thing is the item at position (N - number) in LanguagePronouns:
(- DereferencePronoun({N}); -)

To decide which thing is the item referred to by (T - text):
if T is a pronoun listed in the Table of Pronoun Index Values:
let dereference index be the position corresponding to a pronoun of T in the Table of Pronoun Index Values;
decide on the item at position dereference index in LanguagePronouns;
otherwise:
decide on the player. [illegal to decide on nothing, and this makes a useful response for “us”]

[Note that these are automatically set if there is only one value – otherwise last thing fitting that was “noticed”]
Every turn:
let T be “it”;
say “’[T]’ -> [item referred to by T].”;
now T is “him”;
say “’[T]’ -> [item referred to by T].”;
now T is “her”;
say “’[T]’ -> [item referred to by T].”;
now T is “them”;
say “’[T]’ -> [item referred to by T].”;
now T is “us”; [any improper text will return the player, see above]
say “’[T]’ -> [item referred to by T].”

Place is a room.

Alice is a woman in Place.

Bob is a man in Place.

A rock is in Place. A stick is in Place.

A plural-named thing called some pebbles is in Place.

Test me with “z / x rock / x stick”.
[/code][/spoiler]

You can probably adapt it if it’s not quite what you wanted.

Yeah, that should do nicely once I figure out how to integrate it with my project.

Thank you for such a complete effort. I would have NEVER figured out how to get that to work.

You’re welcome. I assure you: You would have figured it out… eventually.

But getting there faster is what this forum is about, right? :slight_smile:

By the way, if you primarily want to use it in say statements, the above is not the greatest design, since you have to keep resetting the temporary text used to access it. My recommendation would be to create a new kind of value, e.g.

A pronoun-reference-key is a kind of value. The pronoun-reference-keys are it-p, her-p, him-p and them-p. [need suffixes to avoid collision with already-used words]

Then you can just change the Table to use those in the first column, and adjust the way the lookup routine functions. Then it’s easier to do things like:

say "[the item referred to by it-p]";