I know that supporting the verb “to use” is frowned upon, but in multiple “home testing” it is quite apparent that IF users, especially the less hardcore ones, do like using it.
The obvious problem with the verb “to use” is how generic it is. It could be anything. So for this story I’m writing to learn about Inform7 I had the idea to just make it map to the corresponding actions, when known, while hinting to the user about what the actual action was, in hope that they’d use the correct verb afterwards.
As it turns out, remapping actions is … less trivial than I would have originally imagined, especially if we want to preserve rulebook outcomes (which is what I want; and yes I have gone through the forum and I am aware of the fact that these outcomes are not important story-wise —except when they are).
Yes, you can do a try the other thing in the Carry out rules, but outcomes are easily lost. Yet the standard rules definitely do these kind of things (e.g. remapping giving to taking or a number of other things), so I went to the source and discovered that there is an actual convert (I think this is very briefly mentioned in the guides, but not in much detail). After some (OK, a lot) of tinkering, I’ve managed to come up with a working solution, which I want to share with you, It’s very skeletal (covers only the actions I care for my story) and should at the very least be expanded to allow generic actors, but I feel like it’s a decent starting point. Has something like that been done by others?
Using is an action applying to one visible thing.
Using it with is an action applying to two visible things.
Understand "use [a thing]" as using.
Understand "use [a thing] on/with [a thing]" as using it with.
[ Using ]
The using action has an action name called the converted using action.
Rule for setting action variables for using (this is the using action variables rule):
now the converted using action is the using action.
Check using (this is the turn devices on rule):
if the noun is a device:
say "(switching on [the noun])[command clarification break]";
now the converted using action is the switching on action.
Check using (this is the pass through door rule):
if the noun is a door:
say "(going through [the noun])[command clarification break]";
now the converted using action is the going action.
Carry out using (this is the using fallback rule):
if the converted using action is the using action:
say "What do you want me to do with [the noun]?";
stop the action;
otherwise:
convert to the converted using action on the noun.
[ Using it with ]
[ Lesson learned: the variable names are global, but their initialization is not:
if we call the action name 'converted action' both here and in the using action,
we get uninitialized variables warnings at runtime even if the code works.]
The using it with action has an action name called the converted using-it-with action.
The using it with action has an object called the direct object.
The using it with action has an object called the indirect object.
Rule for setting action variables for using something with (this is the using it with action variables rule):
now the converted using-it-with action is the using it with action;
now the direct object is the noun;
now the indirect object is the second noun;
Check using something with (this is the use a key to unlock a door rule):
if direct object is a key and the indirect object is a door:
[ To swap the direct/indirect object we'd only need one temp variable, but we use two for expressivity ]
let the used key be the direct object;
let the used door be the indirect object;
if the used door is lockable:
now the direct object is the used door;
now the indirect object is the used key;
if the used door is locked:
say "(unlocking [the used door] with [the used key])[command clarification break]";
now the converted using-it-with action is the unlocking it with action;
otherwise:
say "(locking [the used door] with [the used key])[command clarification break]";
now the converted using-it-with action is the locking it with action;
Check using something with (this is the maybe inserting into rule):
if the second noun is a container:
say "Did you mean to put [regarding the noun][them] in?";
if the player consents:
say "(inserting [the direct object] into [the indirect object])[command clarification break]";
now the converted using-it-with action is the inserting it into action.
Carry out using something with (this is the using it with fallback rule):
if the converted using-it-with action is the using it with action:
say "I don't know how to use those things together.";
stop the action;
otherwise:
convert to request of the player to perform converted using-it-with action with the direct object and the indirect object.

