Simple Asteroid Respawn Redux
An update to Laserzwei’s Simple Asteroid Respawn mod.. As with the original mod, this mod’s purpose is to slowly respawn (create new) resource asteroids over time within the sector even with the player/player assets present.
(I also uploaded a new version of the Notifier mod, Simple Asteroid Respawn Redux Notifier.)
I made this mod for two reasons. 1) Because of the number of complaints on the old mod that it wasn’t working (even though in all of my tests it did), and 2) because that mod overwrote the vanilla respawning mechanic as well.
- Every 15 minutes, it will check a sector to see if the number of resource asteroids within it is below what the sector started with and, if that is the case, it will respawn up to a maximum of 5% of this total count. (The old mod was 30 mins / 10%, but in code, Laserzwei halved everything. I removed the halving and just set the config file for these values instead.) At least 1 asteroid of any type must still be present to give the code a location to spawn asteroids from.
- It keeps in place the old vanilla functionality that will respawn all asteroids when the player (and all of their assets) have left the sector for at least 30 mins. Note that this respawn is based on the ratio of resource asteroids to all asteroids. If you mine out plain asteroids, this function will return less resource ones. It also requires at least 1 asteroid of any type to still be present to give the code a location to spawn asteroids from.
- It does not heal/repair damaged asteroids. If you mine out part of an asteroid and leave the rest, it will remain as you left it. This includes hidden resource asteroids. It’ll count as still being there until you mine all of it.
- It does not replace asteroids with the same type as what was mined. The replacement is random for what is appropriate to the region and will never be a hidden resource asteroid.
- It does not spawn replacement asteroids in the same exact spots as the ones you mined. For each asteroid it respawns, it’ll choose a random existing asteroid to use as a focal point on where to respawn.
- It will not allow your miners to work continuously/nonstop. This is merely meant as a way to keep resource asteroids respawning without you having to clear yourself out of the sector (ie, a sector with a player station can respawn now).
- It will not respawn asteroids in all sectors that have resource asteroids. Some sectors simply never attach the respawn script. This mod does nothing to change that. You could use Laserzwei’s Respawn asteroids everywhere, but I have not tested this! Use at your own risk.
Please check the following:
- Check that the mod is actually downloaded and enabled (Subscribe to it here, then in game at the main menu, go to Settings -> Mods and find and enable the mod)
- If adding this to an existing galaxy:
- When first adding it, before actually loading your game, you have to find that little, hard to see check box that says "Override Galaxy’s Mods" and check it. If you don’t, it won’t load it!
- Existing sectors will not get the updated script unless you either a) delete the sector file from the saved galaxy folder, b) use debug mode to remove and re-add the respawnresourceasteroids.lua script, or c) wait for whatever ungodly time period is needed for the game to trigger a full sector regen of sectors that you haven’t been to in forever.
- Use this mod (Simple Asteroid Respawn Redux Notifier) to check the status of the sector you are in. You should get a diamonds icon top center (just under the velocity bar). If they’re white, then testing shows it should be working as expected. Red means asteroids do not respawn here. Orange means that there is a respawn script active, but that it’s not one provided by this mod. Yellow, you should never see yellow, but it means the respawn script is from this mod, but is out of date. (Yes, that means I’ve actually coded this mod so that it can update its own script.)
- If the diamonds are white, but you still believe it’s not working, go into this mod’s config file (Steamsteamappsworkshopcontent4452202548240290dataconfigSimpleAsteroidRespawnRedux.lua) and set the debug option to true. Now check your server log. Look for entries starting with "Simple_Asteroid_Respawn_Redux (sector_x:sector_y):". Any that show "Exiting" will give a reason why it did not respawn at this time. If you see "Generation complete. Spawning # asteroids.", then its done what it’s supposed to.
This mod will conflict with any other mod that touches the respawnresourceasteroids.lua file, including Laserzwei’s Simple Asteroid Respawn mod. Do not use this mod with those mods.
Feel free to leave your feedback.