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 [WONT-FIX] Non recoverable error

8 days ago

Please see: "https://mods.factorio.com/mod/FortressRuins/discussion/68ab47c0fefa2b0bee0099b4" in reference to:
"The mod The Ruins Mod - Fortress Ruins (1.1.0) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event FortressRuins::on_init()
No such function: AbandonedRuins.add_ruin_set
stack traceback:
[C]: in function 'call'
FortressRuins/control.lua:299: in function <FortressRuins/control.lua:237>"

8 days ago
(updated 8 days ago)

The function this backtrace mentioned is already deprecated for a very long time. I also contacted the author to please switch to proper method but he wasn't showing any sign of response. I also included a simple instruction in the forum over there but still no response.

Then I have removed this remote-call function. I cannot fix this from here.

8 days ago

Here is a commit mentioning its deprecation:

commit b2c836e3c18c7a6497e3758f0c5bc966725ce1d7
Author: Roland Häder <roland@mxchange.org>
Date:   Sat Jul 26 07:26:19 2025 +0200

    Continued:
    - `add_ruin_set()` is deprecated, so let's remove that comment above it that
      this function should be used, while it should NOT be used by mod developers
    - log name on ruin-set to have some helpful information
7 days ago
(updated 7 days ago)

I mentioned later in the above-mentioned thread an issue that cropped up when trying to generate the Fortress Ruins set with the new 1.4.0 version of Abandoned Ruins core after I fixed the add_ruin_sets() mismatch, and this was the error generated right after I pressed tab to skip the freeplay cutscene:

Error while running event AbandonedRuins_updated_fork::on_nth_tick(10)
__AbandonedRuins_updated_fork__/lua/spawning.lua:385: bad argument #2 of 2 to 'table_size' (table expected, got nil)
stack traceback:
[C]: in function 'table_size'
__AbandonedRuins_updated_fork__/lua/spawning.lua:385: in function 'spawn_random_ruin'
__AbandonedRuins_updated_fork__/control.lua:84: in function <__AbandonedRuins_updated_fork__/control.lua:54>

Any ideas on how I could modify the control.lua of the current version of Fortress Ruins to work? I expect I might encounter some issues with other ruin sets that haven't been updated yet, such as Silly Abandoned Ruins which has its own unique crash that I've informed Warlock about already (something about ruin size generation categories? idk really), but a patchwork fix for Fortress Ruins could be nice if I could figure it out. I know something else changed in 1.4.0 to break Fortress Ruins' code, but I'm not well-versed enough in lua to truly comprehend what the code does.

7 days ago
(updated 7 days ago)

First, it is not easy for me to make a fix suggestion while your modifications are locally to you, only. What I mean is that the mod author should upload his code to some public GIT repository like CodeBerg, github, gitlab or others.

Then second, that mod is a mess from inside and it references other outdated mods, too. If you want to see a working (and playable) example, go to AbandonedRuins-base - https://mods.factorio.com/mod/AbandonedRuins-base - and you'll find an example on how you should invoke functions in this mod.

Then about your reported error, I will had some checks before table_size() is being invoked. So the error will happen a bit earlier than letting table_size() fail. There my code was a bit lacking sanity-checks (checks on parameters). And for the error itself, it looks like _ruin_sets[ruinset_name][queue_item.size] is nil here. That means that the last part queue_item.size is pointing to a non-existing table key. This could hint that queue.add_ruin() was invoked with an improper value of size.

So this means that try_ruin_spawn() is being given an improper size (not found in table spawning.ruin_sizes) and I need to check invoking functions, too.

EDIT: That's odd. try_ruin_spawn() is only invoked by a loop which already loops over spawning.ruin_sizes table.

7 days ago

So for now I'm guessing into the blue here.Can you please go to Settings -> Mod Settings and enable this mod's debug messages? Then please DO NOT paste it here in the forum as it is very long and then very hard to read here. Please put it into a public paste-bin like https://pub.microbin.eu is.

7 days ago

Ah, thankfully SacredAnarchy just updated both Fortress Ruins and Old Abandoned Settlements, and both are working now without any issues. Abandoned Ruins is probably one of my favorite mods :)

7 days ago

Thank you, that's good to hear. :-) I have pushed an update 1.4.1 that you might want to download. It contains some sanity-checks to make sure only valid parameters are being passed to my functions.

5 days ago

1.4.0 has introduced some changes related to exclusion of surfaces. 1.4.2 is now fixing those bugs.

This thread has been locked.