Merging Chests

by Atria

Enables merging of multiple chests into one entity. Supports merging of arbitrary number of chests (configurable in mod settings). Version 5.0.0 introduced potentially breaking changes for old saves. If your have chests larger than 42 don't update to 5.0.0.

Content
a month ago
0.13 - 1.1
99.7K
Storage

i Alt-selection and reselection ideas (I can help)

7 years ago
(updated 7 years ago)

Hi =)
Could you please realize the following:
1. Alt-selection (when holding Shift) performs demerging of the long chest to the separate ones, splitting its contents evenly (doesn't matter how, IMO).
2. Selection of a long chest with additional single/long chests located next to it on the same axis performs (re-)merging them, so the resulting chest becomes longer.
3. Selection of an area containing several groups of single/long chests performs several mergings like as if they were selected one after another.
4. Alt-selection of an area containing several long chests performs several demergings like as if they were alt-selected one after another (point 1).

I can even help with algorithms/lua-code, if you want.

7 years ago
(updated 7 years ago)

First of all: are you some kind of fan of this mod? I'm happy people are using this mod since i made it just to ease unloading of my trains.

  1. Sounds good. There will be some problems if players messed with chest multipliers, but there is warning for that.
  2. I originally wanted to do exactly that but logic to find continous line of randomly wide chests and steel chest while taking into consideration mas chest size was pretty hard. I would appretiate some Lua help here. I will work on in in my spare time and it probably will be last last of these things i will implement.
  3. Should be easy enough. Just refactor merging function and then run it multiple times.
  4. See point 1 and 3.

EDIT: 3. There will have to be some preference. If i'm mergin 20x2 solid array of chests should I merge them into 20 2-high chests or 2 20-wide chests?

7 years ago

Heh, I knew you'll ask exactly these questions. =) If there are any misunderstandings, mod should just ignore them, I think. Or merge in the direction the selection is longer: if selection's vector is (x=6;y=3), I.e. 6 wide and 3 high, then merge horizontally, lengthwise x axis.

I'll try to realize algorithms I mentioned. But it won't be soon enough - preparing for the job interview.

And yes, I'm a fan. %) But not of this mod - I'm fan of things that handify things. And your mod is one of those things. Thank you for it!

7 years ago
(updated 7 years ago)

Well, 3. is done and today i will work on 1.. It will be better for you to wait until i release new refactored code anyways, so you wouldn't make code for old version.

I looked into 2. again and new version of mod will prepare to merge in two steps:

  • calculate bounding box to figure out majority of merging vector
  • split chests into sorted lines that will be easily merged

Both of these steps will have to take into consideration that chests can be bigger than steel chests and that will be pain for sure.

Will post new version soon(TM). Good luck at interview.

7 years ago

Ok, now remains just 2.. If I won't have too much work at work tommorow I will look at it.

7 years ago

Got it! The job of the deputy chief of IT-department in a city company is mine! \o/ just wanted to share joy. Son and wife are just happy))))

Thanks a lot for the update! The new functionality is the second good news for me today!)))) Now it's time to drink some wine and finish the planned functionality in two of my mods.

New response