curiousdannii-testing / inform7-imported-bugs

0 stars 0 forks source link

[I7-1933] [Mantis 1969] taking multiple objects from a held container yields "none at all available" message #151

Closed curiousdannii-testing closed 2 years ago

curiousdannii-testing commented 2 years ago

Reported by : mattweiner

Description :

When the player holds a container that contains more than one object and tries to "TAKE ALL FROM [container]", it will result in a "There are none at all available!" parser error message, even though taking the contents of the container is a sensible move and can be done by directly specifying the contents.

If the container only contains one thing, then "TAKE ALL FROM [container]" will succeed in taking that one thing.

Steps to reproduce :

Lab is a room. 

A bucket is in Lab. A rock and a shovel are in the bucket.

test me with "take all from bucket/put all in bucket/take bucket/take all from bucket/take rock and shovel/put rock in bucket/take all from bucket".

Additional information :

Output:

Lab
You can see a bucket (in which are a rock and a shovel) here.

>test me
(Testing.)

>[1] take all from bucket
rock: Taken.
shovel: Taken.

>[2] put all in bucket
shovel: Done.
rock: Done.

>[3] take bucket
Taken.

>[4] take all from bucket
There are none at all available!

>[5] take rock and shovel
rock: Taken.
shovel: Taken.

>[6] put rock in bucket
You put the rock into the bucket.

>[7] take all from bucket
Taken.

The culprit is this rule:

Rule for deciding whether all includes things enclosed by the person reaching
while taking or taking off or removing (this is the exclude indirect
possessions from take all rule): it does not.

Deleting "or removing" fixes this case. I believe this should be safe, as the player will only be removing indirect possessions when they have typed something along the order of "take all from bucket," and that should be allowed. Maybe there would be a problem if the player types "take all from booth" when the booth is an enterable container that the player is in, but on a quick test it seems not to be causing a problem.

imported from: [Mantis 1969] taking multiple objects from a held container yields "none at all available" message
  • status: Closed
  • resolution: Resolved
  • resolved: 2022-04-16T14:21:32+10:00
  • imported: 2022/01/10
curiousdannii-testing commented 2 years ago

557058:4c095ffd-6d6f-47ce-9e73-77c613347b86:

Comment by zarf :
Background: the "whether all includes" rules were heavily updated in 6L02. I think the cause was http://inform7.com/mantis/view.php?id=433 .

curiousdannii-testing commented 2 years ago

557058:4c095ffd-6d6f-47ce-9e73-77c613347b86:

Comment by mattweiner :
Also, I'm not sure why "taking off" is even in the exclude indirect possessions from take all rule, because the grammar lines for the taking off action don't accept multiple objects. This might be left over from before those grammar lines were rewritten to eliminate spurious implicit takes for the taking off action, but even if we put a grammar line back in to allow taking off to accept multiple objects, it certainly shouldn't exclude things enclosed by the person reaching, as the whole point of the action is to remove worn things! I guess this is a different bug, potentially.

curiousdannii-testing commented 2 years ago

557058:4c095ffd-6d6f-47ce-9e73-77c613347b86:

Comment by mattweiner :
On the subject of the taking off action, it seems as though "all" automatically excludes worn things irrespective of the "whether all includes" rules (as it properly does for the player's body). So no matter what we do to the "whether all includes" rules, taking off is going to break if we try to make it apply to multiple objects. Forum post: http://www.intfiction.org/forum/viewtopic.php?f=7&t=20807

As I say there, I think it's probably best to eliminate "taking off" from the rule header, just because taking off multiple things is going to break no matter what the author does, so there's no point in backstopping it in this rule.

(Continuing this in this thread rather than posting it as a new issue, because it's not obviously a bug.)

curiousdannii-testing commented 2 years ago

557058:4c095ffd-6d6f-47ce-9e73-77c613347b86:

Comment by mattweiner :
I see now that the cause of this particular revision to the "whether all includes" rules was http://inform7.com/mantis/view.php?id=1474.

curiousdannii-testing commented 2 years ago

557058:4c095ffd-6d6f-47ce-9e73-77c613347b86:

Comment by mattweiner :
Just on another test, the proposed fix doesn't seem to break down in the case of nested possessions. This works as desired:

Rule for deciding whether all includes things enclosed by the person reaching while taking (this is the exclude indirect possessions from take all only rule): it does not.

The exclude indirect possessions from take all only rule substitutes for the exclude indirect possessions from take all rule.

Dacha is a room.

The player carries a large matryoshka. A medium matryoshka is in the large matryoshka. A small matryoshka is in the medium matryoshka. A speck of dust is in the large matryoshka.

test me with "i/take all from large/ i/take all from medium/put all in large/take all from large".

curiousdannii-testing commented 2 years ago

61eedb62875fc10070240916:

Closed via this commit: https://github.com/ganelson/inform/commit/5b8de72ef210a173536c20e01f2e6aaaa6b56bbb

Comment from Graham Nelson:
I agree with mattweiner's take on this, and have made the fix he recommends.