Hardcoded\Weird processing of 'normal' quality

Place to get help with not working mods / modding interface.
iMoonlight
Manual Inserter
Manual Inserter
Posts: 1
Joined: Wed Apr 23, 2025 2:20 pm
Contact:

Hardcoded\Weird processing of 'normal' quality

Post by iMoonlight »

I was tinkering with qualities and found that some items (inserters, drills, pumpjacks) processing their stat changes for 'normal' ('unknown' too?) quality in weird way.

Simple code to update all qualities with stats from 'legendary' quality
data-updates.lua

Code: Select all

local qualities_to_override = {"quality-unknown", "normal", "uncommon", "rare", "epic"}

local legendary = data.raw.quality["legendary"]
for _, qn in pairs(qualities_to_override) do
	local quality_copy = table.deepcopy(data.raw.quality[qn])

	quality_copy.level = legendary.level

	quality_copy.beacon_power_usage_multiplier = legendary.beacon_power_usage_multiplier
	quality_copy.science_pack_drain_multiplier = legendary.science_pack_drain_multiplier
	quality_copy.mining_drill_resource_drain_multiplier = legendary.mining_drill_resource_drain_multiplier

	data:extend {quality_copy}
end

Code: Select all

"dependencies": ["base >= 2.0", "quality >= 2.0"]
Loaded mods

Code: Select all

   0.679 Loading mod core 0.0.0 (data.lua)
   0.694 Loading mod base 2.0.43 (data.lua)
   0.838 Loading mod elevated-rails 2.0.43 (data.lua)
   0.864 Loading mod quality 2.0.43 (data.lua)
   0.880 Loading mod space-age 2.0.43 (data.lua)
   1.210 Loading mod base 2.0.43 (data-updates.lua)
   1.224 Loading mod quality 2.0.43 (data-updates.lua)
   1.243 Loading mod LegendaryQualityForAll 0.1.2 (data-updates.lua) - my mod
   1.251 Loading mod space-age 2.0.43 (data-updates.lua)
It works great for all qualities including 'normal' for most items
04-23-2025, 17-28-47.png
04-23-2025, 17-28-47.png (145.4 KiB) Viewed 151 times
04-23-2025, 17-29-25.png
04-23-2025, 17-29-25.png (104.47 KiB) Viewed 151 times
But for inserters it ignores quality level in calculations of rotation speed and consumption (health scaling works fine)
04-23-2025, 17-32-15.png
04-23-2025, 17-32-15.png (73.62 KiB) Viewed 151 times
04-23-2025, 17-32-32.png
04-23-2025, 17-32-32.png (54.71 KiB) Viewed 151 times
Also it do not show bonuses (and seems to do not apply them) for regular drills (pumpjacks too) in tooltip but shows them in factoropedia (big drills works fine)
04-23-2025, 17-36-23.png
04-23-2025, 17-36-23.png (145.01 KiB) Viewed 151 times
04-23-2025, 17-36-56.png
04-23-2025, 17-36-56.png (95.65 KiB) Viewed 151 times
Post Reply

Return to “Modding help”