Conversation?

I’ve been learning the basics of Inform 7 at inform7.com/learn/man/chap25.html but one thing which seems like it should be easy is greeting someone. Inform has native support for asking about something or even answering, but I can’t for the life of me figure out how to just program a basic response to hello. Something like

After saying “Hello” to Marty, say “Howdy.”

Thanks

1 Like

http://inform7.com/extensions/Eric%20Eve/Conversation%20Framework/index.html

You should try the above extension. :mrgreen:

1 Like

To get the basic response, without any extensions:

Instead of answering Marty that "hello":
	say "'Howdy.'"

You’d know it’s the answering action (rather than “saying” or some other term) by using the “actions” debug command.

2 Likes

Sorry for capturing this old thread from the pleistocene, but I don’t seem to get some very basic concepts.

In Dummyroom is a man called the Ambassador.
Instead of answering the Ambassador that “hello/hi”:
Say “The ambassador says something.”.

ambassador, hi
There is no reply.

say hi to ambassador
The ambassador says something.

What do I need to do so that “ambassador, hi” works as well?

2 Likes

Huh, that code works for me - are you running an old version? If you type ACTIONS before trying to say hi, what output do you get?

2 Likes

The output is -

[answering the Ambassador that "
[** Programming error: tried to read from -->-1 in the array “parse”, which has entries 0 up to 60 ** ]
ambassador , hi"]
There is no reply.
[answering the Ambassador that "
[
* Programming error: tried to read from -->-1 in the array “parse”, which has entries 0 up to 60 **]
ambassador , hi" - succeeded]

The version is Inform 7 build 6M62.

1 Like

Hmm, I was checking with 6M62 as well - do you get the same behavior if you start with a minimum implementation of just the ambassador and the instead rule? If not, can you figure out what other code you need to bring over from your project to reproduce the issue?

1 Like

What could possibly cause a different behaviour than in other games? I got another one where the conversation works as intended. What’s the differences?

  • This one inherits Questions by Michael Callaghan
  • In this one the NPC is moved to where the player is while in the other one the NPC is already in its final location.

Does one of those make a difference?

1 Like

I’m guessing the extension is the issue since from a quick gander it seems like it has some custom definitions for the word “answer” - sorry, don’t have time to dig any deeper tonight but I’d check whether disabling the extension clears up the issue, then maybe seeing if RULES will help you narrow in on a potential issue?

2 Likes

I think you’re right. I have now put in a manual interception of “NPC, hi/hello” and it works.

2 Likes

This is what happens when you (or an extension) have defined some so-called ‘verbless grammar’, i.e. when you have an ‘Understand “[token] …” as blah-ing’ line somewhere in your code- in other words the first word of the ‘Understand…’ text is a grammar token and not a verb word. It’s a bug with Inform’s implementation of this situation- see discussion (and a fix- for 9.3/6M62) here.

3 Likes