Beacon Productivity and Quality for Space Age


Allows productivity and quality modules to be used in beacons. Very questionable balance.

Tweaks
9 months ago
2.0
3.26K
Manufacturing Cheats

i Fix for missing visualization of modules in beacon

8 months ago
(updated 5 months ago)

I saw your message in the description about how the prod and quality modules do not render on the beacon sprite. I figured this was fixable, so I fixed it. My suggested colors are pulled from the game icons, but feel free to tweak them if you think they don't quite match.

I also would recommend removing the dependency on Space Age, as none of the changes depend on it. I would also recommend changing the dependency on Quality to optional as well, as it only takes minimal code changes.

My suggested changes are below (I'd be happy to make a pull request if you were to set this up as a Git repo):

diff --git a/info.json b/info.json
@@ -7,7 +7,6 @@
   "contact": "izuna.ninja",
   "description": "Allows productivity and quality modules to be used beacons. Very questionable balance.",
   "dependencies": ["base >= 2.0",
-  "? space-age",
-  "quality"]
+  "? quality"]
 }
diff --git a/data-final-fixes.lua b/data-final-fixes.lua
@@ -1,3 +1,28 @@
-for k, v in pairs(data.raw["beacon"]) do
-  v.allowed_effects = {"consumption","speed","pollution","productivity","quality"}
+for _, prototype in pairs(data.raw["beacon"]) do
+   table.insert(prototype.allowed_effects, "productivity")
+   if mods["quality"] then
+       table.insert(prototype.allowed_effects, "quality")
+   end
+end
+
+for name, prototype in pairs(data.raw["module"]) do
+  if util.string_starts_with(name, "productivity-module") then
+    prototype.art_style = "vanilla"
+    prototype.beacon_tint = {
+      primary = {0.937, 0.525, 0.396},
+      secondary = {1.0, 0.873, 0.353},
+    }
+    prototype.requires_beacon_alt_mode = false
+  end
+  if util.string_starts_with(name, "quality-module") then
+    prototype.art_style = "vanilla"
+    prototype.beacon_tint = {
+      primary = {0.933, 0.933, 0.906},
+      secondary = {1.0, 0.812, 0.722},
+    }
+    prototype.requires_beacon_alt_mode = false
+  end
 end
5 months ago

My change can be easily integrated, too. Replace the "static" v.allowed_affectswith:table.insert(beacon, "productivity")`. Then you only add a new value to it instead of replacing existing values.

5 months ago
(updated 5 months ago)

Please replace [code] and [/code] with 3 back-ticks, then your code is shown properly. And your mod excludes other mods that add more module tiers, like MK4/5/6.

5 months ago

Please replace [code] and [/code] with 3 back-ticks, then your code is shown properly.

Thanks, edited.

My change can be easily integrated, too. Replace the "static" v.allowed_affectswith:table.insert(beacon, "productivity")`. Then you only add a new value to it instead of replacing existing values.
And your mod excludes other mods that add more module tiers, like MK4/5/6.

Both good ideas. I added the first to my suggested code, and switched the filtering of modules to do a string starts_with search instead of hardcoding the vanilla modules.

5 months ago

Top! Thank you.

5 months ago
(updated 5 months ago)

Can you please rename k to _? The _ means that LUA should "trash" it (forget its value).

5 months ago

The _ means that LUA should "trash" it (forget its value).

That is not actually true, it is simply a convention. But it is a valid convention, so I have done so.

5 months ago

The _ means that LUA should "trash" it (forget its value).

That is not actually true, it is simply a convention. But it is a valid convention, so I have done so.

Ah, thank you. I was not aware of it that it is just a convention.

5 months ago

Hmm, my fix isn't working?

5 months ago
(updated 5 months ago)

Ah, I missed to use the key allowed_effects. So v.allowed_effects is the correct one, not just v. EDIT: Only in my local files.

New response