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

g Detailed Changes Info

a month ago
(updated a month ago)

I would like a detailed list of changes, why they were changed and what it means for people who have exsisting ruins packs so that I can figure out how to fix compatibility. I would like examples of the new implementation and detailed annotations please. I now nonlonger know how to load multiple ruin sets or combine ruin sets into my ruin set as the following now returns nil local base_ruins = remote.call("AbandonedRuins", "get_ruin_set", "base")

a month ago

I have downloaded version 1.2.0 and may use it as a new fork of the ruins mod as it seems to me there is no way to load multiple ruins packs and have all of them spawn

a month ago
(updated a month ago)

If you are running without https://mods.factorio.com/mod/AbandonedRuins-base
you need to make the ruin set structure yourself
{["small"] = {}, ["medium"] = {}, ["large"] = {}}

a month ago
(updated a month ago)

I want a solution that allows for multiple ruins to be loaded it worked fine prior to merge, I have a version of my ruins that works with the new merged version but it will only load the ruins from that ruin set and I see no way to include base

a month ago

If it is this mod: https://mods.factorio.com/mod/FortressRuins : I can try to fix what broke it.

a month ago
(updated a month ago)

I have 2 ruins packs https://mods.factorio.com/mod/OldAbandonedSettlements and https://mods.factorio.com/mod/FortressRuins I would like to be able to load base ruins and both ruin packs all at the same time

a month ago
(updated a month ago)

Setting AbandonedRuins-set was renamed to current-ruin-set
your Fortress mod seems to work fine and include base ruins, when above is applied and Base ruin set mod is present

a month ago

Roland, you renamed AbandonedRuins-set as I stated above but in locale you renamed it to default-ruin-set

a month ago
(updated a month ago)

Oldabandonedsettlements errors when I enter into a game stating local base_ruins = remote.call("AbandonedRuins", "get_ruin_set", "base") is nil

a month ago
(updated a month ago)

38.263 Checksum for script OldAbandonedSettlements/control.lua: 2212607923
38.352 Error AppManagerStates.cpp:1662: The mod The Ruins Mod - OldAbandonedSettlements (1.0.2) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event OldAbandonedSettlements::on_load()
OldAbandonedSettlements/control.lua:216: attempt to index local 'base_ruins' (a nil value)

This prior to merger returned the base ruins and I was able to update the table
stack traceback:
OldAbandonedSettlements/control.lua:216: in function <OldAbandonedSettlements/control.lua:208>

a month ago

I'm in the middle of testing my fix now.

a month ago

Just do this and it's fixed
local base_ruins = remote.call("AbandonedRuins", "get_ruin_set", "base") or {["small"] = {}, ["medium"] = {}, ["large"] = {}}

a month ago

or section will make the required table structure if get_ruin_set returns nil

a month ago
(updated a month ago)

This will create empty tables and not return the base ruins, I need the populated table that the base ruins creates

a month ago
(updated a month ago)

Ah, what I was needing is this error message:

   2.705 Error ModManager.cpp:1758: Failed to load mod "FortressRuins": __FortressRuins__/settings.lua:1: attempt to index field 'AbandonedRuins-set' (a nil value)
stack traceback:
        __FortressRuins__/settings.lua:1: in main chunk

Then when I check the file settings.lua:
You have to change AbandonedRuins-set to current-ruin-set. And it looks a bit weird that your mod does this in settings.lua. What I better can do is that I provide a remote-call function so you don't have to worry about the correct configuration key.

I just added this remote-call function in version 1.3.2:

  -- Registers ruin-set name as choosable option and optionally set it as default
  ---@param name string
  ---@param is_default boolean
  register_ruin_set = function(name, is_default = false)

So all what you have to do is this:
remote.call("AbandonedRuins", "register_ruin_set", "FortressRuins", true)

You probably want to execute this from your control.lua file and not settigns.lua. For example make a local function which you register on two events:

local function make_ruin_set()
    remote.call("AbandonedRuins", "register_ruin_set", "FortressRuins", true)
    -- DO MORE STUFF HERE
end

script.on_init(make_ruin_set)
script.on_configuration_changed(make_ruin_set)
a month ago

I dont think you understand the problem, Prior to the merge I could get the table of base ruins and insert the result into my new table and when either fortress ruins or oldabandoned settlements were chosen it would load all the ruins as I created one big table containing base ruins and my ruins

a month ago

I will fork the mod and use the old system

a month ago

@ Sacredanarchy Do you need "base" ruin-sets being loaded first? Then please change the dependency from AbandonedRuins_updated_fork to AbandonedRuins-base. It will then continue requiring the first one to load. I hope this fixes the problem for you.

a month ago

This is pointless. If you have changed your mind. Please come back.

a month ago
(updated a month ago)

Sorry to butt in. As far as I understand, with the new changes it is now possible to load only one set of ruins?

@ roland77, please clarify this point! It is important that users can launch ruin sets of their own choosing - all together, or selectively. Both with and without the basic ruins set.

If you need to undo any changes to keep this feature, it is better to do so.

a month ago
(updated a month ago)

I have created a fork of base and a fork of the ruins mod from the older versions and im about to upload them with it being able to load multiple ruins all at once removing features is a bad idea!

a month ago

I have tried Sacredanarchy's mods after making 2 trivial changes (mentioned above) in them. Got sum of 3 sets spawning (his 2 and base).

a month ago

@ Sacredanarchy and @Silly_Warlock I apologize for the current situation. By merging our two forks with @roland77 I did not intend to create problems for everyone.

On the contrary - I wanted to avoid a situation where users and mod developers would be forced to choose between several sets of ruins based on the same, but incompatible with each other platforms.

I kindly ask you not to rush things, to show a little patience and still try to find a common language with @roland77.

Thank you!

a month ago

I am testing the changes Silly suggested as I did not realise it would load all ruins because on first glance it was using empty ruins tables

a month ago

It is working! I still think detailed information on what changes were made the effects of the changes and why changes were made would have avoided confusion @Silly thankyou for the solution sorry I did not realise the empty tables would work, I still am confused as to why they work, I will need to take time to fully understand the changes made.

a month ago

Empty tables are used only when base ruin set doesn't exist. (which should only be caused by 'Abandoned Ruins - Base Set' not being enabled)

a month ago

I think I understand, the pre merged version was creating a base set even if base ruins was not enabled so I was able to just retrieve the base set regardless, now it does not create the base set unless base set is enabled which caused the error

a month ago

@ Sacredanarchy please answer - is the situation resolved?

a month ago

yes have updated the mods and the solution Silly_Warlock suggested worked great thank you!

a month ago

Okay. Then I'll close the topic.

This thread has been locked.