How can I recognise "all" speech to a character who will give only one response

Hi again everyone. I’m writing a very short game for a Christmas greeting that will go to people who aren’t necessarily familiar with this medium.

I want them to be able to say stuff to the only character in the game but no matter what they say the character has only one response. For background, this character is a preoccupied person who is blocking their movement until you give them an item. The response will be a hint on what to do.

In the interests of not shutting down a new player to the medium by returning variations on error messages or giving helpful (but useless for the purposes of this game) conversation tips, I want to efficiently catch anything they say, ask, tell, shout, scream, etc. and return that single response. I’m aware I won’t be able to catch 100% but I’d like to catch most and keep the game moving by helping them solve the simple puzzle.

Is there a wildcard or catch all I could use or another solution I’ve maybe not considered?

2 Likes

Here’s something to try:

Palace is a room. 

Jojo is a man in the Palace.

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

	
Understand the commands "ask" and "tell" and "answer" as something new.
Understand "ask [text]" or "tell [text]" or "answer [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 "Jojo says 'Don't talk to me!'".
	
Carry out talking to someone:
	say "Jojo says 'Don't talk to me!'".

You can add shouting and screaming and all that to these lines, and hopefully you can catch most of the ways to say stuff to the NPC:

Understand the commands "ask" and "tell" and "answer" as something new.
Understand "ask [text]" or "tell [text]" or "answer [text]" as a mistake ("[talk to instead]").

Hope that helps!

5 Likes

Thanks Amanda, it does. I appreciate you taking the time to reply.

It’s the little things that seem to screw me up. In this instance the “and” in “ask” and “tell” and “answer” as something new. I tried commas and or, so annoying.

Lesson learned.

Thanks again.

1 Like

@AmandaB gave an excellent answer that worked perfectly but, as is the way with these sorts of things I do have another character I’d like to be able to “talk” but they too will also have only a single (different line).

How much would I have to change to reflect that? I’ve changed the commands to specify “the student”. and I’ve tried duplicating the lines with another name in there but I can’t seem to trigger them. I could write the second character into a separate scene or something but I wonder can I duplicate and change the target and, if so, what else would I need to change (I know this is not the best way but it is a tiny game that I’m under a bit of pressure to finish and I’m almost there.)? Thanks in advance.

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

Understand the commands "ask" and "tell" and "answer" and "say" and "shout" and "yell" and "whisper" and  "scream" and "greet"as something new.
Understand "ask [text]" or "tell [text]" or "answer [text]" or "say [text]" or "shout" or "yell" or "whisper" or  "scream" or "greet" as a mistake ("[talk to instead]").

Instead of asking the student to try doing something: 
	say "[talk to instead][paragraph break]".

Instead of answering the student that something:
	say "[talk to instead][paragraph break]".

To say talk to [the student] instead:
	say "'Harumpf! This stupid machine won't take my quarter!'".
	
Carry out talking to the student:
	say "The student says 'Harumpf! This stupid machine won't take my quarter!'".

I thought I could change it to the following but I clearly don’t fully understand what’s going on.

Instead of asking Gordon to try doing something: 
	say "[talk to instead][paragraph break]".

Instead of answering Gordon that something:
	say "[talk to instead][paragraph break]".

To say talk to [Gordon] instead:
	say "'Isn't everything just the best?!'".
	
Carry out talking to Gordon:
	say "Gordon says ''Isn't everything just the best?!'".

AmandaB’s approach of unmapping all of the standard words and remapping them to a new action is a good choice, though I would personally avoid involving the “understand… as a mistake” machinery. (Though I will note that her advice is more in line with what’s seen in RB 168 Cheese-makers, as pointed to by DeusIrae in a post last year.)

First, as AmandaB shows, you want your own action to replace all of the others:

Talking to is an action applying to one thing. Understand "talk to/with/at/-- [something]" or "talk [something]" as talking to.

Understand the commands "answer" or "say" or "shout" or "speak" or "ask" or "tell" as something new. [remove all associations from Standard Rules]

Understand  the commands "answer" or "say" or "shout" or "speak" or "ask" or "tell" as "talk".

Check talking to something that is not a person (this is the inanimate things don't talk rule):
    say "There is no reply.";
    stop the action.

Report talking to a person (this is the some people don't have much to say rule):
    say "[The noun] [don't] seem to have much to say." [generic default response]

You can use a second action to catch attempts to say specific things:

Talking too much to it about is an action applying to one thing and one topic. Understand "talk to/with/at/-- [something] about/that/saying/-- [text]" as talking too much to it about. Understand "talk [text] to/with/at [something]" or "talk about/that [text] to/with/at [something]" as talking too much to it about (with nouns reversed).

Instead of talking too much to something about something (this is the ignore content of communication rule):
	try talking to the noun instead.

To override the generic response (for people), an after rule does it simply:

After talking to the student: [use after rules to replace generic response]
    say "The student says 'Harumpf! This stupid machine won't take my quarter!'".

After talking to Gordon:
    say "Gordon says 'Isn't everything just the best?!'".

Also, a third action to catch when no target person is specified:

Talking too little is an action applying to one topic. Understand "talk [text]" as talking too little.

Check talking too little (this is the must speak to a specific person rule):
    say "Just talking to the air isn't likely to be useful." (A) 

If it’s one person per room, you can add some machinery to switch to talking to when no target is specified:

Definition: A person is non-PC if it is not the player.

Instead of talking too little when the player can see exactly one non-PC person (called listener) (this is the when only one other person is present talk to that person rule):
    try talking to listener instead.
2 Likes

This is great. Thank you for breaking that down. Two entries that don’t elicit a response are "say * " and “say * to Gordon”. Can I easily make this trigger the generic responses? There’s no need for this specifically but I can imagine a person unfamiliar with the medium typing “say hello” when they see another character and I’d like to keep their confidence up.

Here is the “full” program.

the tent is a room.

the student is a person in the tent.

the valley is a room.

the valley is north of the tent.

gordon is a person in the valley.

Talking to is an action applying to one visible thing. Understand "talk to/with/at [something]" as talking to.

Understand the commands "answer" or "say" or "shout" or "speak" or "ask" or "tell" as something new. [remove all associations from Standard Rules]

Understand  the commands "answer" or "say" or "shout" or "speak" or "ask" or "tell" as "talk".


Check talking to something that is not a person (this is the inanimate things don't talk rule):
	say "There is no reply.";
	stop the action.

Report talking to a person (this is the some people don't have much to say rule):
	say "[The noun] [don't] seem to have much to say." [generic default response]
	
Talking too much to is an action applying to one visible thing and one topic. Understand "talk to/with/at/-- [something] about/that/-- [text]" as talking too much to.

Instead of talking too much to something visible (this is the ignore content of communication rule):
	try talking to the noun instead.
	
After talking to the student: [use after rules to replace generic response]
	say "The student says 'Harumpf! This stupid machine won't take my quarter!'".

After talking to gordon:
	say "Gordon says 'Isn't everything just the best?!'".

I’ve expanded and revised my answer above.

This is perfect. I appreciate you taking the time to gussie it up for me. I think the players will appreciate what this brings to the game. Gordon is a real person BTW and he is genuinely that positive. It’s refreshing and contagious.

I have a non-pressing question about your code. I sort of understand mathematics and I was interested to see @AmandaB used “and” when remapping commands and you used “or”. Is there some functional difference in Inform7 for this?

Also, in the line-

say "Just talking to the air isn't likely to be useful." (A)

What does the (A) do?

Lastly, in the interests of future usefulness, should I flag @AmandaB who answered my first question as asked or you @otistdog who fleshed out the entire idea that I amended it too?

I learned a ton from @otistdog 's answers. For future usefulness, I think there’s no question that his post is the one that should be flagged.

2 Likes

With respect to and versus or – I wasn’t even conscious of the difference. I don’t think that the choice matters in that particular context; I think the compiler just accepts either as delineating entries in a list. (In other contexts, there is a big difference because they are treated as logical operators.) You can even use commas to separate terms in the list.

With respect to the (A), I just neglected to trim that when copying and pasting from a quickie extension. It’s a response marker, see WWI 14.10 Responses for more. (Short version is that it makes it easier to change the text of the response without modifying or replacing the rule itself.) It can be removed or ignored.

Side note: @Zed, do you know of any existing extension for this kind of TALK TO functionality?

I really haven’t played with conversation yet, but to the extent I have looked at the extensions, no, I don’t think there are any that try to collapse all the talk-y actions down to one thing handled in common.

(I’ve meant to gather my responses to @AmandaB 's question about a player who can’t communicate into an extension as a reference to overriding speech-related actions and responses, but that wouldn’t be of direct use unless one had the exact equivalent premise to What Heart Heard of, Ghost Guessed with a ghostly player who can’t speak or communicate or interact with others at all.)

I’ll be revisiting that thread in the spring, as I have in mind a character who is alive but muted. Communication will be only physical: nodding, smiling, frowning, etc.

I can think of quite a few ways that people might use such an extension.

1 Like