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