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
2 years ago
0.15 - 1.1
336K

g Bug

2 years ago
(updated 2 years ago)

Has been working fine till latest Factorio update.
Factorio 1.1.38 (build 58907, win64, steam)

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

Error while running event even-distribution::on_player_fast_transferred (ID 129)
LuaEntity doesn't contain key x.
stack traceback:
[C]: in function 'index'
__even-distribution
/scripts/helpers.lua:21: in function <even-distribution/scripts/helpers.lua:20>
[C]: in function 'create_entity'
even-distribution/scripts/visuals.lua:39: in function 'mark'
even-distribution/scripts/drag.lua:237: in function 'onStackTransferred'
even-distribution/scripts/drag.lua:208: in function 'func'
even-distribution/framework.lua:99: in function <even-distribution/framework.lua:98>

EDIT: also logged on github

2 years ago

jo.. i got the same crash..

2 years ago

Same here, issue started after updating to 1.1.38.

2 years ago

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

Error while running event even-distribution::inventory-cleanup (ID 195)
LuaEntity doesn't contain key x.
stack traceback:
[C]: in function 'index'
__even-distribution
/scripts/helpers.lua:21: in function <even-distribution/scripts/helpers.lua:20>
[C]: in function 'create_entity'
even-distribution/scripts/visuals.lua:80: in function 'mark'
even-distribution/scripts/cleanup.lua:83: in function 'func'
even-distribution/scripts/helpers.lua:176: in function 'each'
even-distribution/scripts/cleanup.lua:77: in function 'func'
even-distribution/scripts/helpers.lua:176: in function 'each'
even-distribution/scripts/cleanup.lua:30: in function 'distributeItems'
even-distribution/scripts/cleanup.lua:21: in function 'func'
even-distribution/framework.lua:99: in function <even-distribution/framework.lua:98>

2 years ago

I came here to post this same thing. It's reproduceable every single time ED tries to do anything since the latest patch.

2 years ago
(updated 2 years ago)

This mod is wrapping LuaObjects with an extra layer of metatables and then trying to pass that wrapped object back to the game's APIs, which cannot then recognize it as a LuaObject. This causes it to attempt to load incorrect fields from it, thinking it is an alternative concept type (in this case, Position). You probably shouldn't be wrapping LuaObjects in metatable wrappers like this, and if you do, you certainly should not be passing them to APIs that way, unwrap them first!

It is more surprising that this worked at all in the past than that it is broken now.

2 years ago

https://drive.google.com/file/d/1pTWGNWJkF_Wv-iK-6WW5ZT0u4N_QvCOM/view?usp=sharing

Aaaaaand there is a link to an edited visuals.lua which fixes the bug

2 years ago

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

Error while running event even-distribution::on_player_fast_transferred (ID 129)
LuaEntity doesn't contain key x.
stack traceback:
[C]: in function 'index'
__even-distribution
/scripts/helpers.lua:21: in function <even-distribution/scripts/helpers.lua:20>
[C]: in function 'create_entity'
even-distribution/scripts/visuals.lua:39: in function 'mark'
even-distribution/scripts/drag.lua:237: in function 'onStackTransferred'
even-distribution/scripts/drag.lua:208: in function 'func'
even-distribution/framework.lua:99: in function <even-distribution/framework.lua:98>

Looks to be the same crash

2 years ago

https://drive.google.com/file/d/1pTWGNWJkF_Wv-iK-6WW5ZT0u4N_QvCOM/view?usp=sharing

Aaaaaand there is a link to an edited visuals.lua which fixes the bug

My hero of today !.. this works perfectly, thank you :-)

2 years ago

https://drive.google.com/file/d/1pTWGNWJkF_Wv-iK-6WW5ZT0u4N_QvCOM/view?usp=sharing

Aaaaaand there is a link to an edited visuals.lua which fixes the bug

Thank you very much !

2 years ago

https://drive.google.com/file/d/1pTWGNWJkF_Wv-iK-6WW5ZT0u4N_QvCOM/view?usp=sharing

Aaaaaand there is a link to an edited visuals.lua which fixes the bug

Thank you kind Sir!

2 years ago

Fixed in version 1.0.9 (thanks for the hint!)

2 years ago

Fixed in version 1.0.9 (thanks for the hint!)

Thanks for this quick fix !

2 years ago

Interesting. I looked at it for a while last night and couldn't figure it out. Not a Lua guy so it was all new to me.

New response