As far as I understand it (and, as usual, it seems likely that I don’t) Inform 7 includes a handy-dandy way of providing a blanket dismissal of interaction with something you’ve created, to the tune of “instead of doing anything,” with or without an exception or two. The “Night Sky” example, in the I7 documentation, shows it in action, and I use it a lot.
The trouble I’m having with it is, I can’t figure out how to intercept disambiguation attempts by the parser, or automated disambiguation-related messages.
In the “Night Sky” example, if I type “get message,” it gives me the expected refusal. So far so good.
But if I type “unlock message” (for example) … it gives me more, and I’m not clear on how to make that stop happening. Help?
Are you sure you want to? You wouldn’t want to disable a prompt like “Which do you mean, the blue message or the very important blue key?”
“Unlock message” is a mixed case, since that command will probably resolve into an action that really does involve the message. But if the player gets a refusal at that point – after the clarification prompt, I mean – I don’t think it will rankle. There’s a pretty clear separation between the parser and the game response there.
I do that, and it definitely helps with some things (in the case of similarly-named things it helps the parser jump to the correct conclusions … but for the few things I want to completely shut down in this way, there are no naming conflicts to worry about).
Just so I understand, do you want the game to respond with “you can’t (verb) the message”, regardless of the verb? If so, maybe a good way would be to check the player’s command for the name of the noun, then give a default “you can’t do anything with this” response if it’s included? Sorry if I’m talking absolute nonsense.
OK, if there are no possible name clashes, what about something like:
After reading a command:
if the player's command includes "message":
say "You cannot do anything with the message.";
reject the player's command.
(You might also need to add a rule that ensures that the pronouns never take the value of your weird objects, if you want absolute certainty that no interaction is possible. Or you might not. I’m not sure, and the situation would be rather obscure.)
[Edit] OK, this is basically what mostly useless also suggested.
Here’s how I’m working it at the moment … and, happily, it works. Unhappily, I’m not really sure why, since it’s the result of just lots of hammering and experimentation devoid of reason. Which is not unusual for me. Anyway, I had to use different methods for different actions (and that’s the main thing where I have no idea why, but I’m content to accept it without really understanding it if need be).
[code]“Balcony Example”
Book of the Picayune
A thing can be picayune.
Before doing something other than examining a picayune thing: say “[shutdown]” instead.
Before putting anything on a picayune thing, say “[shutdown]” instead.
Before inserting anything into a picayune thing, say “[shutdown]” instead.
Does the player mean doing anything to a picayune thing: it is very unlikely.
Does the player mean doing anything with a picayune thing: it is very unlikely.
Does the player mean doing anything to a thing that is not picayune: it is very likely.
Does the player mean doing anything with a thing that is not picayune: it is very likely.
To say shutdown: say “Bah.”;
Rule for supplying a missing second noun while doing anything to something picayune: change the second noun to the player;
Rule for supplying a missing noun while doing anything to something picayune: change the noun to the player;
Understand “Unlock [something picayune]” as unlocking it with;
Understand “Lock [something picayune]” as locking it with;
Understand “Tie [something picayune]” as tying it to;
Book of the Game World
The Balcony is a room. “A small balcony overlooking your kingdom. Stars twinkle in the night sky above.”
The kingdom is a backdrop in the Balcony. The description is “It’s okay. You want a bigger one, though.” It is picayune.
The stars are a backdrop in the Balcony. The description is “They’re not technically yours, so, bah.” They are picayune.[/code]
If anyone can spot any hidden pitfalls with this method, I’d appreciate the warning Otherwise, I’ll probably go with this and see how it shakes out during testing.
”Before doing something to” and ”before doing something with” are synonymous; and neither checks the second noun. So you need:
[code]Before doing anything to a picayune thing: instead say “BAH!”.
Before doing anything when the second noun part of the current action is a picayune thing: instead say “BAH!”.
Does the player mean doing anything to a picayune thing: it is very unlikely.
Does the player mean doing anything when the second noun part of the current action is picayune: it is very unlikely.[/code]
(“Before doing anything when the current action involves a picayune thing” doesn’t compile; it seems that you need to tell Inform what particular object should be involved.)
Also, I suspect that “Rule for supplying a missing noun while doing anything to something picayune” will never actually do anything: it tells the game to supply a missing noun on the condition that the noun is already known to be something picayune (and so not missing at all), doesn’t it?
Compile my example above, and try “unlock stars” both with and without that line; it definitely does something (for all I know it’s doing something terrible and ill-advised, but it’s getting me the response I want from the parser) … and again, I’m not sure why it all works … I’m honestly clueless about most of what’s going on under the hood … it’s just all brute-force trial-and-error, but every line there is a result of attempts to squash stray responses.
Plus, thanks for your help! I’ll try the new code you suggested as soon as I get home tonight
Ooh, this one was particularly magical; thank you. I don’t think I’ve even encountered that particular bit of syntax before, the “second noun part of the current action” bit.
I still don’t think that that rule for supplying a missing noun does anything—or even ever runs. (Try the RULES debug command.)
What takes care of the UNLOCK STARS command is your rule for supplying a missing second noun. (Without that, you’d get the response “You must supply a second noun.”)