Matt:
But it said “IF” which I take to mean “interactive fiction” and there I do have a view.
With the risk of stepping on a few toes, I interpret the phrase “interactive fiction” as a more text-oriented than picture-oriented. So a game like Zork or LEM Lander (I’m showing my age) or Cave/Adventure is more in the spirit of interactive fiction than a point-and-click game like Leisure Suit Larry 5 or Doom or any of the myriad commercial MMORP games available on Android or iPhone.
Inform is a group of languages for writing text adventures, currently mainly Inform 6 (an object-oriented language like C++) or Inform 7 (a declarative language like Prolog, but with a natural language flavor). Inform 7 is built as an overlay to Inform 6. There are a number of other text adventure languages like TADS and Twine with similar goals but different underlying machinery.
With regard to the specifics of attacking, you’ve seen a number of replies (including my own). Inform 7 has a particular default way of handling a command along the lines of “attack ogre” or “crack nut”. It amounts to a check rule (called the block attacking rule) that spits out the message “Violence is not the answer to this one.” That seems to be the result of a consensus. But if your game requires attacking an ogre or cracking a nut, there are lots of ways around that.
If the check rule is a satisfactory response for most situations, you can insert some begin and instead rules to handle special situations, or some mistake or check rules to handle particular player errors. If the wording of the response is the only problem, you can change the response,
If your game requires a number of attack scenarios, you can unlist the check rule and create a report rule to handle the cases where attacking is not appropriate and use before/check/instead/carry out/after rule sequences to handle attacking.
If, like me, you want to separate the verbs animate objects (like attack and fight) from those with inanimate objects (like crack and break), you can do that, first by a statement like Understand the commands "crack" and "break" as something new.
, and then creating a new action to handle “crack [something]” or “break [something]”.
The nice thing about Inform 7 is that you can rewrite the rules. If you want (either as a desperate last resort(!), or because you want your parser to understand (e.g.) Finnish or Hungarian or South African English), you can even replace large sections of the Standard Rules.
The short answer is that Inform 7 makes some assumptions by default that (I believe) reflect a community consensus. If you disagree with those assumptions or need to make different assumptions for a particular story, you are quite free to do so. Naturally, some changes will be easy, others difficult, and (speaking now as a mathematician) some well nigh impossible.