Abandoned Ruins - Updated (core)

by Keysivi

This mod doesn't do anything by itself. You need to install ruin-set mods or no ruin will be spawned. It then can spawn randomly choosen ruins in the world. These ruins are destroyed fragments of bases, forts, small oases, and more. (Now co-authored with roland77)

Content
5 days ago
2.0
4.50K

b Error:on_tick (ID 0)

6 months ago

Hello!
I installed the mod, on Fulgore I started to open the map (fog), and an error appeared.

Error while running event AbandonedRuins_updated_fork::on_tick (ID 0)
__AbandonedRuins_updated_fork__/expression_parsing.lua:62: attempt to call field '?' (a nil value)
stack traceback:
    __AbandonedRuins_updated_fork__/expression_parsing.lua:62: in function 'number'
    __AbandonedRuins_updated_fork__/spawning.lua:76: in function 'spawn_entity'
    __AbandonedRuins_updated_fork__/spawning.lua:95: in function 'spawn_entities'
    __AbandonedRuins_updated_fork__/spawning.lua:173: in function 'spawn_ruin'
    __AbandonedRuins_updated_fork__/spawning.lua:186: in function 'spawn_random_ruin'
    __AbandonedRuins_updated_fork__/control.lua:58: in function <__AbandonedRuins_updated_fork__/control.lua:53>
6 months ago

Hello! My apologies...

Unfortunately, this mod is too complicated for me. And I can't do anything about the problems that arise.

The only thing I can do is add a negative dependency on Space Age, so as not to upset anyone else.

I apologize again...

6 months ago

It's okay, I understand.
Thank you :)

6 months ago

Do you still have the save file by any chance? I'm looking into this issue, and having some trouble reproducing this error.

6 months ago
(updated 6 months ago)

On a hunch, I installed ruinsnova. This did reproduce your error. ruinsnova appears to be missing multiple required mods from it's dependencies. this is causing it to call for items and entities to be spawned that don't exist.

6 months ago

So saving is no longer necessary?
If you figure out what exactly is causing the error, will you be able to fix it, or are these changes too extensive?

6 months ago
(updated 6 months ago)

It is possible to fix the crash, and I've given Keysivi the code to handle the error without crashing.
I would still recommend not using ruinsnova until that mod author fixes their dependencies though, as the ruins from that submod are broken and largely missing without the proper dependencies.
Edit: looks like ruinsnova just updated. Try updating your mods and see if you still encounter the error.

6 months ago

I made the changes suggested by HarroldSaxon

But this is not a complete solution in any case... Because the problem needs to be solved specifically with the author of The Ruins Mod - ruinsnova.

Because fixing the crash will still not allow you to fully enjoy the game with this mod if it does not work correctly...

6 months ago

Regarding the ruinsnova mod… I’m investigating the crashing issue. It seems to often stem from interactions with terrain entities (grass, sand, dirt, etc.) and damaged building pieces (pipes, walls). The original Abandoned Ruins mod handles this by using complete entities, but setting their state to “dead”.

Furthermore, please confirm that large ruins are enabled correctly. I resolved an issue with them by modifying control.lua as follows:

local function make_ruin_set()
local base_ruins = remote.call("AbandonedRuins", "get_ruin_set", "base")
for , ruin in pairs(novaruins_small) do
table.insert(base_ruins.small, ruin)
end
for
, ruin in pairs(novaruins_medium) do
table.insert(base_ruins.medium, ruin)
end
table.insert(base_ruins.large, novaruins_large)

lua
to

local function make_ruin_set()
local base_ruins = remote.call("AbandonedRuins", "get_ruin_set", "base")
for , ruin in pairs(novaruins_small) do
table.insert(base_ruins.small, ruin)
end
for
, ruin in pairs(novaruins_medium) do
table.insert(base_ruins.medium, ruin)
end
for _, ruin in pairs(novaruins_large) do
table.insert(base_ruins.large, ruin)
end

6 months ago

I’m now certain the crashes are caused by the contents of the chests. After your latest update, chests from my mod no longer spawn anything; they are empty.

6 months ago

Got it. I'll make the changes today, but a little later...

Thanks!

6 months ago

Severeniys - i've made a fix to https://mods.factorio.com/mod/AbandonedRuins-base

Thanks again for pointing this out!

This thread has been locked.