>DROP ALL ... What do you want to drop those things in?

A tester of my game encountered some weird behavior when attempting to “DROP ALL.” Instead of trying to drop items (or saying there are no items to drop), the parser asks what you want to drop the items in. I’ve reproduced it here. Any idea what’s causing this or how to fix it?

>i
You are carrying:
  an uniform (being worn)
  a helmet (being worn)

>drop all
What do you want to drop those things in?

>actions
Actions listing on.

>rules
Rules tracing now switched on. Type "rules off" to switch it off again, or "rules all" to include even rules which do not apply.

>drop all
[Rule "exclude people from drop all rule" applies.]
[Rule "exclude people from drop all rule" applies.]
[Rule "exclude people from drop all rule" applies.]
[Rule "exclude people from drop all rule" applies.]
What do you want to drop those things in?

>island
[Rule "exclude people from drop all rule" applies.]
[Rule "exclude people from drop all rule" applies.]
There are none at all available!

1 Like

The drop all awkwardness is a known issue. An approach is given in that thread, but you’d have to adapt it.

2 Likes

I’m looking at the source code provided in the thread, which is more than a little over my head, but I’m trying it out in my project.

Rule for deciding whether all includes the person asked while dropping:
	if the person asked is empty:
		it does.

yields:

Problem. In the sentence 'if the person asked is empty'  , it looks as if you intend 'person asked is empty' to be a condition, but that seems to involve applying the adjective 'empty' to an object - and I have no definition of it which would apply in that situation. (Try looking it up in the Lexicon part of the Phrasebook index to see what definition(s) 'empty' has.)

I was trying to match this phrase:

 if (person asked is empty - a condition): 

I recognised:

person asked is empty = a condition
 
Because of this problem, the source could not be translated into a working game. (Correct the source text to remove the difficulty and click on Go once again.)

I gather that Inform 7 doesn’t understand the condition because it doesn’t understand “empty” as being applicable to “the person asked.”

The error says to check the Lexicon, but I’m not sure I totally understand what I’m looking for and I definitely don’t understand how to change the behavior.

empty ... adjective: 
1. (of text) it contains no characters; 
2. (of table name) a table name is empty rather than non-empty if the number of filled rows in it is 0; 
3. (of rulebook) it contains no rules, so that following it does nothing and makes no decision; 
4. (of activity) its before, for and after rulebooks are all empty; 
5. (of list of k) it contains no entries; 
6. (of relation) it does not relate any values, that is, R (x, y) is false for all x and y

The Standard Rules don’t define “empty” for people or containers, is all. Counterfeit Monkey must have a custom definition or extension.

1 Like

I looked for something like that in the source provided but couldn’t find it.

There’s a lot of source. It’s in World Model Tweaks.

Definition: a person is empty rather than non-empty if the first thing held by it is nothing.
[empty-handed and naked]

One of the things I meant by that you’d have to adapt it is that that code, as written, is particular to Counterfeit Monkey. Another is that the version as written only gets triggered if the person truly has nothing, i.e., neither carries nor wears anything. Since in your example, the person has things but is wearing all the things they have, you probably would want to modify it to recognize that case.

2 Likes

I was pasting this link to the actual code snippet when you replied. Probably not very useful.

1 Like

Ok, thanks for steering me to that. I’ll see if I can figure something out from there.

I appreciate your patience. I’m not a programmer at all. This is my second functional Inform 7 project. Prior coding experience is limited to some very basic HTML and simplistic scripting in a language that nobody has heard of outside a very small community (HamsterSpeak, which is proprietary to the OHRRPGCE game engine). I have no experience using github so I don’t even know how you found that code, but I figured out how to get to World Model Tweaks now that you’ve pointed me in that direction.

Thanks, I will go over this and see if I can make something work.

Any hints as to how to re-write this

Definition: a person is empty rather than non-empty if the first thing held by it is nothing.

to define a person as empty when they are carrying nothing besides things the player is wearing?

Try this:

 A person is empty rather than non-empty if they carry nothing.

Carrying is more specific than holding. In particular, worn things are held, but not carried.

1 Like

This:

Rule for deciding whether all includes other people carried by the person asked while dropping or throwing or inserting or putting (this is the new exclude people from drop all rule):
it does.

The new exclude people from drop all rule is listed instead of the exclude people from drop all rule in the for deciding whether all includes rulebook.

Definition: a person is empty rather than non-empty if they carry nothing.

Rule for deciding whether all includes the person asked while dropping:
	if the person asked is empty:
		it does.

A multiple action processing rule when dropping:
	if the player is empty:
		alter the multiple object list to {};
	otherwise:
		let L be the multiple object list;
		if the player is listed in L:
			remove player from L;
			alter the multiple object list to L;
	if the multiple object list is empty:
		say "[We] don't have anything to drop."

yields:

Problem. You wrote 'Rule for deciding whether all includes other people carried by the person asked while dropping or throwing or inserting or putting (this is the new exclude people from drop all rule)'  , but the description of the thing(s) to which the rule applies ('other people carried by the person asked') did not make sense. This is an object based rulebook, so that should have described an object.

Apologies if I’m being too needy here; I’m just completely flummoxed in regard to how to get rid of this error.

I think you need this:

2 Likes

HALLELUJAH!

Thanks for the patient assistance. My game is now returning a sensible response to “DROP ALL.”

Many many many thanks.

3 Likes

That’s good news. Could you possibly post the code that you ended up with here? It is just what you posted above plus “Definition: a thing is other if it is not the player.”? Thanks :slight_smile:

1 Like
[DROP ALL BUG WORKAROUND]

Definition: a thing is other if it is not the player.

Rule for deciding whether all includes other people carried by the person asked while dropping or throwing or inserting or putting (this is the new exclude people from drop all rule):
it does.

The new exclude people from drop all rule is listed instead of the exclude people from drop all rule in the for deciding whether all includes rulebook.

Definition: a person is empty rather than non-empty if they carry nothing.

Rule for deciding whether all includes the person asked while dropping:
	if the person asked is empty:
		it does.

A multiple action processing rule when dropping:
	if the player is empty:
		alter the multiple object list to {};
	otherwise:
		let L be the multiple object list;
		if the player is listed in L:
			remove player from L;
			alter the multiple object list to L;
	if the multiple object list is empty:
		say "[We] don't have anything to drop."
2 Likes