abbreviating ask

Say one had a one-room game with another character in the room. So that ASK WOMAN ABOUT CONFETTI CANNON worked. But there are a lot of things one might ask the woman about. So, I’d like to be able to have the abbreviation A CONFETTI CANNON work. I’m horribly rusty in my I7 and having trouble implementing this.

I tried doing the rule for supplying a missing noun trick, but Inform wasn’t having any of it. However, this does the trick:

[code]Short asking is an action applying to one topic. Understand “a [text]” and “ask about [text]” as short asking.

Check short asking:
try asking sybil about the player’s command instead.[/code]

Replace ‘Sybil’ with the name of the person in the game. If there are different people that appear, you can have a more complex check (something like ‘a random visible person other than the player’, but with more correct wording).

Hey Jeremy,

The solution will vary depending on how you’re implementing conversation, including any conversation extensions you might be using. Assuming you’re just going with the standard asking it about action which uses topics, this should get you started:

[code]Lab is a room. Sam is a man in lab.

Unspecified asking is an action applying to one topic.
Understand “a [text]” or “ask [text]” as unspecified asking.

Check unspecified asking:
try asking sam about the topic understood instead.

Instead of asking sam about a topic listed in the Table of Blah:
say “[response entry][paragraph break]”.

Table of Blah
topic response
“foo” “Response 1.”
“bar” “Response 2.”

test me with “ask sam about foo / ask bar / a foo / a honey”.[/code]
Note that I probably wouldn’t use an instead rule for the actual conv. implementation – it was just quicker for the example. :slight_smile:

I tried that as well and I’m not sure why the compiler rejected it either. It seems like I run into weirdness whenever I use an action applying to topics. I never know if Inform is just being extra fussy in those cases or I’m doing something wrong. In this case it seems like either a bug or a missing feature. Thoughts anyone?

I never remember exactly why it fails, but I’m quite sure it has something to do with the fact that the noun has to be parsed before the second noun (or the topic understood, if that comes second). Since you’ve already given a topic, you’ve missed your chance to supply a missing noun. Something like that.

I spent a lot of time trying to prune the number of actions in my “Speech Motivations” extension with very little success. Eventually I decided it’s better to have more actions - the parser is definitely the weakest link in Inform’s processing (it’s got a hard job to do!) - so anything you can do to shift the responsibility elsewhere has a positive effect. That includes parsing different phrasings of the same intention as different actions - action-processing rules can always redirect them to the right place once the parser’s worked out what the objects of the action are.