🌐Dea Dia System (ALPHA)


A group of planets still orbiting their dead star.

Content
5 months ago
2.0
22.0K
Factorio: Space Age Icon Space Age Mod
Planets Transportation Logistics Combat Armor Enemies Environment Mining Fluids Logistic network Manufacturing Power

g Crash when placing Air pump

10 months ago

Receiving this message when placing my first Air pump on Dea Dia:

The mod ○🌐Dea Dia System (ALPHA) (0.30.14) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event dea-dia-system::on_script_trigger_effect (ID 171)
LuaEntity API call when LuaEntity was invalid.
stack traceback:
[C]: in function 'index'
__dea-dia-system
/control/air-pump.lua:13: in function 'air_pump_handler'
dea-dia-system/control.lua:74: in function <dea-dia-system/control.lua:72>

10 months ago

Yup same full game crash, both when a bot puts it down and you place it manually.

The mod ○🌐Dea Dia System (ALPHA) (0.30.14) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event dea-dia-system::on_script_trigger_effect (ID 170)
LuaEntity API call when LuaEntity was invalid.
stack traceback:
[C]: in function 'index'
__dea-dia-system
/control/air-pump.lua:13: in function 'air_pump_handler'
dea-dia-system/control.lua:74: in function <dea-dia-system/control.lua:72>

10 months ago
(updated 10 months ago)

Made a quick fix, replace the file control.lua with this:

This does stress out the game thinking the entity was destroyed every time you put it down though heh

-- replace the air pump with the correct variant.
return function(event)
local source = event.source_entity
local surface = source.surface
local planet = surface.name
local target_name = planet .. "-planetary-air-pump"

if prototypes.entity[target_name] ~= nil then
    -- 1. Store all necessary information from the source entity first.
    local pos = source.position
    local dir = source.direction
    local a_force = source.force
    local qual = source.quality

    -- 2. NOW it is safe to destroy the source entity.
    source.die()

    -- 3. Create the new entity using the stored information.
    surface.create_entity{
        name = target_name,
        position = pos,
        direction = dir,
        force = a_force,
        quality = qual
    }
end

end

10 months ago

I just moved the "die" call to the end of the if.

10 months ago

Thanks for the quick fix! I'm enjoying the mod!

10 months ago

Sorry for the bad first fix. (:

New response