Auto Research (Redistributed)


Automates research. Toggle GUI with Shift+T (customizable). (Temporarily redistributed by Malderan for 0.18 support)

Utilities
4 years ago
0.18
11

b Icon sprite startup error

4 years ago

The version 5.0.4 causes me a start-up error if I have Dark Matter Replicators ("my" version, https://mods.factorio.com/mod/dark-matter-replicators-18 ). DMR has a 64x64 icon size for a science pack, and this picks it up and applies 32x32 size.

4 years ago
(updated 4 years ago)

i have a fix for that if you don't want to wait... Replace the lines in data-final-fixes.lua with the following, it uses the tool icon size to set the size and scale:

-- dynamically add sprites for tools (to display research ingredients)
for _ , tool in pairs(data.raw.tool) do
if tool.icon or tool.icons then
data:extend({
{
type = "sprite",
name = "auto_research_tool_" .. tool.name,
filename = tool.icon or (tool.icons[1] and tool.icons[1].icon) or nil,
priority = "extra-high-no-scale",
width = tool.icon_size,--64,
height = tool.icon_size,--64,
scale = 16/tool.icon_size--0.25
}
})
end
end

4 years ago

Thanks, I won't be needing it right this moment, but I will try it later.

4 years ago

have other mod that get effected https://cdn.discordapp.com/attachments/488707809001603072/690958889730048121/unknown.png
just any know when a public fix possibly is coming ?

4 years ago

Thanks for the feedback folks - i will try to implement this fix in the next day or two

4 years ago

i have a fix for that if you don't want to wait... Replace the lines in data-final-fixes.lua with the following, it uses the tool icon size to set the size and scale:

-- dynamically add sprites for tools (to display research ingredients)
for _ , tool in pairs(data.raw.tool) do
if tool.icon or tool.icons then
data:extend({
{
type = "sprite",
name = "auto_research_tool_" .. tool.name,
filename = tool.icon or (tool.icons[1] and tool.icons[1].icon) or nil,
priority = "extra-high-no-scale",
width = tool.icon_size,--64,
height = tool.icon_size,--64,
scale = 16/tool.icon_size--0.25
}
})
end
end
Thanks. that fixed it.

4 years ago

The fix does not always work

4 years ago

This works for me

-- dynamically add sprites for tools (to display research ingredients)
for _, tool in pairs(data.raw.tool) do
    if tool.icon or tool.icons then
        log(serpent.block(tool))
        data:extend({
            {
                type = "sprite",
                name = "auto_research_tool_" .. tool.name,
                filename = tool.icon or (tool.icons[1] and tool.icons[1].icon) or nil,
                priority = "extra-high-no-scale",
                width = tool.icon_size or tool.icons[1].icon_size, -- 64,
                height = tool.icon_size or tool.icons[1].icon_size, -- 64,
                scale = 16 / (tool.icon_size or tool.icons[1].icon_size) -- 0.25
            }
        })
    end
end

New response