A mod for the game Factorio.
321freddy / even-distribution Goto Github PK
View Code? Open in Web Editor NEWEven Distribution Factorio Mod
Even Distribution Factorio Mod
A mod for the game Factorio.
Factorio version: 1.1
Even Distribution version: 1.0.10
There's an empty UI element in the top-left corner of the game when the Even Distribution mod is enabled:
I've verified that this must be caused by Even Distribution by doing the following:
I tried changing all of the configuration options and wasn't able to get it to go away, so I'm assuming this is a bug and not a misconfiguration on my part. It seems to be a very old bug (>3 years) based on a few reddit posts I've found [1][2].
I don't know anything about Factorio mods but I am a software developer; if anyone has any ideas as to what's causing this and can point me in the right direction I'm more than happy to try fixing it myself and submitting a PR.
Hi there!
Just thought I'd report this bug, unfortunately overwrote the save file for this one, but hopefully the stack trace helps! Cheers.
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>
Pressing Shift-C (I believe they crash near pipes, but I'm not 100% sure if that's the cause)
Using Even Distribution to rebalance any item with a durability (ammo, repair packs, science packs) resets the durability of the items to full. Any such item to any inventory replicates the issue.
Replication:
Start game
Shoot some bullets
Distribute your pistol ammo across a chest
Pistol ammo in chest is full again
Due to changes in the 18.22 API, mods hotkeys can no set consuming to "all"
I am playing Angel Bob game with tech & component overhaul. I really enjoy mode when all non-placeable items (including fuel) are automatically distributed to machines. Angels componens are not known to mod. I had to modify code on my local copy in the following way
function setup.generateTrashItemList()
local items = {}
for name,item in pairs(game.item_prototypes) do
if not (item.place_result or item.place_as_equipment_result or item.has_flag("hidden")) then -- or item.place_as_tile_result
local default = defaultTrash[name] or defaultTrash[item.subgroup.name] or defaultTrash[item.group.name]
if default and default ~= "ignore" then
if item.fuel_category and not defaultTrash[name] then -- fuels default to 2 stacks as desired amount
items[name] = 2 * item.stack_size
else
items[name] = default
end
end
**_items[name] = 0_**
end
end
return items
end
This works for both components and fuel.
Would it be possible to add this as option?
Fuel limit in UI seems to be not respected for coal - if I turn on option "use fuel limits" and set fuel limit it zero, coal still not fully distributed, probably because of default 400 limit set in code. So I have turn off option "use fuel limits" and rely on above code modification.
6405.569 Error MainLoop.cpp:1013: Exception at tick 4712546: Error while running event even-distribution::inventory-cleanup (ID 106)
LuaBurner doesn't contain key fuel_category.
stack traceback:
__even-distribution__/scripts/cleanup.lua:41: in function 'filterEntities'
__even-distribution__/scripts/cleanup.lua:25: in function 'func'
__even-distribution__/control.lua:26: in function <__even-distribution__/control.lua:25>
The game is crashing when I try to insert, using this mod, rocket fuel into silos (try to insert in 1 or 2 silos).
819.009 Error MainLoop.cpp:1284: Exception at tick 101226964: The mod Even Distribution (1.0.10) caused a non-recoverable error.
Please report this error to the mod author.
Error while running event even-distribution::on_tick (ID 0)
LuaInventory API call when LuaInventory was invalid.
stack traceback:
[C]: in function 'index'
__even-distribution/scripts/helpers/LuaControl.lua:94: in function 'insert'
even-distribution/scripts/helpers/LuaControl.lua:232: in function 'customInsert'
even-distribution/scripts/drag.lua:54: in function 'func'
even-distribution/scripts/util.lua:116: in function 'distribute'
even-distribution/scripts/drag.lua:43: in function 'distributeItems'
even-distribution/scripts/drag.lua:19: in function 'func'
even-distribution/framework.lua:99: in function <even-distribution/framework.lua:98>
Thanks
Suggestions for more modes are welcome!
this error started happening after upgrading to 1.0.2 of the mod, trying to load an save with mod version 1.0.1
and also happens when trying to start a new world
error:
The mod Even Distribution (1.0.2) caused a non-recoverable error.
Please report this error to the mod author.
Error while running event even-distribution::on_configuration_changed
__even-distribution__/scripts/helpers.lua:21: attempt to index a nil value
stack traceback:
__even-distribution__/scripts/helpers.lua:21: in function '__index'
__even-distribution__/scripts/setup.lua:245: in function 'migrateSettings'
__even-distribution__/scripts/setup.lua:87: in function 'setupPlayerGlobalTable'
__even-distribution__/scripts/setup.lua:74: in function 'func'
__even-distribution__/framework.lua:99: in function 'handleEvent'
__even-distribution__/framework.lua:108: in function <__even-distribution__/framework.lua:108>
i think this crash already got reported on the mod discussion, but i thought posting it in the source would also help:
The Factorissimo2 Buildings have a 'chest entity' that helps to display an overlay over the buildings so players can have an idea of what their buildings do. This chest entity is receiving items from even distribution, but when it does these items disappear into the nether. I asked MagmaMcFry what could be done on his end, but he said that really the only solution is for Even Distribution to have an exclusion set on this entity: "factory-overlay-display".
Would it be possible to set up even distribution to ignore that entity?
See also https://mods.factorio.com/mods/321freddy/even-distribution/discussion/15888
Screenshot below.
When I press shift-C while carrying tons of fuel, I expect Even Distribution to dump fuel (up to a set limit) into nearby machine fuel slots. This does occur.
But the mod additionally places a stack of fuel in the furnaces' output slots, which inserters place on my furnace array's output belt. This has the potential to cause all sorts of problems elsewhere in the factory.
NOTE: I play with a ton of mods. This is my first playthrough with Space Exploration, and the issue involves a fuel type introduced by that mod. I do not know if the issue is specific to this item, or all items from Space Exploration, or fuels from all mods, or all fuels.
While distributing ammo to AAI Chaingunners, I got the following stacktrace when I released right-click:
1916.637 Error MainLoop.cpp:1183: Exception at tick 694672: The mod Even Distribution caused a non-recoverable error.
Please report this error to the mod author.
Error while running event even-distribution::on_tick (ID 0)
There is no valid object with id 1919.
stack traceback:
__even-distribution__/scripts/visuals.lua:105: in function 'func'
__even-distribution__/scripts/helpers.lua:141: in function 'where'
__even-distribution__/scripts/visuals.lua:101: in function 'unmark'
__even-distribution__/scripts/visuals.lua:115: in function 'func'
__even-distribution__/scripts/helpers.lua:124: in function 'each'
__even-distribution__/scripts/visuals.lua:114: in function 'unmark'
__even-distribution__/scripts/drag.lua:173: in function 'resetCache'
__even-distribution__/scripts/drag.lua:62: in function 'distributeItems'
__even-distribution__/scripts/drag.lua:15: in function 'func'
__even-distribution__/framework.lua:99: in function <__even-distribution__/framework.lua:98>
stack traceback:
[C]: in function 'get_target'
__even-distribution__/scripts/visuals.lua:105: in function 'func'
__even-distribution__/scripts/helpers.lua:141: in function 'where'
__even-distribution__/scripts/visuals.lua:101: in function 'unmark'
__even-distribution__/scripts/visuals.lua:115: in function 'func'
__even-distribution__/scripts/helpers.lua:124: in function 'each'
__even-distribution__/scripts/visuals.lua:114: in function 'unmark'
__even-distribution__/scripts/drag.lua:173: in function 'resetCache'
__even-distribution__/scripts/drag.lua:62: in function 'distributeItems'
__even-distribution__/scripts/drag.lua:15: in function 'func'
__even-distribution__/framework.lua:99: in function <__even-distribution__/framework.lua:98
I was also using AAI Programmable Vehicles, which seems to do some funky things when vehicles start/stop moving - possibly making them change IDs?
I think I got unlucky with the exact tick - I couldn't reproduce the crash easily.
Item stack count has to a be positive number
stack traceback:
__even-distribution__/scripts/drag.lua:149: in function 'stackTransferred'
__even-distribution__/scripts/drag.lua:101: in function 'func'
__even-distribution__/framework.lua:98: in function <__even-distribution__/framework.lua:97>
stack traceback:
[C]: in function 'remove_item'
__even-distribution__/scripts/drag.lua:149: in function 'stackTransferred'
__even-distribution__/scripts/drag.lua:101: in function 'func'
__even-distribution__/framework.lua:98: in function <__even-distribution__/framework.lua:97>
Bug: Upgrade planner is clearing blueprint books, upgrade planners, and deconstruction planners
Steps to reproduce:
This can be a serious issue, causing people to loose blueprint books. I'm the dev for Sea Block and someone reported this issue on our discord. They had a deconstruction planner in their blueprint book an they lost all their blueprints. They weren't intending to use Even Distribution's functionality at the time.
shift+c
The mod Even Distribution (1.0.1) caused a non-recoverable error.
Please report this error to the mod author.
Error while running event even-distribution::inventory-cleanup (ID 200)
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:77: in function 'mark'
__even-distribution__/scripts/cleanup.lua:45: in function 'func'
__even-distribution__/scripts/util.lua:82: in function 'distribute'
__even-distribution__/scripts/cleanup.lua:36: in function 'func'
__even-distribution__/scripts/helpers.lua:176: in function 'each'
__even-distribution__/scripts/cleanup.lua:29: in function 'distributeItems'
__even-distribution__/scripts/cleanup.lua:20: in function 'func'
__even-distribution__/framework.lua:99: in function <__even-distribution__/framework.lua:98>
ctrl+right click-drag or ctrl+left click-drag
The mod Even Distribution (1.0.1) caused a non-recoverable error.
Please report this error to the mod author.
Error while running event even-distribution::on_player_fast_transferred (ID 131)
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:238: in function 'onStackTransferred'
__even-distribution__/scripts/drag.lua:212: in function 'func'
__even-distribution__/framework.lua:99: in function <__even-distribution__/framework.lua:98>
mods list:
``
aai-industry
Aircraft
alien-biomes
beautiful bridge railway Cargoships
Bio Industries
Bottleneck
cargo-ships
cargo-ships-graphics
CopyPasteModules
even-distribution
EvoGUI
FARL-fixed-se
Fill4Me-fixed
flib
Flow Control
FluidMustFlow
helmod
informatron
jetpack
KingsTurret-Shields
KS Power
LogisticTrainNetwork
LtnManager
ModuleInserterEx
PickerAtheneum
PickerExtended
Robo-Charge-1x1
Solar-Lamp
stdlib
thermal-solar-power
upgrade-planner-next
Warehousing
Problem: If inventory cleanup fills a slot in an assembler/etc. while an inserter is on its way to depositing that same type of item, the inserter will be unable to insert it. (Naturally.) If that inserter is also responsible for inserting other items, production will grind to a halt because the other necessary items will never get inserted.
Solution: Add an 'Inventory cleanup limit' slider to the ED tab to allow players to set the amount that production machine slots will be filled when inventory cleanup is triggered. (e.g. if set to '0.9 stacks', 10% of the space will be available for inserters to insert more items.)
Does that sound reasonable?
I really like you mod, unfortunately not all my players like it.
Could you add an option to disable it per player?
(Maybe be setting the time to 0.0
)
DyWorld-Dynamic mod introduces new radar which burns carbon fuel for it to run.
So entity:inventory("fuel")
at https://github.com/321freddy/even-distribution/blob/master/scripts/cleanup.lua#L267 returns nil
and then is accessed right away, causing Lua's equivalent of Null pointer exception.
After some debugging I found that entity.get_inventory("fuel")
returns actual inventory while entity.get_fuel_inventory()
returns nil
. It appears to be bug in Factorio, but fast fix for this mod would be to use entity.get_inventory(defines.inventory.fuel)
on line https://github.com/321freddy/even-distribution/blob/master/scripts/helpers/LuaControl.lua#L67
Just waiting a few ticks before distributing is stupid as you always need to swith between short and long delay.
Please add a setting to only trigger distribution on pressing the hotkey again, or, if you can get a keyboard library to work, to not work if the hotkey is still held.
Thank you for a nice mod!
even-distribution/scripts/util.lua
Line 70 in 318a089
missing local so temporary value with object refs is stored in global context outside of global variable. This is not safe and may desync
mod even-distribution has object ref inside _G.tblId.524970.box
mod even-distribution has object ref inside _G.tblId.524973.box
mod even-distribution has object ref inside _G.tblId.524975.box
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>
Using v1.0.0 of this and Factorio 1.1.
So I click on this to open the settings:
And then I try this to close it:
Basically it doesn't close the settings but removes the top header bar thing.
I tried this on a save from 1.0 and also just started a new game to test this and I get the same results.
I am using the flat character gui if it makes a difference.
Part of my mod uses container
-type entities as part of a more complex thing, and this makes Even Distribution break them when it inserts additional items into it.
Would it be possible to have a remote interface or something, so that mods like mine can specify some entities to exclude from Shift+C cleanup?
Title. It works on everything else, but not Furnaces
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.