Generic Logistic Chest


Allows the player to make a special chest that can be turned into any of the base game logistic chests.

Content
1 year, 6 months ago
0.13 - 1.1
5.15K
Logistic network

b Fast replace issues

3 years ago

Hey there! This mod is awesome, thank you.

I had two thoughts and ran into some issues when struggling with swapping out some vanilla chests with generic ones.

  1. Is it possible to have fast-replace from a vanilla logistics chest to a generic one and inherent the chest type rather than throwing the GUI?
    If this is do-able, it would be nice to have face replacing a generic chest, with another generic chest be the trigger for the selection GUI.
  2. When fast replacing a chest, a requestor chest for example, I seemed to lose my request filters in the fast replace action. Can these be preserved?
  3. Preforming a Ctrl+z after a fast replace seemed to cause my bots to jam over the chests without being able to fast replace back from a generic chest, to a vanilla chest
3 years ago

I can look into 1, and 2 is tied into that as well. Though I did just add scrolling while holding the generic chest, so you can press ALT + mouse-scroll-up/down to scroll through the options and fast replace it onto the old chests. I just tested and this will preserve the filters.

I'm not sure about 3, at a glance there is nothing I can do about undo or the queue of actions the player just did, but I'll see if I can get it to work.

3 years ago
(updated 3 years ago)

I can look into 1, and 2 is tied into that as well. Though I did just add scrolling while holding the generic chest, so you can press ALT + mouse-scroll-up/down to scroll through the options and fast replace it onto the old chests. I just tested and this will preserve the filters.

This is great, I'll give the scroll feature a try. I do think there is something to be said for the inheritance however. If placing a generic chest over a requester.. I've effectively already chosen what type of chest I want there. Simply fast replacing the vanilla for the generic variant.

I'm not sure about 3, at a glance there is nothing I can do about undo or the queue of actions the player just did, but I'll see if I can get it to work.

And yeah, I was worried about 3. Figured it was an issue with the undo logic, but I appreciate you looking into it!

3 years ago

Fast replacing/upgrading has been added.

For 1a (replacing a generic to reopen the UI), this is now possible, but because I had to do it kinda hacky it only works when building one at a time. Drag placing does not work. This is due to Factorio not actually letting you build on top of the same entity, so I had to trigger it on the actual button press.

Undo should work all of the time. When fast replacing it will deconstruct the generic chest and replace it with the normal logistic chest, or it will undo the selection and swap it back to a generic, when the selection UI was used. In that case, double tapping Ctrl+z will entirely remove the chest. I imagine there is going to be some weird scenario that I missed, so let me know if you run into any issues with undo.

3 years ago

This seems so much more natural to use. I'll play with undo and let you know if I have any issues, thanks!

3 years ago
(updated 3 years ago)

Might need to use a little more advanced logic for determining the type of chest to place if the cursor is slightly off-target. I'm getting situations with the latest update where it doesn't detect the 'real' logistic chest it's replacing (edit: resulting in placement of a generic chest, randomly). My guess is that the cursor is highlighting flying bots and breaking the auto-detection? Might still be imperfect, but if it checked for an unambiguous nearby chest (under the highlighted entity) it might catch most of these situations--assuming I'm right about the cause.

3 years ago

Oof. It was a way simpler fix than that at least. I was iterating over a list of entities at that position looking for the chest and was exiting after the first one instead of the first chest found.

3 years ago

Nice! Glad to hear this wasn't too much work.

3 years ago
(updated 3 years ago)

The detection of the intended chest works well now, but sometimes it's desirable to place a generic chest as quick-replace in order to switch the existing one to a different type. I'm not sure what to suggest for this situation.

The obvious workaround is to place a new one and copy-paste back, and maybe that's as good as it gets?

3 years ago
(updated 3 years ago)

Well, from what I understand (and a quick test) of the recent changes, the intent was to allow fast replacing of vanilla chests by inheriting the same chest type.

Changelog:

Features:
- Added support for upgrading from a normal logistic chest to a generic chest replacement version of it (fast replace or upgrade planner/shift clicking)
- Added support for "building" a generic chest on top of a current generic chest to reopen the UI

To change type from there, you have two options:

  1. [Working] Before fast replacing with a generic chest, hold alt+mouse scroll through the chest types. This should allow you to change from one type to another
  2. [No Longer Working] The other option that was working, but now it seems not, is by simply placing a generic chest over another. This should present the GUI to allow you to select the type
3 years ago

So, fast replacing from vanilla to generic replacement (small green symbol) was the intended goal, but it currently also does the same from a replacement when building a generic on top of it.

Thinking about that, there's not really a use case there. The player is not going to want to switch from a replacement to the exact same thing. So, maybe I'll leave that to just placing a normal generic chest.

So, if you have a vanilla chest and fast replace to generic, it will be replaced to the generic equivalent. Then, fast replacing a generic again will place the entity as usual and open the UI. Does that make sense?

3 years ago

So, if you have a vanilla chest and fast replace to generic, it will be replaced to the generic equivalent. Then, fast replacing a generic again will place the entity as usual and open the UI. Does that make sense?

Makes perfect sense. I'll have to test this, because it was this part specifically that wasn't working for me last night. Plopping a generic on top of an already fast-replaced generic chest of the same type (this worked well), didn't present the type selection UI as I was expecting.

3 years ago

Correct, that is not currently in the mod, I'm going to try to get a quick version update to change that now though.

3 years ago

Took a bit longer than expected. Drag building will constantly trigger a build (since I'm replacing it on build), so I had to introduce a slight lag in it (added a new setting to configure this). So, if you are experiencing moments where the fast replace is going straight to generic or not doing it fast enough, you may want to adjust "Fast Replace Lag".

I did notice that fast replace makes undo fairly useless when build dragging. Since each tick it's rebuilt from you and I fast replace it undo is done for each one of those, so takes forever. Not much I can do to fix it though.

3 years ago

Sounds good, I'll give it a test here soon and see if I run into any issues. Thanks!

3 years ago

Just did some cursory testing.

The GUI is now showing up when replacing a generic with a generic as expected, and click dragging a row of them seems to work nicely...
Undo behavior is still a bit odd, but it sounds like that is to be expected.

Thanks for all your work on this!

New response