The Ruins Mod 2.0 deprecated


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

Content
a year ago
2.0
3.32K
Environment

b You broke remote interface with assertions

a year ago
(updated a year 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 year ago
(updated a year 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 year 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 year ago

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

a year ago
(updated a year 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 year 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 year ago
(updated a year 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 year ago
(updated a year 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 year ago

BTW: you renamed spawn_table to spawn_changes instead of spawn_chances.

a year 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