Fulgurite Synthesis


Revamps holmium ore production utilizing lightning. Make Fulgurite Conductor Rods and harvest artifical fulgurites generated by lightning storms

Content
4 months ago
2.0
76
Manufacturing

b [Critical] Error on loading savegame

a month ago

Love the mod, but currently there's a pretty serious issue where it throws an error after loading an existing save.
The below error happens when loading a save with fulgurite conductor rods, and also when loading a save that has had the mod enabled and then placing a fulgurite conductor rod.

The mod Fulgurite Synthesis (0.0.1) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event fulgurite_synthesis::on_tick (ID 0)
__fulgurite_synthesis__/control.lua:50: attempt to index global 'previous_energy' (a nil value)
stack traceback:
    __fulgurite_synthesis__/control.lua:50: in function <__fulgurite_synthesis__/control.lua:43>
13 days ago

-- A control.lua fájlban, az inicializáló funkcióban (pl. on_init vagy on_load)
-- Különösen fontos ez, ha egy mentésből próbálja betölteni a modot.

function setup_globals()
if global.previous_energy == nil then
-- A mod írójának itt kellene beállítania a previous_energy változót,
-- például egy üres táblázatra vagy objektumra, ami a 'nil' hibát megelőzi.
global.previous_energy = {}

-- Vagy ha a mod energiaadatokat ment a játékosokhoz, akkor:
-- for _, player in pairs(game.players) do
--     global.previous_energy[player.name] = 0
-- end

end
end

-- Ezt a setup_globals() hívást be kell illeszteni az on_init, on_load
-- és on_configuration_changed függvényekbe.

New response