Suppressing certain error messages

Messages like “That’s not a verb I recognize.” pop up when I don’t expect them to. For example:

Before reading a command when some-scene is happening:
	if the player's command includes "foo/bar":
		say "foo and bar";
	otherwise:
		say "huh?".

I get the same results with after/before/instead. I also tried other variants like:

Before reading a command when Logged On is not happening:
	if the player's command matches "foo/bar", say "huh!".

I would have expected at least “before” to intercept the rule that produces the error message. Could such a message be (intermittently) suppressed?

My intent is that the player will find herself in a recurring scene where she will have to interact with a computer that is occasionally helpful, which would respond to phrases like “tell me about the bad eggs”, “who/what are you”, “what should I do”, etc. I looked at a number of extensions like “Conversation Package” but they seem to be patterned around “ask [person] about [something]” and then proscribe the dialogue between the player and target (e.g., “ask device about foo” results in “You ask the adding machine about fooishly barred accoutrements. Mr. Calc chitters something unintelligible.” – I want to stay away from that style).

I tried Emily Short’s extension “Inanimate Listeners”, but that won’t work here either as it requires the player to address the object explicitly with, e.g., “ask [object] about …”.

I’m not 100% sure I understand what behavior you’re going for here, but I think one issue is that after a “before/after reading a command” rule, the player’s command still gets fed into the usual action processing machinery. They’re often used to intercept what the player’s typed and change the input in some way, for example, before handing off the revised command to the parser. It sounds like what might be going on is that you want the game to respond to FOO and/or BAR in a specific way, but not implement FOO or BAR as actions in their own right, so that’s why this behavior isn’t working for you.

If that’s right, you have a couple of options – the simplest is to just do what you’ve done and add a “reject the player’s command” after you’ve fully implemented whatever response or game logic you want to fire:

After reading a command when some-scene is happening:
	If the player's command includes "foo/bar":
		Say "foo and bar";
		reject the player's command.

This will preempt a whole bunch of stuff, though, since it’s not actually getting to the action-processing step of things – every turn rules won’t fire, so you might need to manually invoke stuff that usually happens automatically by doing stuff like saying “follow the every turn rulebook” as part of your rules. Messy! So it probably is better to just implement things as actions.

As a middle ground, if you want to use one of those extensions but not force the player to type the ASK COMPUTER ABOUT THING style, you could do something like:

After reading a command:
	If the player's command includes "foo/bar":
		Let L be "[the player's command]";
		Change the text of the player's command to "ask bob about [L]"
3 Likes

To do what you want to do, you need After reading a command and then reject the player's command., not Before. (I can see Mike has beaten me to this part.)

But I don’t think that’s really what you want. What you really need to do here is define a set of actions that cover exactly what you want this computer to respond to. For instance:

quizzing is an action applying to one thing. Understand "tell me about [something]" as quizzing.

Check quizzing when not in the presence of the computer:
    say "The computer is not here to ask questions of!" instead;

etc.
Then you could define actions to cover “who are you”, “what should I do”, etc.

Addendum: In my experience, using before/after reading a command should be one of your last options. It usually means you’re fighting against Inform’s way of doing things, and you might want to consider other approaches.

3 Likes

Thought of one other less-hacky way to do the after reading a command thing, though I’ll repeat that I agree with Phil that the hacky option is probably a bad one here. Anyway, you can just rewrite the relevant response to temporarily blank it out:

After reading a command:
	If the player's command includes "foo/bar":
		Say "foo and bar";
		now the parser error internal rule response (N) is "".

Every turn: 
	now the parser error internal rule response (N) is "That's not a verb I [if American dialect option is active]recognize[otherwise]recognise[end if]."

Again, though, this is probably not what you want to do.

2 Likes

One issue you need to consider is how your players will know to use a certain phrasing. A reason Conversation Package by Eric Eve is so widely used is that supplies a set of easily-remembered verbs that can be made to cover a wide range of needs.

But if you don’t like those particular phrasings, it may be useful to open up Conversation Framework and take a look at how Eric Eve did it, since you may find yourself reimplementing the same kinds of things, just with different words/grammars.

I’d also suggest looking at Threaded Conversation which offers an entirely different model of conversation. If you find it daunting, I’ve cooked up my own version Simple Conversation that takes the basic ideas but leaves out a lot of the complexity.

2 Likes

I tried this but it seems to be incompatible with “Inanimate Listeners” extension and result in a run-time fatality. I think it harbors animus for animism.

I’ll dig into those next. Thank you!

2 Likes

Actually, it does. It specifically declares the conversation verbs to take [someone] rather than [something]. I got around this in my game Crash by using something like:

Understand "ask [shipboard computer] about [any mutually known thing]" as quizzing it about.

But I wasn’t using the whole Conversation Package, just Conversation Framework and Conversation Responses.

2 Likes

<<unfastens leather straps
I just played over a thousand turns of Crash; it was clever fun, damn you! I’ll never look at an innocent little screw the same way. :wink:
refastens leather straps>>

Now getting back to what I am supposed to be doing, I was unable to locate your Simple Conversation extension (checked various places and even the google seer was blind - found only Can’t Go that Way in 9.3). In the mean time I’m shoe-horning around with the Threaded Conversation extension you mentioned, but so far, I fear I may be dealing with a toroidal peg into a star-shaped hole problem.

Sorry, didn’t mean to mislead you. I haven’t publicly released that extension yet, but you’re welcome to peruse it in the state it’s currently in.
Simple Conversation.i7x (10.9 KB)
A very basic example is:

about the status of the computer is a questioning quip.
	it mentions Biff's computer.
	the comment is "'Margaret', [we] [say], 'what's up with my computer?'".
	the reply is "'Oh, it got busted up during the move. I have the box behind my desk -- you can see it if you want. We'll have to get you a new one.'".
	It quip-supplies Margaret.
	
An availability rule for about the status of the computer:
	if biff's computer is seen:
		never available;
	if biff's office is visited:
		always available;

This will cause this text to show up just before the command prompt when you’re talking to Margaret.

You can ask Margaret about the status of the computer.

You might notice it’s modeled after Threaded Conversation. It has far fewer options, though. It also has a lot of work left to do, including cleaning up some awful code!

1 Like

Glad you liked it!

I’ve now waltzed through a number of these approaches and decided to go ahead with this one from Phil:

quizzing is an action applying to one thing. Understand "tell me about [something]" as quizzing.
Check quizzing when not in the presence of the computer:
    say "The computer is not here to ask questions of!" instead;

I’ve also added Phrases for Tables with Topics by Ron Newcomb in order to manage a convoluted web of time/scene-appropriate responses.

By the way, let me know if I’m crazy but I’m finding that this seems to work (and hopefully scales as well):

Understand "tell me about[text]" as quizzing.
Understand "tell me[text]" as quizzing.
Understand "tell about[text]" as quizzing.
Understand "describe to me[text]" as quizzing.
Understand "describe [text] to me" as quizzing.
[etc.]

Understand "who am[text]" as selfing.
Understand "what am[text]" as selfing.
Understand "what is my[text]" as selfing.
Understand "what's my[text]" as selfing.
Understand "what about[text]" as selfing.
[etc.]

Carry out selfing: 
	let S be the topic understood;
	if the topic understood matches a topic listed in the Table of selfie:
		Let N be the List Control corresponding to a topic of the topic understood from the Table of selfie;
		show the next response from the N, with newlines.

Table of selfie
topic	List Control
"I"		selfieList
"me"	selfieList
"myself"	selfieList
"number6" prisonerList

selfieList is a stopping list controller.
The associated list is the Table of selfieResponses.

Table of selfieResponses
response
"first"
"second"
"etc"

With the above, I’m able deal with many variants of category-type questions. The only quirky issue so far is the word ‘about’, for which I’ll be posting a separate question.

Thank you for the help, folks!

1 Like