How to create simple "Talk to" command?

Hi. I’m brand new to Inform 7. I am creating a game that starts with a character sitting in a car with two NPCs. I just want to make a simple command where the player can type “talk to [person]” and my dialogue will appear. I do not want to have to have to have the player talk to them ABOUT anything, just a simple situation of- IF the player types “talk to {NPC’s name}” THEN say this.

I have searched high and low and can’t seem to find the answer anywhere. Please help!

1 Like

Congrats on getting started with Inform 7! From your post I’m not sure if you’ve been looking over the Recipe Book part of the documentation, as well as Writing With Inform, but it’s often a helpful resource since it includes a lot of sample games – in this case, if you look in the index, you can find an example that shows how to get rid of the other conversation verbs and add a new TALK TO command.

(The stuff about scenes may or may not make sense – they were super intimidating to me when I first got into Inform – but if you just look for Chapter 1, which sets up the commands, and bits of the remainder of the sample code with the “Instead of talking to…” lines, you should hopefully be good!)

OMG! Thank you so much for your help, that worked perfectly!

For sake of completeness in this thread, my solution was to copy and paste the following text from the recipe book 10.9 into my Source:

Understand the commands “ask” and “tell” and “say” and “answer” as something new.

Understand “ask [text]” or “tell [text]” or “answer [text]” or “say [text]” as a mistake ("[talk to instead]").

Instead of asking someone to try doing something:
say “[talk to instead][paragraph break]”.

Instead of answering someone that something:
say “[talk to instead][paragraph break]”.

To say talk to instead:
say "(To communicate in [story title], TALK TO a character.) "

Understand “talk to [someone]” as talking to. Understand “talk to [something]” as talking to. Talking to is an action applying to one visible thing.

1 Like

If you want to start getting fancier with conversations, there are a number of extensions that replace or otherwise enhance the default conversation system in various ways – exactly which way that’d work best would depend on the sorts of things you were trying to do.