Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugged handling of items which have pockets both with and w/o "open_container" tag #42301

Open
GGgatherer opened this issue Jul 20, 2020 · 6 comments
Labels
<Bug> This needs to be fixed [C++] Changes (can be) made in C++. Previously named `Code` Items: Containers Things that hold other things Mechanic: Pockets

Comments

@GGgatherer
Copy link
Contributor

GGgatherer commented Jul 20, 2020

Describe the bug

If an item have pockets some of which have open_container tag and some do not have it, then:

  • Inserting/dropping it in the vehicle cargo results in liquid being spilled but the item ends up under player's feet. Non-liquid items are contained within it.
  • Inserting it into another (worn)container works... but it does not spill the liquid. Which it kinda should, judging on description of open_container pocket.

Steps To Reproduce

  1. Add this item to the game. I just pasted it into storage.json.
    { "id": "test_spill_pouch", "type": "ARMOR", "name": { "str": "tactical test pouch", "str_pl": "tactical test pouches" }, "description": "test pouch. with regular and open pocket.", "weight": "288 g", "volume": "525 ml", "price": 4500, "price_postapoc": 250, "to_hit": 2, "bashing": 1, "material": [ "nylon", "plastic" ], "symbol": "[", "looks_like": "holster", "color": "dark_gray", "covers": [ "TORSO" ], "coverage": 10, "encumbrance": 1, "max_encumbrance": 3, "pocket_data": [ { "pocket_type": "CONTAINER", "max_contains_volume": "2 L", "max_contains_weight": "4 kg", "max_item_length": "20 cm", "magazine_well": "500 ml", "moves": 80 }, { "pocket_type": "CONTAINER", "rigid": true, "watertight": true, "open_container": true, "max_contains_volume": "990 ml", "max_contains_weight": "2 kg" } ], "material_thickness": 1, "flags": [ "WAIST", "WATER_FRIENDLY" ] }

  2. Load the save Testburg.zip

  3. Try dropping the pouch into the box to the NE. Behold.

  4. Try inserting it into your winter coat. See it working w/o spilling the water.

  5. edit:

  • wield your winter coat
  • insert the pouch into it (it will not spill)
  • drop the coat into the box
  • this will, too, result in no spilling
  1. edit 2: it gets even better. Seems it's not just mixed pockets problem, even regular cans are affected: "open_container" tag is ignored when inserting from under feet into wielded container #42310. Also, yes, you can put winter coat with such a can into vehicle cargo and it will not spill, too.

Expected behavior

Well, it doesn't drop everything, only liquid, which is ok (even if I don't yet understand why :p). But it should end up in vehicle storage, not under player's feet.
e: in case of storing it in worn container it should spill the liquid, like it says in description.

Versions and configuration

  • OS: Windows 7
  • Game Version: 0.E-4254-gfea0266 [64-bit]
  • Graphics Version: Tiles
  • Game Language: English [en]
  • Mods loaded: [
    Dark Days Ahead [dda],
    Disable NPC Needs [no_npc_food]
    ]
@KorGgenT KorGgenT added <Bug> This needs to be fixed [C++] Changes (can be) made in C++. Previously named `Code` Items: Containers Things that hold other things labels Jul 20, 2020
@KorGgenT KorGgenT added this to the 0.F milestone Jul 20, 2020
@KorGgenT KorGgenT added this to Confirmed blockers / To Do in 0.F Release Planning Jul 28, 2020
@wapcaplet
Copy link
Contributor

wapcaplet commented Aug 23, 2020

This issue appears to have been largely, if not entirely resolved by #42341, which added a prompt for where to spill liquids when dropping a spillable container.

I tested this in August 22 edition of master 2d68329.

First, I had to make some changes to your tactical test pouch - the "covers" field body parts need to be in lowercase now, and the total volume needs to be at least as much as the total of pocket volume (unless you use the magical TARDIS flag), so I increased it to 1500 ml. It will no longer fit in the pockets of a winter coat.

  {
    "id": "test_spill_pouch",
    "type": "ARMOR",
    "//": "Test item submitted in issue #42301",
    "name": { "str": "tactical test pouch", "str_pl": "tactical test pouches" },
    "description": "test pouch. with regular and open pocket.",
    "weight": "288 g",
    "volume": "1500 ml",
    "price": 4500,
    "price_postapoc": 250,
    "to_hit": 2,
    "bashing": 1,
    "material": [ "nylon", "plastic" ],
    "symbol": "[",
    "looks_like": "holster",
    "color": "dark_gray",
    "covers": [ "torso" ],
    "coverage": 10,
    "encumbrance": 1,
    "max_encumbrance": 3,
    "pocket_data": [
      {
        "pocket_type": "CONTAINER",
        "max_contains_volume": "2 L",
        "max_contains_weight": "4 kg",
        "max_item_length": "20 cm",
        "magazine_well": "500 ml",
        "moves": 80
      },
      {
        "pocket_type": "CONTAINER",
        "rigid": true,
        "watertight": true,
        "open_container": true,
        "max_contains_volume": "990 ml",
        "max_contains_weight": "2 kg"
      }
    ],
    "material_thickness": 1,
    "flags": [ "WAIST", "WATER_FRIENDLY" ]
  }

When I am wearing or wielding the pouch, I can insert liquids directly into it:
image

This makes sense, because by wearing or wielding the spillable container, you can steady it and prevent it from spilling (if it's a beer helmet, say).

When the pouch is simply in my inventory (contained in a backpack or something), I cannot insert liquids into it, though of course I can put a container of liquid in:
image

This also makes sense, because if the pouch is stuffed in your backpack, it could go sideways and spill the liquid out.

Now, I have wielded the tactical test pouch, and filled it with water:
image

What if I try to put the pouch in my rucksack now? Rucksack, insert:
image

Notice the pouch is not available for insertion. Looks good. Can I drop the pouch in vehicle cargo? It appears so:

image

But when I do, I have to figure out what to do with the water:
image

I can pour it back into my water bottle, or pour it on the ground in any direction I choose - it does not automatically spill at my feet.

There is only one curious edge case I can find with your test pouch - it is not available to be inserted in another item (like my rucksack), even if it does not contain anything that would spill. However, it will automatically go in to my rucksack if I simply pick it up off the ground, or from vehicle cargo.

@GGgatherer Can you confirm in 2d68329 or later?

Edit Using your attached save game, dropping the belt into vehicle cargo, I correctly get the prompt for what to do with the liquid.

@GGgatherer
Copy link
Contributor Author

@GGgatherer Can you confirm in 2d68329 or later?

Edit Using your attached save game, dropping the belt into vehicle cargo, I correctly get the prompt for what to do with the liquid.

@wapcaplet The issue was not that the liquid was spilling, it's fine, it should be spilling. The issue was that the pouch ended up under my character's feet instead of being put in the box despite game specifically stating in the log that it was put in the box. And it still ends up under feet in b10946.
As for the second part of the issue and how it was "solved" by #42341, well, my opinion is it technically solved the problem by actually masking it. It's ok for now but who knows what will it break in the future. I just hope the answer is "nothing".

@mqrause
Copy link
Contributor

mqrause commented Aug 24, 2020

As for the second part of the issue and how it was "solved" by #42341, well, my opinion is it technically solved the problem by actually masking it. It's ok for now but who knows what will it break in the future. I just hope the answer is "nothing".

Can confirm that it's somewhat of a low effort solution. It should be as stable as a "proper" solution with a popup to select if you want to spill the contents, though.

@wapcaplet
Copy link
Contributor

wapcaplet commented Aug 24, 2020

The issue was that the pouch ended up under my character's feet instead of being put in the box despite game specifically stating in the log that it was put in the box. And it still ends up under feet in b10946.

@GGgatherer OK, now I see that the pouch is dropped at my character's feet, but only if there is a non-liquid item in one of its pockets. The liquid contents appears to have nothing to do with the dropping-at-your-feet issue.

Here I have loaded your save game, using the revised tactical test pouch I posted in my comment above. Upon load, the avatar is wearing the pouch, with a cellphone in pocket 1, and clean water in pocket 2:

image

As you say, when I try to drop the pouch into vehicle storage to the NW, I am prompted for what to do with the liquid. I will pour it back into the water bottle:

image

This leaves the pouch with cellphone at my feet, as you have noted:

image

But now, pick up the pouch (and Wear it again), then again try to drop it into vehicle storage - it will again land at your feet. Whether the pouch has liquid contents or not, the same behavior results. It is the presence of a non-liquid item that prevents it from being dropped into the storage space.

Remove that item (leaving the test pouch empty), and it successfully drops into the storage space for me:

image

All that said, we are working with an item you made up. Are there any existing in-game items that you have observed this behavior with? This is definitely a bug that should be fixed, but unless it is occurring with normal items in vanilla, or in a mainline mod, then it's quite an edge case.

As for the second part of the issue and how it was "solved" by #42341, well, my opinion is it technically solved the problem by actually masking it.

It was partly that PR, and partly the "What to do with clean water?" prompt that fixes the bug of allowing an "open_container" of liquid to be placed into your coat pocket. You said it just masks the issue, and your original description suggested that it should simply spill. I don't understand what solution you would prefer to see here.

And again, we are talking about a custom item that you made up - if you know of this happening with an existing mainline item, please share. Otherwise, this issue is not likely to be considered high priority.

@GGgatherer
Copy link
Contributor Author

All that said, we are working with an item you made up. Are there any existing in-game items that you have observed this behavior with?

As far as I know, no.

It was partly that PR, and partly the "What to do with clean water?" prompt that fixes the bug of allowing an "open_container" of liquid to be placed into your coat pocket. You said it just masks the issue, and your original description suggested that it should simply spill. I don't understand what solution you would prefer to see here.

Well, the issue in question was "it does neither ask to spill nor actually spill the liquid when it should", so... It should ask where to spill the liquid, then put the item wherever I decide, be it worn container or not. Just like the regular behavior of such items.

And again, we are talking about a custom item that you made up - if you know of this happening with an existing mainline item, please share. Otherwise, this issue is not likely to be considered high priority.

There are no similar things in vanilla (yet) but when I asked about it on discord, KorGgent said he made the NC system to support any combination of pockets so it should support this particular one. It isn't even something super wonky, like software pocket+magazine well.

@KorGgenT KorGgenT removed this from Confirmed blockers / To Do in 0.F Release Planning Aug 31, 2020
@KorGgenT KorGgenT removed this from the 0.F milestone Aug 31, 2020
@KorGgenT
Copy link
Member

at wapcaplet's request this has been removed from release blockers. this is something we still want to fix but since no items in the repo have this particular combination it isn't high enough priority to stop the release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bug> This needs to be fixed [C++] Changes (can be) made in C++. Previously named `Code` Items: Containers Things that hold other things Mechanic: Pockets
Projects
None yet
Development

No branches or pull requests

5 participants