Inform7: How can i stop the player from 'taking all'

Hey everyone, I was wondering if anyone had any idea how I could stop the player from using the command ‘take all’ during my game? It gives away too many secrets in my game


Instead of risking frustrating players and disabling it completely you can exclude things from “all” (manual ch. 17.34):

Rule for deciding whether all includes the hidden diary: it does not. Rule for deciding whether all includes things in the secret compartment: it does not.
(Although optimally you’d place the secret items in the room only after the player has learned of their existence and avoid this and other snafus altogether.)

Either that, or:

After reading a command:
   if the player's command matches "take all":
      replace the player's command with "suicide".

Committing suicide is an action applying to nothing. Understand "suicide" as commiting suicide.

Carry out committing suicide:
   end the story saying "Take All is for sissies."

[code formatting fixed by Mod]

I might find it less frustrating to be explicitly told that my “take all” wasn’t succeeding than to have it apparently succeed and then discover that there were more objects in the room I hadn’t succeeded in taking. If the game says “You can’t take multiple objects in this game,” then at least I know where I stand. (Though perhaps I’d take it that “take all” only applies to obvious things.)

Anyway, if you want to disable “take all,” there are a couple of ideas in this raif thread. The most sensible one, but tedious, is probably Andrew Plotkin’s, which involves going through the standard rules and rewriting the parser lines that refer to taking “[things]” with lines that refer to taking “[something]”. It also might be possible to use a “Rule for deciding whether all includes” to exclude everything (when taking) and writing a special parser error rule to give the player a useful message, but that involves diving into I6. (Just one simple line, as described in the linked thread, but maybe more than you want.)

Incidentally note that lribeiro’s solution, besides being a joke (I think), won’t actually block “get all” or “pick up all” or a couple other synonyms.

Yes, it was a joke, but with a bit of tinkering I think it can make a clean and hassle free solution.

After reading a command: if the player's command includes "all/everything/every": say "In this game, the ability to perform actions on more than one item simultaneously is disabled."; reject the player's command.

Unless “After reading a command” slows the game terribly down, it should work. Are there any other ways to “take all”? I’m guessing that these are the natural ones, and anyone going beyond it is just trying to break it anyway.

Sure, but I understood from the OP’s question that in this case there are items that are actually hidden so that you’re not supposed to discover them at all (not until a plot point reveals that they are there). That’s what the disclaimer about better solutions was meant to address.

You can do this easily in pure I7:

Rule for deciding whether all includes something: it does not.

Rule for printing a parser error when the latest parser error is the nothing to do error:
say “Sorry, but ALL is disabled in this story.” instead.[/code]

(EDIT: Oh, I see that restricting it to the taking action requires I6 but in case of hidden items you’ll probably want to disable it for every action anyway.)

Well, there’s “TAKE HAT AND COAT,” which I believe uses the same machinery as “take all.” But you might not want to disable that.

Nothing really wrong with your solution, but it’s all-or-nothing; the more solutions the better, definitely. If you want to allow “drop all” but not “take all,” which might make sense in the OP’s situation, then you’ll have to do something else, though (probably the tedious elimination of [things] tokens or the I6 trickery).

Juhana: huh, the “nothing to do” error. I didn’t know about that. That’s not new in the last couple of builds, is it? It’s what I was looking for in my first post on that raif thread.

I want or use this code but only for a specific NPC in a specific room.

The code I have does not work but I am not sure how to fix it.

The part:

if the player's command includes "to [someone]" in the Operational room:

I think it is the problem but how can I make it a specific person in specific room.

Here is the complete part of the code:

After reading a command:
	if the player's command includes "to [someone]" in the Operational room:
		say "Sorry, he can't hear you at the moment";
	reject the player's command.

Matt: I wrote this (mildly silly) post on the parser errors on the Secrets of Inform thread; I figured out ways to generate all the ones that could (then) be generated. I don’t know if anything has changed.

I’d miss DROP ALL, I must confess. (But then I’d miss TAKE ALL too, so maybe I’m going to be out of luck in any case.)

[In a certain game by Emily Short there is (or maybe used to be) an object called all, which clashed rather badly with these commands.]

Another minor issue is that it upsets debugging, by blocking RULES ALL.