Amnesia/forgetting one's name: is there a better way?

So I have this code. It works, but it feels slightly repetitive.

Andrew Schultz is a privately-named person. the player is Andrew Schultz.

understand "Andrew Schultz" and "Andrew/Schultz" as Andrew Schultz when know-name is true.

know-name is a truth state that varies.

check examining Andrew Schultz when know-name is false:
	say "You think you have a name. You're not sure." instead;

Putting aside the risks of a Game About Amnesia, is there any way to tell Inform “Andrew Schultz is privately-named up to a certain point?” now Andrew Schultz is publically-named throws an error.

Or is the above code the best we can do? And, is the “understand” code functionally equivalent to being publically-named once know-name is true?

2 Likes

That’s the easiest way to do it.

Right; the private/publically-named property is applied only at compile time. (I think it’s the only property which is.) (In fact the I6 attribute slot is recycled and used for a different purpose at runtime.)

3 Likes

Does the “Straw Into Gold” example in the Recipe Book help any?

RB 2.1. Varying What is Written

1 Like

I wondered why this query made me feel funny. Then I recalled that in my WIP, I’ve made all things privately-named by default, so you actually described my general way of doing things.

i.e. Any things I want to make completely inaccessible to the player’s typing at particular times, I apply an understand line with conditions.

-Wade

3 Likes

That makes sense. It’s not something people would want to change too often except in weird circumstances.

This is a neat bit of code I wasn’t aware of … but I don’t want the player to “know” their name e.g. “x andrew” before knowing my name is Andrew should give no response, instead of saying aha, you know its name!

That makes a lot of sense, if you are someone who is slowly learning about things. I suppose in this case you’d rather not let the reader accidentally spoil stuff.

Thanks all. This was one of those “it seems right but if I can do better I want to know” questions, and I appreciate the additional insights.