The Ruins Mod 2.0 deprecated


This mod is now deprecated and merged with `AbandonedRuins_updated_fork`.

Content
a month ago
2.0
3.15K
Environment

b You broke remote interface with assertions

a month ago
(updated a month ago)

exclude_surface()
reinclude_surface()
add_ruin_set()
get_ruin_set()

The checks you added to them are all invalid. Making it practically impossible to modify surface exclusions and to modify existing ruin sets.

a month ago
(updated a month ago)

Hmm, I'm wondering why it is failing? assert() should not fail when true is returned from the test.

Exmaple:

    assert(not storage.excluded_surfaces[name],
      string.format("Surface '%s' is already added as excluded surface.", name)
    )

Here I want to check if name is not found in storage.excluded_surfaces, otherwise it will output that message.

a month ago

This mod is soon deprecated. As you can see in the other discussion, it will be merged together with AbandonedRuins_updated_fork mod.

a month ago

For now, please downgrade back to 1.2.11 . Sorry for the trouble!

a month ago
(updated a month ago)

I'm saying that adding those assertions was wrong in first place.

For surface exclusion it doesn't matter what current exclusion status is, furthermore it is currently impossible to read exclusions table through remote interface.

For get_ruin_set() it needs to be able to return nil because that's how you check if entry exists.

For add_ruin_set() it needs to be able to overwrite existing sets. (you could modify an existing set by first getting a copy of it, then modifying the copy, then finally adding the copy back with same name)

a month ago

For excluded_surfaces related functions I have removed the checks, now only name is tested if it is a string.

For get_ruin_set() I removed that check as well, only type(name) == "string" remains. BTW: one equal or two? I get confused here with assignment (always one) and equal boolean check (can be both?!).

For add_ruin_set() I wonder what the original assert(small_ruins and next(small_ruins)) did?

a month ago
(updated a month ago)

I'm currently in the process of rewriting spawn_chances() , the static "small", "medium" and "large" are a bit limiting and it can be better done in a loop rather than static code.

But now I have to leave for private matter. Until later! I can later add remote functions like add_ruin_size(size) and get_ruin_sizes() if that is needed.

a month ago
(updated a month ago)

== is equality check.
= is assignment.

assert(small_ruins and next(small_ruins)) means: does the table exists? if yes: does it have at least 1 entry? (is not empty)

a month ago

BTW: you renamed spawn_table to spawn_changes instead of spawn_chances.

a month ago

BTW: you renamed spawn_table to spawn_changes instead of spawn_chances.

Yes, I noticed the typo already. Thank you for your help.

New response