"instead of taking all from"

I have a supporter on which things are described very generally until the supporter is searched, at which point specific things appear on it. However, before the player has searched it, they might try TAKE ALL FROM it, which will respond “it is empty.” That is a bit of a jarring contrast against the description.

As I understand it, this command corresponds to the removing it from action, but from what I understand when the player types “all” as the noun this gets translated into specific things before the action is triggered, because I cannot get a “before removing all from” rule to trigger.

I tried a different approach and tried searching for the failure message that is printed, and ended up in this part which looks relevant:

The parser nothing error internal rule translates into I6 as
   "PARSER_N_ERROR_INTERNAL_R" with
   "Nothing to do!" (A),
   "[There] [adapt the verb are from the third person plural] none at all available!" (B),
   "[regarding the noun][Those] [seem] to belong to [the noun]." (C),
   "[regarding the noun][Those] [can't] contain things." (D),
   "[The noun] [aren't] open." (E),
   "[The noun] [are] empty." (F).

It looks particularly relevant because it also contains the “There are none at all available!” message which seems related. But I’m not sure how to edit those messages.

I searched a bit more for other variations of this problem and found this previous answer: "There are none at all available" when trying to put multiple items in something - #19 by Jonathan

That seems to solve my immediate problem too. I’ll plop in something like

Rule for printing a parser error when the latest parser error is the nothing to do error and the player's command includes "all from" or the player's command includes "all off":
	say "Please be more specific about which things you refer to." instead.

I’m keeping this thread anyway in case someone else searches for this specific thing – and I’d be happy to receive suggestions that might be better ways to solve it.

3 Likes

I’m not quite sure what behavior you’re after, but this might work for you:

Lab is a room. "This is a very nice lab."

The shelf is a scenery supporter in the lab. The shelf can be searched. The shelf is not searched.

The diamond is on the shelf.

After searching the shelf:
	now the shelf is searched;
	say "You see a diamond on the shelf!";
	
The describe what's on scenery supporters in room descriptions rule does nothing when the shelf is not searched.
	
test me with "search shelf/look".
1 Like

EDIT: never mind, this doesn’t work.

You can also remove the take all action entirely, with rules like:

Understand "take all" as a mistake ("You can't take everything at once!.").
Understand "take all from [something]" as a mistake ("You can't take everything from [the noun] at once.").

I think the intended result is to avoid having The box is empty. when there are things in the box; it just needs to be searched through first.

Be careful with that, though: GET ALL or TAKE EVERYTHING won’t be caught by it.

1 Like

This doesn’t remove the action, though. It’s basically impossible to hide all the phrasings of GET ALL using this sort of trick.

1 Like

Note that this will disable the rule for every scenery supporter until the shelf is searched, which is fine if the shelf is the only scenery supporter in the game but not ideal otherwise.

Haha you are right of course. Pretend I never posted that.

It’s getting a little more complex now, but this might work:

For printing a locale paragraph about a thing (called the item)
	(this is the new describe rule):
	if the item is the shelf and the shelf is not searched: 
		continue the activity;
	if the item is scenery and the item does not enclose the player:
		if a locale-supportable thing is on the item:
			set pronouns from the item;
			repeat with possibility running through things on the item:
				now the possibility is marked for listing;
				if the possibility is mentioned:
					now the possibility is not marked for listing;
			increase the locale paragraph count by 1;
			say "On [the item] " (A);
			list the contents of the item, as a sentence, including contents,
				giving brief inventory information, tersely, not listing
				concealed items, prefacing with is/are, listing marked items only;
			say ".[paragraph break]";
	continue the activity.
	
	
The new describe rule is listed instead of the describe what's on scenery supporters in room descriptions rule in the for printing a locale paragraph about rules.

EDIT: See @Draconis’s post below, which is far more elegant.

This doesn’t speak to the more specific question of the “empty” supporter (I think that’s covered), but so far as printing errors go, there’s a shared framework for handling responses:

The parser nothing error internal rule response (B) is "There is no 'all' in your 'all!'"

This is the same phrasing needed to change default action responses (such as those found in the Standard Rules)

The standard report taking rule response (A) is "Taken!".

rule for printing a parser error does not change output for the RESPONSES debug command, either, which might be inconvenient. For more info about changing built-in (or custom) responses to errors and action processing rules:

for info about the responses command:

The writing a parser error activity is in the documentation, so using it isn’t wrong. If you prefer it, Keep going! Just a note about alternatives.

1 Like

How about this? Slight variant of the above:

The shelf can be searched or unsearched. The shelf is unsearched.
The describe what's on scenery supporters in room descriptions rule does nothing when the supporter in question is the unsearched shelf.
2 Likes

This doesn’t prevent EXAMINE SHELF from reporting the contents of the shelf, although EXAMINE and SEARCH probably shouldn’t be treated differently.

1 Like

The message that you’re getting is a parser error. The parser error is happening because the parser understands what the command >TAKE ALL FROM TABLE has asked for but doesn’t see any things on the table to match to the word “ALL” in the player's command. That is an accurate reflection of the world model you’ve set up, but it’s not in accordance with the illusion that you want to present to the player.

In theory, the built-in deciding the concealed possessions of something activity allows you to put the hidden objects on the table, but in practice there is a bug affecting the locale description machinery that causes unwanted stray output when everything on the table is concealed. (For mad scientists: it’s the Standard Rules’ definition of locale-supportable.) Even if this bug is addressed, you end up with the same parser error because concealed things are treated as things that aren’t present (i.e. kept out of scope) when parsing.

The described property works a little better in practice; by making the things on the table undescribed they will be skipped when describing the room. However, this does not keep them out of scope, so the response to >TAKE ALL FROM TABLE is to take the objects.

If you don’t want to allow that, have you considered modeling the mess on the table as its own object? Then that object would be the “ALL” in >TAKE ALL FROM TABLE.

3 Likes

I’ve read all answers and I’m in awe at the wisdom collected in these forums.

This sounds, to my untrained ears, as the cleanest and most natural solution though. I like it a lot.

Edit a few days later: I think I’ll actually rewrite my code to do this instead. It sounds like it might solve a bunch of inconsistencies beta testers have found in the world model around this mess on the table.

1 Like