Inventory Sort

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

Inventory Sort

Post by TheSAguy » Wed Jun 26, 2019 6:05 pm

Is there a way to sort items in a chest?

Image

Thanks,

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

Re: Inventory Sort

Post by mrvn » Thu Jun 27, 2019 2:12 pm

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

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

Re: Inventory Sort

Post by xfir01 » Thu Jun 27, 2019 2:50 pm

+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
Burner Inserter
Burner Inserter
Posts: 9
Joined: Fri Jun 14, 2019 2:41 am
Contact:

Re: Inventory Sort

Post by Xynariz » Fri Jun 28, 2019 5:22 pm

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?

Loewchen
Global Moderator
Global Moderator
Posts: 5211
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: Inventory Sort

Post by Loewchen » Fri Jun 28, 2019 5:37 pm


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

Re: Inventory Sort

Post by eradicator » 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.
Author of: Hand Crank Generator, Screenshot Hotkey 2.0
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

slippycheeze
Fast Inserter
Fast Inserter
Posts: 220
Joined: Sun Jun 09, 2019 10:40 pm
Contact:

Re: Inventory Sort

Post by slippycheeze » Fri Jun 28, 2019 6:13 pm

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: 3411
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Inventory Sort

Post by mrvn » Mon Jul 01, 2019 1:35 am

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: 1401
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Re: Inventory Sort

Post by TheSAguy » Mon Jul 01, 2019 3:55 am

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”

Who is online

Users browsing this forum: No registered users