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
6 days ago
2.0
4.50K

b [FIXED] spawning.lua:408: size='small' is not found in spawn_chances table

28 days ago

The mod Abandoned Ruins - Updated (1.3.15) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event AbandonedRuins_updated_fork::on_chunk_generated (ID 15)
AbandonedRuins_updated_fork/lua/spawning.lua:408: size='small' is not found in spawn_chances table
stack traceback:
[C]: in function 'error'
AbandonedRuins_updated_fork/lua/spawning.lua:408: in function 'get_spawn_chance'
AbandonedRuins_updated_fork/control.lua:159: in function <AbandonedRuins_updated_fork/control.lua:136>

28 days ago

Sorry, I cannot reproduce that error with so low information here. Have you any other ruin-set mods installed? Or just this mod?

28 days ago

And please follow the note above this forum:

Before you report bugs, improvements or feature-wishes then please read the FAQ section first. There are instructions on how you properly report bugs which will improve the likelihood that your reported bug gets fixed quicker.

FAQs are here:
https://mods.factorio.com/mod/AbandonedRuins_updated_fork/faq

28 days ago
(updated 28 days ago)

I'm now slowly understanding what is going wrong here. The "library" spawning is a local variable and will be returned to each (!) require("spawning") uninitialized all over again. This is however done in control.lua and only there. So somehow the data in spawning "object" is getting deleted?

No, it is working here. I have just created a new enemy-less world, enabled debug log and spawns are reported being spawned once I started walking to the edge of visible map.

You must have some weird state there that I cannot reproduce here. Please provide debug log and relevant mods (ruin-sets). Also with ruin-set have you chosen in mod settings?

27 days ago
(updated 27 days ago)

Hello there! I ran into the same issue. I had the Ruin set to FortressRuins. Changing too OldAbandonedSettlements fixed the issue at least for now I only played about 5 minutes so far.

Ruins mods installed:
- base
- updated
- fortress ruins
- old abandoned settlements

--edit, never-mind switching did not work. just fixed it temporarily once i saved, then loaded that save the error came back.

27 days ago
(updated 27 days ago)

I went ahead and through some temporary code in to get mine working. just call the inti function again in spawning.lua if the spawn_chances is nil. . wouldn't recommend as a permenant fix as it's kinda messy and would be better to find out why its showing up nil in the first place. but if anyone needs it to get their game going. Just call the init if it finds it nil in spawning.lua

--- Returns spawning chance for given size

spawning.get_spawn_chance = function(size)
  if debug_log then log(string.format("[get_spawn_chance]: size[]='%s' - CALLED!", type(size))) end
  if type(size) ~= "string" then
    error(string.format("size[]='%s' is not expected type 'string'", type(size)))
  elseif spawning.spawn_chances[size] == nil then
    spawning.init()
    if spawning.spawn_chances[size] == nil then 
      error(string.format("size='%s' is not found in spawn_chances table", size))
    end
  end

  if debug_log then log(string.format("[get_spawn_chance]: spawning.spawn_chances[%s]=%.2f - EXIT!", size, spawning.spawn_chances[size])) end
  return spawning.spawn_chances[size]
end
27 days ago
(updated 27 days ago)

I don't see it as a good idea to make the code more messy only because of an other mod isn't well written.

  1. It uses deprecated add_ruin_set() which will be anytime removed in favor of add_ruin_sets().
  2. It excludes all ruin-sets from all Space-Age planets, so no ruins whatsoever are being spawned on such planets. That feature is intended for excluding "internal"/hidden surfaces such as from NiceFill mod, not all ruins from all mods being banned from planets.

For the last one I can add a feature later. Have to follow an appointment now. I'm back and I also noticed that his mod is referencing to a far outdated version 1.2.0. So which version do you @cjstorrs have installed?

I can now add that said feature, so the remote-call to function exclude_face() is not abused. So in other words: If you install OldAbandonedSettlements no ruin will spawn whatsoever on any Space-Age planet. That's not how this feature was intended.

27 days ago

I soon add a per-ruin key no_spawning which allows individual ruins to not be spawned on given surface(s). The mod AbandonedRuins-base will include soon some documentation about that feature and also it's ruins with water will be excluded from Fulgora (and I guess other SA planet, too?).

27 days ago

The key is now added with 1.3.17 release. Also a remote-call function no_spawning_on() is added.

26 days ago

Now, after some flawless playing, I get this error message, too:

27422.598 Error MainLoop.cpp:1510: Exception at tick 439930741: The mod Abandoned Ruins - Updated (1.3.17) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event AbandonedRuins_updated_fork::on_chunk_generated (ID 15)
__AbandonedRuins_updated_fork__/lua/spawning.lua:426: size='small' is not found in spawn_chances table
stack traceback:
        [C]: in function 'error'
        __AbandonedRuins_updated_fork__/lua/spawning.lua:426: in function 'get_spawn_chance'
        __AbandonedRuins_updated_fork__/control.lua:161: in function <__AbandonedRuins_updated_fork__/control.lua:138>
26 days ago
(updated 26 days ago)

The crash is happening on load because Roland removed spawn_chances from storage but hasn't added spawning.init() neither to script.on_load nor on file level.
This results in spawning.spawn_chances = {} when loading a save without script.on_configuration_changed triggering.

26 days ago

Oh, I have not thought about this. I'll give it a try. I find it better to have more tables being removed from storage to decrease size of save-game file.

26 days ago

1.3.18 is out now which should have addressed the issue. I walked into unknown territory (unrevealed map) and ruins of any size got spawned.

This thread has been locked.