Pyanodons Coal Processing


Extends and overhauls Factorio's burner phase. Use realistic oil and coal processes to create advanced products. Functions as the core and library for the rest of the pY mods.

Overhaul
15 days ago
1.1
55.3K
Mining Fluids Manufacturing

b Clicking wiki button crashes (1.8.0)

3 years ago

The mod Pyanodons Coal Processing (1.8.0) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event pycoalprocessing::on_gui_click (ID 1)
pycoalprocessing/scripts/wiki.lua:161: attempt to compare number with string
stack traceback:
pycoalprocessing/scripts/wiki.lua:161: in function 'handler'
stdlib/stdlib/event/event.lua:335: in function 'pcall'
stdlib/stdlib/event/event.lua:355: in function 'dispatch_event'
stdlib/stdlib/event/event.lua:438: in function <stdlib/stdlib/event/event.lua:389>

I also made an issue in github with a patch https://github.com/pyanodon/pycoalprocessing/issues/71

3 years ago

I'm not getting that error. Could you send in a save.

3 years ago

Fresh save, literally generated a map and that is it.

3 years ago

Weird ok. Ill take another stab at it see what I can sort out.

3 years ago

I disabled a big chunk of mods (mostly qol) and now it seems to work. The patch I posted on github did fix it even with the other mods though. I'll look around to see which mod causes this

3 years ago

Seems like https://mods.factorio.com/mod/PowerPlusPowerMeter this mod is quilty for the incompability. Removing it removes the content:

"blackhole-fuel-power-meter-usage-combinator",
"power-meter-usage-combinator",
"power-meter-usage-combinator-pyvoid",
"void-energy-pyvoid-fluid"

I can definitely live without that mod. The patch on github and how it fixes the problem do point towards a bug on PyCoals side but on the other hand the mod says that "the meter uses local hax to make the measurements"

3 years ago
(updated 3 years ago)

Yeah, it adds a new fluid with smaller than 1000 fluid value to the game: https://github.com/daydev/FactorioPowerPlus/blob/master/Power%20Meter/prototypes/fluid.lua
This causes the comparison part to enter the elseif and crash.

3 years ago
(updated 3 years ago)

There is a logical problem too, the insides of elseif can't never be reached since it will always hit the first one. If there is a fluid that is under the "1000" fuel_value limit, it will go to the elseif part and then fail.

I modded the data.lua and changed:
data.raw.fluid["heavy-oil"].fuel_value = "0.1KJ" -> crash
data.raw.fluid["heavy-oil"].fuel_value = "1000MJ" -> Works but 10000000KJ or something inside the wiki, not MJ like it should be.

I patched the scripts/wiki.lua like this so it also fixes the problem and formats the numbers correctly
if fluid_num < 1000 then
num = fluid_num .. "J"
elseif fluid_num >= 1000 and fluid_num < 100000 then
num = fluid_num/1000 .. 'KJ'
else
num = fluid_num/1000000 .. 'MJ'
end