Safer Asteroids

by Kryzeth

Reduces the maximum size of dangerous asteroids from spawning in planetary orbits, keeping Space Platforms safe. Maximum asteroid size can be modified on a per-planet basis. Compatible with Any Planet Start, Cupric Asteroids, More Asteroids, and Asteroid Frequency Multiplier.

Tweaks
22 days ago
2.0
3.10K

b [Fixed] 1.2.0-1.2.1 crash

25 days ago

Greets, crash on load:

Failed to load mods: __kry_safe_planets__/prototypes/tiers-compat.lua:24: 
terrapalus: 3.33333
{
  {
    angle_when_stopped = 1,
    asteroid = "metallic-asteroid-chunk",
    probability = 0.0012,
    speed = 0.016666666666666665,
    type = "asteroid-chunk"
  },
  {
    angle_when_stopped = 1,
    asteroid = "carbonic-asteroid-chunk",
    probability = 0.003,
    speed = 0.016666666666666665,
    type = "asteroid-chunk"
  },
  {
    angle_when_stopped = 1,
    asteroid = "oxide-asteroid-chunk",
    probability = 0.0006,
    speed = 0.016666666666666665,
    type = "asteroid-chunk"
  },
  {
    angle_when_stopped = 0.6,
    asteroid = "medium-metallic-asteroid",
    probability = 0.001,
    speed = 0.016666666666666665
  },
  {
    angle_when_stopped = 0.6,
    asteroid = "medium-carbonic-asteroid",
    probability = 0.0025,
    speed = 0.016666666666666665
  },
  {
    angle_when_stopped = 0.6,
    asteroid = "medium-oxide-asteroid",
    probability = 0.0005,
    speed = 0.016666666666666665
  }
}
stack traceback:
    [C]: in function 'error'
    __kry_safe_planets__/prototypes/tiers-compat.lua:24: in main chunk
    [C]: in function 'require'
    __kry_safe_planets__/data-final-fixes.lua:4: in main chunk

Based on the error message it gives, this seems like something you want reported to you. :-)

for planet_name, planet_data in pairs(data.raw.planet) do
    local planet_tier = override_tier[planet_name] or data.raw["mod-data"]["PlanetsLib-tierlist"].data["planet"][planet_name] or data.raw["mod-data"]["PlanetsLib-tierlist"].data.default
    if planet_tier == 3.33333 or planet_tier == -1 then
        error("\n"..planet_name..": "..planet_tier.."\n"..serpent.block(planet_data.asteroid_spawn_definitions))
    end
...
25 days ago
(updated 25 days ago)

I forgot I left that piece of debug code in there, that was mostly for me to check all the planets that didn't have a defined tier, so I could add them into the override table. Replaced the error line with a harmless log instead, since it shouldn't prevent the game from loading just because a planet tier wasn't defined (there's a built-in default in PlanetsLibTiers for a reason)

Thanks for the catch, should be fixed in v1.2.2

25 days ago

Awesome! You're so fast. :-)

New response