Fill4Me - errors fixed

by madmath

A Factorio mod to automatically insert fuel and/or ammunition into entities when you place them. Forked to fix error logs.

Utilities
1 year, 9 months ago
1.1
31.4K

b [Fixed] Crash on game start with Sea Block

1 year, 8 months ago

Today I found out, you forked the abandoned mod, there is a similar error when generating a new map, hope this is enough to fix it.

The mod Fill4me (0.10.1) caused a non-recoverable error.
Please report this error to the mod author.
Error while runninng event Fill4me-fixed::on_init()
Fill4me-fixed/stdlib/event/event.lua:156:
Fill4me-fixed/stdlib/event/event.lua:156:
core/lualib/production-score.lua:22:bad argument #1 of 2 to 'pairs'
(table expected, got nil)
stack traceback:
[C]: in function 'error'
Fill4me-fixed/stdlib/event/event.lua:156: in function 'dispatch'
Fill4me-fixed/stdlib/event/event.lua:38: in function
<Fill4me-fixed/stdlib/event/event.lua:37:>

1 year, 8 months ago

I can't reproduce: I can create a map without issues with the mod installed.

Can you reproduce it each time ? Which version of Factorio do you use ? Do you have other mods installed ?

1 year, 8 months ago

Log File https://pastebin.com/XFX8z8tr
- Reproduced every time
- Latest version of Factorio
- Sea Block mod pack + a bunch of quality of life and "cool" mods
Mod List
["A Sea Block Config"] = "0.5.2",
Aircraft = "1.8.4",
["Armored-train"] = "0.4.6",
AutoDeconstruct = "0.3.3",
AutoTrash = "5.3.13",
Automatic_Train_Painter = "1.1.4",
Bottleneck = "0.11.7",
CircuitProcessing = "0.4.4",
ElectricTrain = "1.1.2",
["Explosive Excavation"] = "1.1.8",
FARL = "4.1.2",
FNEI = "0.4.1",
Factorissimo2 = "2.5.3",
["Fill4Me-fixed"] = "0.10.1",
["Flow Control"] = "3.1.3",
GhostPlacerExpress = "0.1.9",
Hovercrafts = "1.2.2",
KS_Power = "0.5.1",
LandfillPainting = "0.5.2",
LogisticTrainNetwork = "1.16.10",
LtnManager = "0.4.15",
MaxRateCalculator = "3.4.48",
MouseoverDeconstruct = "0.1.4",
["Power Armor MK3"] = "0.4.1",
Raven = "0.1.12",
ScienceCostTweakerM = "1.1.10",
SeaBlock = "0.5.11",
SeaBlockMetaPack = "1.1.3",
SpaceMod = "1.1.1",
["Squeak Through"] = "1.8.2",
TheFatController = "5.1.2",
["Todo-List"] = "19.2.0",
VehicleSnap = "1.18.4",
["aai-programmable-structures"] = "0.7.4",
["aai-programmable-vehicles"] = "0.7.22",
["aai-signals"] = "0.6.1",
["aai-vehicles-hauler"] = "0.6.1",
["aai-vehicles-ironclad"] = "0.6.5",
["aai-zones"] = "0.6.4",
["angelsaddons-storage"] = "0.0.9",
angelsbioprocessing = "0.7.22",
angelspetrochem = "0.9.22",
angelsrefining = "0.12.2",
angelssmelting = "0.6.19",
base = "1.1.68",
betterCargoPlanes = "1.3.7",
bobassembly = "1.1.5",
bobelectronics = "1.1.5",
bobenemies = "1.1.5",
bobequipment = "1.1.5",
bobinserters = "1.1.5",
boblibrary = "1.1.5",
boblogistics = "1.1.5",
bobmining = "1.1.3",
bobmodules = "1.1.5",
bobores = "1.1.5",
bobplates = "1.1.5",
bobpower = "1.1.5",
bobrevamp = "1.1.5",
bobtech = "1.1.5",
bobvehicleequipment = "1.1.5",
bobwarfare = "1.1.5",
["bullet-trails"] = "0.6.2",
["cargo-ships"] = "0.1.18",
["cargo-ships-graphics"] = "0.1.0",
clock = "1.1.0",
["color-coding"] = "1.19.0",
["creative-mod"] = "1.8.0",
["even-distribution"] = "1.0.10",
flib = "0.10.1",
helmod = "0.12.12",
informatron = "0.2.3",
["manual-inventory-sort"] = "2.2.5",
miniloader = "1.15.6",
["nixie-tubes"] = "1.1.3",
railloader = "1.1.6",
["reskins-angels"] = "2.1.4",
["reskins-bobs"] = "2.1.4",
["reskins-compatibility"] = "2.1.4",
["reskins-library"] = "2.1.3",
simhelper = "1.1.4",
["space-exploration-menu-simulations"] = "0.6.8",
["spawn-belt"] = "1.0.12",
textplates = "0.6.9"

1 year, 8 months ago
(updated 1 year, 8 months ago)

Thanks for the detailed log !

Unfortunately, this does not seem linked to Fill4Me, and I can't see anything I can fix in the mod to prevent the issue.

Summary

Although the stack trace says this is due to Fill4Me, the issue seems to be in Sea Block instead, which causes a crash in a lib of Factorio itself, that Fill4Me calls. Nothing I can do in Fill4Me, as the code that crashes is not part of the mod but part of the base game.

I'll report this to factorio devs to see if the core code has issues, but I suspect this is likely due to the heavy modifications Sea Block does to basic game entities.

You should report the issue to Sea Block instead.

The tech details

Sea Block modifies the coal entity to remove its products field, which causes a crash in a core Factorio function that Fill4Me calls (get_raw_resources).

I couldn't find the code in Sea Block that does the change, but I confirmed this by testing with and without the SeaBlock mod itself enabled: the crash happens only when SeaBlock is enabled.

Confirmed that coal is missing the field required by get_raw_resources with this code snippet:

-- control.lua
function oninit()
  local entities = game.entity_prototypes
  for name, entity_prototype in pairs (entities) do
    if entity_prototype.resource_category then
      if entity_prototype.mineable_properties then
        if not entity_prototype.mineable_properties.products then
          log("nil products: " .. entity_prototype.name)
        end
      end
    end
  end
end

script.on_init(oninit)

This is either an issue in Sea Block that modifies the entity in a non-supported way, or a bug in get_raw_resources that relies on an optional field.

1 year, 8 months ago

Reported the issue in the core function here: https://forums.factorio.com/viewtopic.php?f=7&t=103289&p=572787#p572787

1 year, 8 months ago

This has been fixed by Factorio devs in 1.1.69: update the game to fix the issue.

New response