Resource Spawner Overhaul

by orzelek

Makes resources more sparse than base game. You will need to use trains much earlier to get resources. Game will be more difficult especially with higher enemy settings.

Tweaks
16 days ago
0.14 - 2.0
146K
Environment

b Error with miniMAXIme

15 days ago

Following error with Space Age and miniMAXIme active.

The mod miniMAXIme: Character scaler and selector (2.0.14) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event minime::on_init()
The mod Resource Spawner Overhaul (7.0.10) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event rso-mod::on_surface_created (ID 67)
__rso-mod__/control.lua:1061: attempt to index field '?' (a nil value)
stack traceback:
    __rso-mod__/control.lua:1061: in function 'spawn_starting_resources'
    __rso-mod__/control.lua:2025: in function <__rso-mod__/control.lua:2013>
stack traceback:
    [C]: in function 'create_surface'
    __minime__/scripts/surfaces.lua:128: in function 'create_surface'
    __minime__/control.lua:274: in function 'init'
    __minime__/control.lua:382: in function <__minime__/control.lua:378>
15 days ago

The author of miniMAXIme claims the fix is on him.

15 days ago

The author of miniMAXIme (I) has just uploaded a new version that works around the crash by blacklisting new surfaces with your mod just before they are created. However, mods creating surfaces without blacklisting them may still crash because you try to access uninitialized tables. Here's a diff for your control.lua:

--- control.lua 2024-12-02 18:24:26.000000000 +0100
+++ control_new.lua 2025-03-13 14:29:58.062815530 +0100
@@ -1058,10 +1058,16 @@

  local surfaceData = storage.surfaces[surface.index]
  debug("Starting area spawn for "..surface.name)
-   if surfaceData.startingAreas[index].spawned then return end
+  if surfaceData and
+      surfaceData.startingAreas and
+      surfaceData.startingAreas[index] and
+      surfaceData.startingAreas[index].spawned then
+    return
+  end

  -- skip spawning if starting area is to small or starting areas are disabled
  if storage.disableStartingArea or surfaceData.starting_area_size < 0.1 then
+    surfaceData.startingAreas[index] = surfaceData.startingAreas[index] or {}
    surfaceData.startingAreas[index].spawned = true
    return
  end

With these changes, I've got my mod running even without blacklisting the surfaces.

New response