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.