Page 1 of 1

Hiding flags from splitters.

Posted: Sat Apr 20, 2024 6:13 am
by Doctor_Willis
Hi everyone.
I'm trying to hide certain items from the splitter's filter menu.
I've been successful with most of them, but I've got ten that won't hide, even with the flags set to hidden.
My code (in data-updates.lua) is below, with the problem items being the ones at the bottom.

None of the items are needed in the mod (except maybe the automation-science-pack).

Has anyone got an idea on how to fix this?

Code: Select all

if data.raw["furnace"]["stone-furnace"] then
    data.raw["furnace"]["stone-furnace"].next_upgrade = nil
end

local item_flags_to_hide = {
    "wood",
    "coal",
    "stone",
    "iron-ore",
    "copper-ore",
    "uranium-ore",
    "iron-plate",
    "copper-plate",
    "copper-cable",
    "iron-stick",
    "iron-gear-wheel",
    "electronic-circuit",
    "wooden-chest",
    "iron-chest",
    "burner-inserter",
    "small-electric-pole",
    "stone-brick",
    "boiler",
    "steam-engine",
    "burner-mining-drill",
    "electric-mining-drill",
    "offshore-pump",
    "lab",
    "radar",
    "stone-furnace",

    -- These ten are the problem
    "repair-pack",
    "blueprint",
    "deconstruction-planner",
    "upgrade-planner",
    "blueprint-book",
    "raw-fish",
    "automation-science-pack",
    "pistol",
    "firearm-magazine",
    "light-armor"
}
for _, item_name in pairs(item_flags_to_hide) do
    if data.raw.item[item_name] then
        data.raw.item[item_name].flags = {"hidden"}
    end
end

Re: Hiding flags from splitters.

Posted: Sat Apr 20, 2024 9:41 am
by picklock
The problems may be due to the fact that the "items" causing the problems are not of the type "item". I haven't tested it myself, but that is at least one difference to the items with which it works.

Re: Hiding flags from splitters.

Posted: Sat Apr 20, 2024 4:45 pm
by Doctor_Willis
I think you're right. I can't believe I missed this!
I'm not at my PC right now, so can't test it, but I've just looked at data.raw and none of the problem items are actually "items"