Inventory Sort

Post all other topics which do not belong to any other category.
Post Reply
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Inventory Sort

Post by TheSAguy »

Is there a way to sort items in a chest?

Image

Thanks,

mrvn
Smart Inserter
Smart Inserter
Posts: 5682
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Inventory Sort

Post by mrvn »

+1 on this. Or at least compress items when they don't use full stack.

xfir01
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Fri Feb 10, 2017 5:08 pm
Contact:

Re: Inventory Sort

Post 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.

Xynariz
Inserter
Inserter
Posts: 29
Joined: Fri Jun 14, 2019 2:41 am
Contact:

Re: Inventory Sort

Post 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?


User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Inventory Sort

Post 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.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

slippycheeze
Filter Inserter
Filter Inserter
Posts: 587
Joined: Sun Jun 09, 2019 10:40 pm
Contact:

Re: Inventory Sort

Post 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. :)

mrvn
Smart Inserter
Smart Inserter
Posts: 5682
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Inventory Sort

Post 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.

TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Re: Inventory Sort

Post 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

Post Reply

Return to “General discussion”