Asteroid Frequency Multiplier

by Kryzeth

Scale up (or scale down) the frequency of asteroid spawn rate by a custom multiplier. Separate settings per asteroid size. Compatible with Any Planet Start, Cupric Asteroids, More Asteroids, and Safer Asteroids.

Tweaks
a month ago
2.0 - 2.1
3.85K
Factorio: Space Age Icon Space Age Mod

b [Fixed] Error on load

10 months ago

Upon updating the all planets pack, failing to load due to:

  39.201 Error ModManager.cpp:1765: Failed to load mod "kry-asteroids-mult": __kry-asteroids-mult__/data-final-fixes.lua:8: attempt to index field '?' (a nil value)
stack traceback:
        __kry-asteroids-mult__/data-final-fixes.lua:8: in function 'multiplyAsteroids'
        __kry-asteroids-mult__/data-final-fixes.lua:29: in main chunk

Which is this line of code:

local multiplier = settings.startup["kry-"..size.."-asteroid-mult"].value

Resetting the mod settings for this mod does not fix the issue.

Debugging into the scripts, the size is pulled from:

local size = string.match(asteroid.asteroid, "^(%a+)%-%a+%-asteroid$")

And the asteroid.asteroid at the time of the crash is:

"slp-plasmawave-asteroid

And so size is:

"slp"

So I think the size extraction should check against a list of allowed values. :-)

10 months ago
(updated 10 months ago)

Is that from the dyson sphere mod? I thought I had those locations blacklisted from the mod so they would never appear in the table... they're basically the only "asteroids" I have found that don't match the proper format, but it should be possible to add a lookup table for that, will have to wait for tomorrow unfortunately.

Thanks for the incredibly helpful bug report btw!

10 months ago

Is that from the dyson sphere mod?

Pretty sure that is it yeah.

I thought I had those locations blacklisted from the mod so they would never appear in the table... they're basically the only "asteroids" I have found that don't match the proper format, but it should be possible to add a lookup table for that, will have to wait for tomorrow unfortunately.

I didn't even notice such a table anywhere but I didn't look in depth at all... ^.^;

Thanks for the incredibly helpful bug report btw!

No problem, I try to give the reports that I myself would want to get. :-)

9 months ago
(updated 9 months ago)

I see where I got confused, I added failsafes against Dyson Sphere in Safer Asteroids, not in this mod. I forgot just how far I downsized this mod from its original bloated form, there's so little going on here lol. Using a lookup table for allowed sizes was a pretty genius suggestion, and a very simple addition, many thanks!

Implemented the fix in v1.1.2

New response