Remembering an NPC

My question du jour is about ways to remember NPCs from anywhere in the game to get more information about them .

I currently have this set-up:

Understand the command "remember" as something new. Understand "remember [something]" as remembering. Remembering is an action applying to one thing.

Something can be memory. Something is usually not memory.

The ted-memory is a backdrop. It is memory. It is scenery. It is everywhere.
Understand "Ted" as Ted-memory.

Does the player mean doing something other than remembering to something memory: it is very unlikely.
 
Instead of remembering something:
	if the noun is memory:
		if the noun is Ted-memory:
			say "You remember how mean Ted has always been to you!";
    otherwise:
        say "You can only call up memories of people.".

But this brings up the annoying disambiguation of:

x ted

(Ted)

A handsome man with a cruel glint in his eyes.

And Iā€™m quite sure there are problems with this I havenā€™t encountered yet (because there always are other problems). So I wonder what learned counsel yā€™all might have about this?

1 Like

Why not simply allow the player to remember Ted (the person) directly, without creating the phantom scenery version? The Nameless example shows how to create an ā€œinterrogating aboutā€ action that allows you to ask a character about an object, even one thatā€™s not currently present, so I think you should be able to simplify it to fit your ā€œrememberā€ action.

4 Likes

Well, that would be easier.
[any known thing] is very useful indeed. There is no end to the elaborate knots I can tie to accomplish something badly in Inform.
Iā€™m going to play with this. Thanks for taking time from Henry to answer my question. How is he doing? Letting you sleep at all yet?

1 Like

There are two parts to this: having the remember-able NPCs in scope and associating the text of the memory with the person. There are a bunch of ways one could approach this, but one I think is straightforward is using the any token on remembering and one visible thing in the action:

Remembering is an action applying to one visible thing.
Understand "remember [any thing]" as remembering.

any thing / one visible thing has to be approached with caution 'cause it admits everything in the game, even things out of play, so youā€™ll want check statements to rule out things that arenā€™t people. (I didnā€™t use any person 'cause then remembering a non-person thing would be a parser error. Alternatively, one could use any person and write a custom rule for printing that parser error when the current action is rememberingā€¦)

And then just A person has a text called remembrance. would be an easy way to establish per-person memories.

2 Likes

Yep. Remember [any known thing] worked like a charm, with way less fuss. Also working through ā€œA person has a text called remembranceā€ to see if I can get that to work, too.

One day Iā€™ll write sleek, elegant code like itā€™s second nature.
Just kidding. That will never happen. :grinning:

3 Likes

My goal isnā€™t to write sleek, elegant code ā€“ itā€™s to wrote code thatā€™s ugly and inefficient in a different way than the ugly, inefficient code I wrote last time :slight_smile:

And since itā€™s your thread, I guess itā€™s not threadjacking to say Henryā€™s doing great! Heā€™ll be two months old next week, crazily enough, and heā€™s still super sweet tempered, though he doesnā€™t sleep quite as well as he used to ā€“ weā€™re mostly managing but hoping he gets back up to his three-hour nap length rather than the 90 minutes to two hours heā€™s currently at. He got some vaccines yesterday and had a tummyache as a result, so that was a rougher night, but heā€™s feeling better now thankfully. Oh and he figured out how to smile two weeks ago, which has been literally the best thing in the world. Anyway overall A+ baby!

5 Likes

Iā€™ve been programming a long time and on very rare occasions sometimes write maybe 20 lines in a row that donā€™t get substantially revised later. Iā€™m working on an extension now and Iā€™m feeling okay about itā€¦ now that Iā€™ve tried and discarded virtually every other major choice for organizing it. At first there were two different activities, then one, then a table whose contents would control things, then a rulebook ā€“ at one point I was planning a relation, but managed to find something I liked before actually implementing that one, at least.

3 Likes

You may also want to look at the Epistemology extension in general (thatā€™s in the public library). It adds a system of tracking what/who the player knows. The player can know things by seeing them, an automatic mechanic, or by the game saying, ā€˜Ok, you know about Jane,ā€™ - because you read about her in a book, or someone mentioned her in conversation, or because the player has always known Jane but not met her in the current game yet.

There is some additional code in there about recalling a previously seen object. But where I see this going for you is (without knowing more about your game) policing things so the player can only remember NPCs they know in some fashion. And semi-automating the business of when and how they know.

-Wade

3 Likes

Eric Eve who wrote the Epistemology extension has also written a whole suite of conversation extensions (Conversation Framework) that make use of it. They handle things like topics and asking characters about objects and other characters. Iā€™ve used it in most of my I7 games.

3 Likes

ā€¦or consider Optimized Epistemology by Zarf, which is close to a drop-in replacement for Epistemology, but doesnā€™t automatically account for new objects appearing in the room.

Thanks for all the suggestion of extensions. Iā€™m not opposed to using them, but Iā€™m at a place in my learning where Iā€™d like to at least try to code things on my own as lessons. I find that when I use extensions, I donā€™t really understand why they work just by reading them. Iā€™m one of those ā€œlearn by doingā€ people. So I want to hammer out a solution of my own, and if itā€™s badly done, Iā€™ll use an extension instead, but Iā€™ll still have had the practice of trying to code it.

2 Likes