Page 1 of 1

Inventory Sort

Posted: Wed Jun 26, 2019 6:05 pm
by TheSAguy
Is there a way to sort items in a chest?

Image

Thanks,

Re: Inventory Sort

Posted: Thu Jun 27, 2019 2:12 pm
by mrvn
+1 on this. Or at least compress items when they don't use full stack.

Re: Inventory Sort

Posted: Thu Jun 27, 2019 2:50 pm
by xfir01
+1 Yes.

Only workaround I've found is to built a bunch of temp warehouses, ctrl-click different items and sort them in my player inventory -> temp warehouse, and then fill the original back up in a semi-ordered way, and pick up the temp storage.

Re: Inventory Sort

Posted: Fri Jun 28, 2019 5:22 pm
by Xynariz
I would also love this. Your inventory is auto-sorted (by default, I believe there is an option for it), so why not have the ability to sort a chest/vehicle inventory?

I would be fine if there was some sort of "smart chest" (requiring a chest and maybe a few circuits of an appropriate tier), and only those can be sorted.

I do see a potential issue with very large modded inventories, as by definition, sorting is at minimum an n log(n) operation. Maybe if an inventory is above X size, it will only combine partial stacks and move stacks forwards?

Re: Inventory Sort

Posted: Fri Jun 28, 2019 5:37 pm
by Loewchen

Re: Inventory Sort

Posted: Fri Jun 28, 2019 5:39 pm
by eradicator
LuaInventory.sort_and_merge()
Xynariz wrote:
Fri Jun 28, 2019 5:22 pm
I do see a potential issue with very large modded inventories, as by definition, sorting is at minimum an n log(n) operation. Maybe if an inventory is above X size, it will only combine partial stacks and move stacks forwards?
As the only one who cares about sorting is the user you don't need to sort chests that the user doesn't open.

Re: Inventory Sort

Posted: Fri Jun 28, 2019 6:13 pm
by slippycheeze
FWIW, the Picker Inventory Tools mod is able to do this; I'm sure there are others, I just happen to know that one because I use it for other reasons. Not a core feature, but the mod doesn't force any sort of "cheat" stuff on you either.

Personally, I just have randomly unsorted chests of crap all over the place, and a full inventory, but YMMV. :)

Re: Inventory Sort

Posted: Mon Jul 01, 2019 1:35 am
by mrvn
eradicator wrote:
Fri Jun 28, 2019 5:39 pm
LuaInventory.sort_and_merge()
Xynariz wrote:
Fri Jun 28, 2019 5:22 pm
I do see a potential issue with very large modded inventories, as by definition, sorting is at minimum an n log(n) operation. Maybe if an inventory is above X size, it will only combine partial stacks and move stacks forwards?
As the only one who cares about sorting is the user you don't need to sort chests that the user doesn't open.
Also sorting probably shouldn't happen automatically at all. I was thinking of a little "sort" button in the open chest dialog that you press to sort and merge items. At least merging stacks of item where possible would change the behavior of the chest and needs to remain a manual thing.

Re: Inventory Sort

Posted: Mon Jul 01, 2019 3:55 am
by TheSAguy
I brought this topic up before and there is a nice Mod:
viewtopic.php?f=6&t=60950&p=367281&hilit=Sort#p367408