Even Distribution


Modifies CTRL + Click Drag to evenly distribute the items over multiple buildings. Also adds Inventory Cleanup hotkey (SHIFT+C) which evenly distributes unneeded items from inventory into nearby machines.

Utilities
5 months ago
0.15 - 2.1
532K

g Bug when loading a game

a month ago

I just updated Factorio to 2.1.23 and updated all mods (including Even Distribution).
When loading a saved game, I get this error and cannot continue.

The mod Even Distribution (2.1.0) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event even-distribution::on_configuration_changed
LuaItemPrototype doesn't contain key fuel_category.
stack traceback:
[C]: in function 'index'
__even-distribution
/scripts/setup.lua:297: in function 'generateTrashItemList'
even-distribution/scripts/setup.lua:16: in function 'func'
even-distribution/framework.lua:49: in function 'handleEvent'
even-distribution/framework.lua:58: in function <even-distribution/framework.lua:58>

a month ago

Yeah. Factorio has been updated an hour ago. Same error for me too.

a month ago

me too. same error. Cannot load any game

a month ago

same error

a month ago

me too. Same error.

the text in pop-up :

Error while running event even-distribution::on_init()
LuaItemPrototype doesn't contain key fuel_category.
stack traceback:
[C]: in function 'index'
__even-distribution
/scripts/setup.lua:297: in function 'generateTrashItemList'
even-distribution/scripts/setup.lua:16: in function 'func'
even-distribution/framework.lua:49: in function 'handleEvent'
even-distribution/framework.lua:58: in function <even-distribution/framework.lua:58>

a month ago

ye me too

The error:

Error while running event even-distribution::on_configuration_changed
LuaItemPrototype doesn't contain key fuel_category.
stack traceback:
[C]: in function 'index'
__even-distribution
/scripts/setup.lua:297: in function 'generateTrashItemList'
even-distribution/scripts/setup.lua:16: in function 'func'
even-distribution/framework.lua:49: in function 'handleEvent'
even-distribution/framework.lua:58: in function <even-distribution/framework.lua:58>

a month ago

Unpack mod, open scripts/setup.lua and delete lines 46-56 and paste this
for name, item in pairs(prototypes.item) do
if item.fuel_categories then
for _, category in pairs(item.fuel_categories) do
storage.fuelList[category] = storage.fuelList[category] or {}
table.insert(storage.fuelList[category], item)
end
end
end

for category, fuels in pairs(storage.fuelList) do
table.sort(fuels, function(a, b)
if a.fuel_value ~= b.fuel_value then
return a.fuel_value < b.fuel_value
end

    if a.fuel_acceleration_multiplier ~= b.fuel_acceleration_multiplier then
        return a.fuel_acceleration_multiplier < b.fuel_acceleration_multiplier
    end

    if a.fuel_top_speed_multiplier ~= b.fuel_top_speed_multiplier then
        return a.fuel_top_speed_multiplier < b.fuel_top_speed_multiplier
    end

    if a.fuel_emissions_multiplier ~= b.fuel_emissions_multiplier then
        return a.fuel_emissions_multiplier < b.fuel_emissions_multiplier
    end

    return false
end)

end

Next scripts/helpers.lua in line 63 change twice fuel_category to fuel_categories

Save both files and pack them back :)

a month ago

The mod generates an error in combination with running the Xander Fork:
The mod Even Distribution (2.1.0) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event even-distribution::on_configuration_changed
LuaItemPrototype doesn't contain key fuel_category.
stack traceback:
[C]: in function 'index'
__even-distribution
/scripts/setup.lua:297: in function 'generateTrashItemList'
even-distribution/scripts/setup.lua:16: in function 'func'
even-distribution/framework.lua:49: in function 'handleEvent'
even-distribution/framework.lua:58: in function <even-distribution/framework.lua:58>

a month ago

Mine has an additional line citing lua.

Error while running event even-distribution::on_configuration_changed
LuaItemPrototype doesn't contain key fuel_category.
stack traceback:
[C]: in function 'index'
__even-distribution
/scripts/setup.lua:297: in function 'generateTrashItemList'
even-distribution/scripts/setup.lua:16: in function 'func'
even-distribution/framework.lua:49: in function 'handleEvent'
even-distribution/framework.lua:58: in function <even-distribution/framework.lua:58>

a month ago

It looks like that sice the update the error has changed:
The mod Even Distribution (2.1.0) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event even-distribution::on_init()
LuaItemPrototype doesn't contain key fuel_category.
stack traceback:
[C]: in function 'index'
__even-distribution
/scripts/setup.lua:297: in function 'generateTrashItemList'
even-distribution/scripts/setup.lua:16: in function 'func'
even-distribution/framework.lua:49: in function 'handleEvent'
even-distribution/framework.lua:58: in function <even-distribution/framework.lua:58>

a month ago
(updated a month ago)

Check out the end of this discussion in Lappro's post: https://mods.factorio.com/mod/even-distribution/discussion/6ab27ae200d3c4b80e5adeb8

a month ago

Hello everyone, for as long as the author is away I'm trying to maintain a fork of this Mod, for all those that don't like to dabbel with the code.

https://mods.factorio.com/mod/even-distribution-fork

I'm pretty sure I solved all current issues, if not, hit me up, I try to check the mod portal daily.

New response