I7: conversations with a multi-location AI

Hello–I suspect this is a horribly basic question but I can’t even figure out what terms I should search for this under, and I’ve had no luck either in Aaron Reed’s I7 book or the Inform Recipe Book.

I wanted to create an NPC in I7 who is effectively an insubstantial character–no physical interaction, no body, nothing–as it’s an AI to whom the PC can talk from multiple locations. My first guess was to have the NPC invisibly follow the PC around, but this seems inelegant. If anyone has pointers or links to how to do something like this, I would be grateful.

I would think you could place the AI in scope, either every turn or for selected actions, as needed. I can’t remember what the exact grammar is, though, and I’m not at a computer that I can test on. Sorry.

You could also make a backdrop and have the AI be a part of the backdrop.

I would recommend changing the grammar of the conversation commands so that the character spoken to doesn’t need to be in scope. This is all you need to do if your insubstantial character is the only NPC. If there are other, corporeal NPCs as well, you can define an adjective to distinguish them and add a rule like this:

Before doing anything with a corporeal[<-adjective] character (called the interlocutor): if the player cannot see the interlocutor: say "[The interlocutor] doesn't seem to be here right now."; stop the action.

Thank you all–scope was what I was trying to remember but it’s been a long time since I’ve used I7 and the vocabulary just wasn’t coming to mind. I only have one NPC so ektemple’s solution looks like a good fit!

It’s not enough to change the grammar lines, is it? You need the actions to be defined as appling to things out of scope, as well. The standard asking it about action (and grammar line) is defined like this:

Asking it about is an action applying to one thing and one topic. Understand "ask [someone] about [text]" as asking it about.

To do what you want, they ought to be defined thus:

Asking it about is an action applying to one visible thing and one topic. Understand "ask [any person] about [text]" as asking it about.

That won’t work, however, since the compiler will complain that asking it about has already been defined in the Standard Rules. But you can define a new action that does the trick and define a custom command verb syntax for a custom omnipresent NPC kind that lets you trigger the custom action:

[code]An omnipresent NPC is a kind of person.
HAL is an omnipresent NPC.

Asking it at a distance about is an action applying to one visible thing and one topic.
Understand “ask [any omnipresent NPC] about [text]” as asking it at a distance about.[/code]

Felix, thanks for pointing out that I meant action + grammar, not just grammar.

Personally, I would just hit the “install” button on the Standard Rules (assuming that the Mac OS isn’t the only IDE with this feature) to create a copy of the Standard Rules and edit that directly. Or, if you’re using any of the conversation extensions, hack the extension directly.

The Standard Rules are in dire need of a complete organizational overhaul so that they can be replaced in small sections using the section replacement syntax. Currently, they are one of the worst examples of Inform code structure available…


The backdrop solution is the lowest-effort, I’d say.

I agree, but I also like Gravel’s solution to manually place the AI in scope. It requires some extra rules, but IMO is still easier and safer than hacking the standard rules and / or extensions, or creating a whole new set of conversation - related actions.

[code]Lab is a room. Sam is a man.

[Here you’ll need to add any other conversation - related actions in your story, e.g. “informing about it” if you’re using Eric Eve’s “Conversation Framework” extension:]
Answering Sam that is communing.
Telling Sam about is communing.
Asking Sam about is communing.

After deciding the scope of the player:
place Sam in scope.

Before doing anything when the current action involves sam (this is the can only commune with sam rule):
unless communing, say “You can only talk to Sam.” instead.

This is the bypass accessibility only when communing rule:
if communing, make no decision;
otherwise follow the basic accessibility rule.

The bypass accessibility only when communing rule is listed instead of the basic accessibility rule in the action-processing rules.

test me with “sam, boo / say boo to sam / tell sam about boo / ask sam about boo / hit sam / x sam”.[/code]

And it’s similar to the approach I took in the “Crowds” extension, which may do what you want. The current version of Crowds avoids some of the odder issues that arise when a person is part of a backdrop.

It’s a bit more than you need, but “Conditional backdrops” is a little bit less. Feel free to examine both extensions for how to create a person who behaves like a backdrop.

eyeballsun.org/i/Conditional%20Backdrops.i7x (the version on the i7 site is not up to date)

Many thanks to all for the suggestions/discussion. I will check out the Crowds and Conditional Backdrops extensions.

On the other hand, if we want to do the contrary and ask a person about other persons or things (not topics), not in scope, how could we achieve this? It seems Inform doesn’t handle this case. We can still use Conditional Backdrops but it doesn’t seem very logical to make things “fly” like this around the game just to talk about an object which is not present.

Then you can just define the conversation verb grammar as “ask [someone] about [any thing]” (and have it apply to two visible things) and it will match all objects and ignore scope.

Thank you Juhana!

I tried the [any thing] thing, but missed the “apply to two visible things”. When using with “apply to two things”, it doesn’t say anything (blank reply). I didn’t understand why “visible” was required, because when it’s not in the current room it’s not even “visible”, but it’s because it’s in opposition with “touchable”.

It’s widely considered one of the most confusing parts of I7: inform7.uservoice.com/forums/573 … e-in-appli