I posted the updated mod "The Ruins Mod" as a fork The Ruins Mod Updated (Time fork) https://mods.factorio.com/mod/Abandoned ... dated_fork
And I had a small but difficult problem for me.
The gist of it is that for a number of reasons I separated all the ruins from this mod into another submod. And now when I launch this mod without content and submods, an error appears:
Code: Select all
The mod The Ruins Mod Updated (Fork) (1.1.7) caused a non-recoverable error.
Please report this error to the mod author.
Error while running event AbandonedRuins_updated_fork::on_tick (ID 0)
AbandonedRuins_updated_fork/spawning.lua:185: bad argument #1 of 1 to 'random' (interval is empty)
stack traceback:
[C]: in function 'random'
AbandonedRuins_updated_fork/spawning.lua:185: in function 'spawn_random_ruin'
AbandonedRuins_updated_fork/control.lua:58: in function <AbandonedRuins_updated_fork/control.lua:53>
Code: Select all
spawning.spawn_random_ruin = function(ruins, half_size, center, surface)
--spawn a random ruin from the list
spawning.spawn_ruin(ruins[math.random(#ruins)], half_size, center, surface)
end
I know roughly that I need to write a condition in this script so that it launches if there are ruins files, but I have no idea how to write it....
I can make a hack in the form of empty ruins files. But this is not the best solution...
I will be glad to any help! Thank you!