Shortcut for 'asking' the only person in the room.

I’m still working on my virtual patient.
I’ve got my interview questions working except:

It seems it would become tiresome to have the player have to type
“ask patient about TOPIC” over and over again.
It seems silly when the patient is the only other person in the room.

When the player types
“ask about TOPIC” though Inform responds “You can’t see any such thing.”
I’m assuming that that’s because its expecting a person to be specified.

I looked at trying to clarify with “very likely”
I looked at intercepting commands in the presence of someone.
I tried to overload ask to take a single text as a topic.
I tried various configurations of understand.
I’m not making progress.

I don’t want
“ask patient about TOPIC” to go away I just want “ask about TOPIC” to understand that the only person in the room is implied.

While we’re at it. It’d be great if I could have Inform respond sensibly to just plain “ask”
I’d like to respond “Ask patient about what?”

Any help would be appreciated.
Merry Christmas

Jake

You want something like this:

Asking about is an action applying to one topic. Understand "ask about [text]" as asking about. Carry out asking about in the presence of someone: try asking a random person in the location about the topic understood.

Thanks. It works of course. It would have never occurred to me to invoke randomness to achieve a certain result.

Asking about is an action applying to one topic.
Understand "ask about [text]" as asking about.
Carry out asking about in the presence of someone: try asking a random person in the location about the topic understood.

I was wondering about this for my game. The player, who is a detective named Johnny Dollar, uses ASK ABOUT and TELL ABOUT to interrogate suspects or other NPCs. Often there is only one NPC in the room and it would be nice to automatically ASK that person. So this looks very helpful. However I have two things I am wondering about that cause this not to work quite right.

  1. I have defined a default case for Instead of asking Johnny Dollar about something…
    As a result, the new code seems to default to asking the player, rather than an NPC.

  2. If there is more than one NPC in the room, then it’s hard to tell who is responding.

If there is more than one NPC in the room, perhaps it would be best to simply reject the command or ask the player to specify who they are asking. But in the default case of just having one NPC visible in the room, it would be nice to supply an intelligent default.

Any ideas on how to do that? Any help is appreciated.

–Zack
z-machine-matter.com

Try Michael Martin’s Assumed Conversers extension which should do all that out of the box.

Thanks. That works great for ASK ABOUT topic or TELL ABOUT topic, but it doesn’t work well for things that are objects. Instead, they end up getting a default response indicating that there’s no rule implemented. In otherwords if there’s an object called Gun,
ASK ABOUT Gun
and
ASK Duffy ABOUT Gun

do different things when Duffy is the only NPC present.

I’ve implementing the actions Quizzing it About and Informing it About as defined in Jim Aikin’s Inform7 Handbook as well as lots of Instead of Quizzing Duffy about code. But it appears the Assumed Conversers extension causes a bit of a collision with Jim’s code (or at least wasn’t designed take it into account.)

For example, I’ve used Jim’s code to define:

Quizzing it about is an action applying to one thing and one visible thing. Understand "ask [someone] about [any thing]" and "quiz [someone] about [any thing]" as quizzing it about.

When the player types ASK ABOUT Gun they get this code below firing:

Instead of asking Sgt Duffy about something, say "[one of]'Dollar, I think we need to question all the suspects about their whereabouts and arrival.'[or]'Never mind that, Dollar, we need to figure out everyone's alibi and possible motive.'[or]'Pardon me?'[or]'What?'[or]'Mr Dollar, really. We've got some business to tend to.'[or]Sgt Duffy ignores you.[stopping]".

Instead of this code that runs if they type ASK Duffy ABOUT Gun

Instead of quizzing Duffy about gun, say "'Dollar, yes, I have a gun and a shiny badge, too.  If you're a good little insurance investigator, I'll let you look at them later on.'"

Any ideas?

–Zack

Michael Martin’s extension makes the command “ask about [text]” understood as his asking generically action, which is later converted to the ordinary asking it about action. I guess that’s why the ‘instead of asking Duffy about something’ rule fires.

So, I suppose, you need to do for quizzing what Michael does for asking in his extension: define your own ‘quizzing generically’ action applying to one visible thing, have “ask about [any thing]” understood as quizzing generically and later convert it to the ‘quizzing it about’ action.