Quantum Resource Distribution

by eliont

Special chest can send placed items to ship quantum storage unit and retrieve from it. Also works for player inventory (optional). It's make resource management more like RTS for playing combat-oriented settings/mods. Compatible with multi-surface mods like Space Exploration - item transportation works on surface, but not between them. Should be UPS-friendly because using events to track entities, not find_entities_filtered.

Content
5 months ago
1.1
1.11K
Logistics Logistic network Circuit network Storage

b Chest does not get supplied with item is less then minimal request amount left in storage

1 year, 5 months ago

Chest does not get supplied with item is less then minimal request amount left in storage. For example I got 10 conveyors in global storage, but minimum supply ammount I can set is 50. In that case these 10 conveyors got stuck in storage and won't be requested unless I get 50+ of them in global storage

1 year, 5 months ago

Typo: ...with item IF less then...

1 year, 5 months ago

No sure if it is correct but in works in my case. I fixed it in control.lua

function put(surface,inv,item,amount)
if not global.pool[surface.name] then global.pool[surface.name] = {} end
if not global.pool[surface.name][item] then
global.pool[surface.name][item] = {amount=0, category='main'}
end

if inv.get_insertable_count(item) < amount then return end

local content = inv.get_contents()
local needed = amount

if content[item] then needed = needed - content[item] end
if needed <= 0 then return end
local amount_left = global.pool[surface.name][item]['amount']
if amount_left == 0 then return end
if amount_left < needed then needed = amount_left end

global.pool[surface.name][item]['amount'] = global.pool[surface.name][item]['amount'] - needed
inv.insert({name=item, count=needed})
end

Logic is following: we get amount that left in quantum storage and if it is 0 then we exit. Next we check if amount left is grater or equal to requested. If it is not, we insert leftovers insted of requested amount

1 year, 5 months ago

it's not bug, it's intended feature.

1 year, 5 months ago

it's not bug, it's intended feature.

Why don't you make it dependent on a setting? I haven't looked at the code yet, but it should even work as a per-player setting so everybody can play the way they want to. If that's too much work, I guess a global setting (can be changed at runtime but affects all players) would be a good compromise. :-)

1 year, 5 months ago

Okay, i will look.

1 year, 5 months ago

Updated.

1 year, 5 months ago

Chest does not get supplied with item is less then minimal request amount left in storage. For example I got 10 conveyors in global storage, but minimum supply ammount I can set is 50. In that case these 10 conveyors got stuck in storage and won't be requested unless I get 50+ of them in global storage

and, btw, you can manually input request value from keyboard

1 year, 5 months ago

Thank you for your update, sir!

Yes, I found today that I could input request value from keyboard when I tried to pull off my stucked inserters)

1 year, 5 months ago

The Fluidpoint provides infinite amounts of fluids. Is this intended behaviour?
Here's my save file. free-water.zip

1 year, 5 months ago

Is this intended behaviour?
No, it should work like a chest for items.

Go to mod settings, toggle strictly requested amount. Is bug persists in both modes?

1 year, 5 months ago

The bug only persists with strict mode turned off.

1 year, 5 months ago

Should be fixed now.

This thread has been locked.