Getting a simple reply from a character in Inform 7

334 Views Asked by At

I have a non-player character in an Inform 7 Interactive Fiction story that I would like to get a simple reply from. The character is a robot doctor. When you get on the exam table the robot doctor holds out a tongue depressor and asks you to say, "Ah." I would like the character to say something when the player types, "say ah" but so far it's not working.

Here is my code thus far:

The exam table is a supporter in the Med Bay. It is fixed in place and enterable.
In the Med Bay is a person called Auto-Doc.
After entering the exam table, say "A number of bright lights embedded in an overhead panel bathe you in a cold, white light. A panel in the wall opens and an auto-doc trundles forth on a three-wheeled base. Clutching a tongue depressor in its mechanical grip, a small speaker hidden within crackles with the words 'Say, ah.'"
After speaking in the presence of the Auto-Doc, say "Mmm. Mm-hmm. Very interesting."

The last line is causing the compiler to throw an error, but I am unable to figure out what to use. I've tried Instead of speaking, After telling the Auto-Doc something, After saying ah in the presence of the Auto-Doc, and so far nothing is working.

Any hints as to how I can get the Auto-Doc to say something after the player types "say ah"? I'd even be happy with the Auto-Doc replying the same way no matter what the player says.

2

There are 2 best solutions below

1
Tehgby On BEST ANSWER

Here's a handy tip: command ACTIONS while playing the game in the IDE to see the action name when you type commands.

>actions  
Actions listing on.

>say ah  
(to Auto-Doc)  
[answering Auto-Doc that "ah"]  
There is no reply.  
[answering Auto-Doc that "ah" - succeeded]  

>

So the rule you're looking for is:

Instead of answering Auto-Doc that "ah":
    say "Mmm. Mm-hmm. Very interesting."
0
Dave H. On

After some more research, I have discovered that the responses understood by Inform are yes, no, and sorry. So understand "ah" and "say ah" as saying yes. followed by Instead of saying yes in the presence of the Auto-Doc, say "Mmm. Mm-hmm. Very interesting." is one way to do it.

Here's what the code looks like now:

The exam table is a supporter in the Med Bay. It is fixed in place and enterable.
After entering the exam table, say "A number of LEDs embedded in the ceiling switch on, bathing you in a cold, white light. A panel in the wall opens and an auto-doc trundles forth on a three-wheeled base. Clutching a tongue depressor in its mechanical grip, a small speaker hidden within crackles with the words 'Say, ah.'"
In the Med Bay is a person called Auto-Doc.
Instead of saying yes in the presence of the Auto-Doc, say "Mmm. Mm-hmm. Very interesting."
Understand "ah" and "say ah" as saying yes when location is Med Bay.
Instead of saying no in the presence of the Auto-Doc, say "Hmm..."

This sets up two different non-committal responses for saying yes and no. Saying 'ah' is understood as saying yes, so the player gets a response.