InfiniteInventory

by Qon

Your inventory size changes so that there's always some empty slots!

Content
2 years ago
0.18 - 1.1
17.7K
Cheats

b [Fixed] Extra slots are only added/removed when opening the inventory

3 years ago
(updated 3 years ago)

Hello again.

I tested this on my save and it seems that I may have found a bug:

  • Tried to mine a big warehouse, it mines until the inventory is full, no new slots added (my bonus inventory slots says 105 without needing extra slots).
  • I tried to make a request (logistic network via bots) for 200k green circuits and it fully fills my inventory but no slots are added.
  • Control+clicking on a warehouse to give me all its contents, fills my inventory but no slots are added.
  • In any case, slots are not removed when empty.
  • When I double-tap E to open/close my inventory, I finally get more/less slots, which then fixes all the problems above.

Which means the extra slots are only added/removed when opening the inventory.

3 years ago

The mod only changes inventory slot count while GUIs are closed. If they are open it waits until you close your inventory (or other) GUI and applies the change then, within a second. Exactly why that is necessary I don't know, DedlySpyder wrote the original mod that I changed. But the function that checks if a GUI is opened is called "isSafeToChange", which implies that horrors await those that try to modify the slot bonus while a GUI is open? I might test later if that is actually necessary.

But you say that you open and then close your inventory. Does that mean you have all GUIs closed while doing this? I can ctrl+click a massive inventory as fast as I can can and it works every time, no need to re-open my inventory.

The mod doesn't check for any GUI opened/closed events, it only checks GUI status when it needs to modify your slot count bonus. That is, when your inventory changes or once a second for all players for whom the inventory was open when it tried to modify the slot count (until it is closed).

Basically it is a bit shy and only works when you aren't trying to look at your slot count to see if they are changing.

So, what kind of GUIs do you have open, if any?

3 years ago

I asked DedlySpyder why changing inventory size while it was opened was considered "unsafe". Seems like it was because changing inventory size in old facorio made the scroll position reset, which seems very annoying if you are trying to drop off like one item of several different stacks at the bottom of a massive inventory.

I can test it later in modern Factorio, and maybe enlarge the inventory (not shrink since that isn't necessary to do immediately) when all slots are it non-empty. Or if scroll position stays in new GUI then I'll just remove that check :)

3 years ago
(updated 3 years ago)

Your comments make perfect sense.

Its in fact what I am seeing currently after some more testing :
- I "mine" a warehouse and I get some items + inventory full because it hasnt "expanded" yet, if I keep mining it (keep right-click pressed) it will then mine at 9600 items per "mine" action, which for green circuits (200/stack) is 48 stacks (what I set in the config per your recommendation earlier to mine a full chest).
- If I set the logistic request to 200k and keep my inventory closed, I will get a constant stream of items (48 stacks buffer in config)
- If I then set the config to 4800 stacks (which means I get a gigantic amount of buffer) and set the logistic request to 200k I will nearly crash my game when those 200k get delivered in 5 seconds.

Removing the extra check would make everything smoother for sure, but its not a big deal now that I know what is happening and can adjust :D

3 years ago

I can test it later in modern Factorio

Tested. Scroll position is still reset in Factorio 0.18 when character_inventory_slots_bonus is changed

3 years ago

I can [...] maybe enlarge the inventory (not shrink since that isn't necessary to do immediately) when all slots are it non-empty.

I did the thing. v1.3.0 now enlarges your inventory when it is full, even if the GUI is open.

3 years ago

Awesome! I will test it tomorrow :) If anything is wrong I will let you know

3 years ago

I jumped in really quick to test it (its 1am and have a meeting at 9am :X) .. lol

Anyways, I noticed that not only does the scroll position resets but also any open sub-menus, like the logistic item count sub-menu that opens up.

Test:
- Set request for all of my stored wood.
- Start to get items in, when it gets full it stops receiving until the inventory gets expanded (which is instant but stops the flow of the bots)
- See the inventory expanding as stated.
- See the scroll reset as stated.
- Try and set the request back to zero... fail to do so for the first 6 times because the sub-menu auto-closes before I can type 0 and press accept.
- Successfully set it, see the inventory drain out.
- Wait for the inventory to shrink but it didnt happen (I thought it would do the same as expand)
- Close/Re-open inventory and see the shrinked size of inventory.

To be honest, since it not only resets scroll but also closes the menu, I think it feels more "glitchy" the way it is currently than before when using bots - probably fine for mining chests.

If a whole state reset wouldnt happen, this would be fine! Feels like a bug. Report it? Perhaps next Friday they make a blog post on it?

PS: By the way, thanks for all the effort :D you are awesome!

3 years ago

Not shrinking while open is on purpose, and not changing size for every inventory update as well. To minimize updates while it is open.

But if submenues are closed that's annoying... in your case you could maybe temporarily turn off all logistics delivery at the top of the gui instead of manipulating the specific troubelsome request. Still not ideal though. Maybe possible to differentiate between different guis, but it's probably not differentiated precisely enough for this to work.

3 years ago
(updated 3 years ago)

New version:

Version: 1.4.0
Features:
- New setting for when to allow expansion of inventory, because of a Factorio bug that closes
GUIs for changing logistics requests and similar when your slot bonus changes.
Never: 1.2.0 behaviour.
Always: 1.3.0 behaviour.
Non-character GUI: New default setting for 1.4.0. Opening other GUIs than your character GUI
doesn't prevent expansion when inventory is full.
Thanks to TheSilentWarrior for notifying me!

This means that you can change your logistics requests in peace, but opening chests doesn't prevent the inventory from expanding when full. And older behaviours are still available as options. That's the level of detail of GUI types opened that can be detected. The slider GUI thing that are closed down are invisible to mods.

But yeah what you talked about, GUIs being closed down, that really seems like a bug that should be reported. I don't have the energy for that now though. Really scroll position resetting should also be fixed as it is also similar glitchy behaviour.

3 years ago

Once again, thanks for the update. That was quick!

Happy camper here :D

New response