I’ve got a problem with situations where it may not be clear which object (or part of the object) the player should use:
[code]The dial is part of the radio.
Instead of using the radio, say “You listen to some music.”
Instead of using the dial, say “You switch to a different station.”[/code]
It’s reasonable, on the part of the player, to try to “tune” the radio. If he tries “tune the dial,” I can just say “Understand ‘tune [the dial]’ as using”, but the player should be able to get the same result by saying “tune the radio,” and I’m not sure how.
“Understand 'tune [the radio] as using the dial,” which is what I want to do, doesn’t work.
In some situations I could redirect using the radio to using the dial, but not here, because using the radio has its own function.
I could add an entirely new tuning function, but that seems clumsy.
Do you want them to be able to tune the radio to a specific station? If so, what I would probably do is have the radio and the dial be the same thing, and support “tune/turn/set [the radio] to [a number]” as actions on it (and have a response to non-specific tuning as well). Yes, that means that “turn radio” will work, but it seems pretty unlikely that the player will type either that or “listen to dial.” Alternatively, you could do something where any actions (other than listen/examine or whatever specific radio-related actions you have in mind) on the radio trigger a “To set the radio to a different station, try turning the dial.”
Out of curiosity, are you implementing a “use” command across the entire game?
I generally argue against ever having object-specific grammar. That is, if you want the game to handle “tune radio”, you should understand “tune [something]” and generate a sensible error for tuning most things.
tove: Yes, which is why I’m loath to add too many situation-specific new actions.
zarf: So you think I should make a tuning action?
I’m not sure what zarf would say, but I think you’re likely to get better output if you create a separate action for a verb like “tune,” then remap “use (my object)” to that specific action, rather than the other way around.
I think you should have an action, and use instead (or check) rules on the action to discriminate. Rather than trying to do it in grammar.
Whether the action is tuning or using is a separate question. I favor tuning, because that way you can provide a reasonable error for “tune hair gel” as distinct from “use hair gel”.
If you really wanted to implement a “use” verb, here’s one way you could do the redirecting:
[code]The Living room is a room.
There is a radio in the living room.
A knob is a part of the radio.
Using is an action applying to one thing. Understand “use [something]” as using.
say “I don’t know what using that would mean.” instead.
Instead of doing anything with the knob:
Now the noun is the radio;
Try the current action;
Instead of listening to the radio:
say “You listen to some music.”
Instead of turning the knob:
say “You switch to a different station.”
Instead of using the knob:
try turning the knob;
Instead of using the radio:
try listening to the radio;[/code]