I was going to say that you can get Inform to automatically take a quadrant as an answer to the “Where do you want to dig?” question–that’s the out-of-the-box behavior for the response to “dig” when “dig [something]” has an Understand line and “dig” by itself doesn’t. But it turns out to be really hard to get Inform to understand when to print the special “Which quadrant do you want to dig in?” question! I had to put it into one of the internal response messages, and also use an I6 hack of zarf’s to get the name of the half-completed question. (Maybe you can use that “command so far” thing that shows up in the normal message to take care of this–I’d never seen it before.)
Also if you only have one thing in your inventory, the parser obnoxiously decides that that must be what you want to dig. (Maybe this is something special that happens when there’s only one non-scenery thing in the location?) That stinks.
Anyway, here’s the code:
[code]Laboratory Grounds is a room.
A dingy hat is a thing.
A quadrant is a kind of scenery thing. A1, A2, B1, and B2 are quadrants. Every quadrant is in Laboratory Grounds. A quadrant can be dug.
Digging is an action applying to one touchable thing. Understand “dig [thing]” and “dig in [thing]” and “dig up [thing]” as digging.
Check digging when the noun is not a quadrant:
say “You can’t dig that.” instead.
Check digging Laboratory Grounds:
Say “You must specify a quadrant: A1, A2, B1, or B2.” instead.
Check digging a dug quadrant:
say “You’ve already dug there.” instead.
Carry out digging a quadrant:
now the noun is dug.
Carry out digging B1 when the hat is off-stage: [shouldn’t need to verify that the hat is off-stage, because that should get stopped by the “dug quadrant” check rule, but better safe than sorry]
now the player carries the hat.
After digging B1: [the After rule preempts the Report rule]
say “You find a hat!”
Report digging:
say “You don’t find anything.”
To decide which action name is the action to be: (- action_to_be -).
When play begins:
now parser clarification internal rule response (E) is “[if the location is the Laboratory Grounds and the action to be is the digging action]Which quadrant do you want to dig: A1, A2, B1, or B2?[otherwise]What do you want to [parser command so far]?”[/code]
Since this has problems, a better way to do it might be just to include a line like this:
Understand "[quadrant]" as digging [when the player holds the map and the location is the Laboratory Grounds and whatever other conditions you need].
This will have “A1” be understood as digging A1 without needing to make four customized actions.